fern-api 5.197.0 → 5.198.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 +12 -11
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -236,9 +236,9 @@ ${m.join(`
|
|
|
236
236
|
|
|
237
237
|
`)}f.write("payload.value = newResult;"),f.write("return payload;");let I=f.compile();return(C,x)=>I(d,C,x)},o,s=h6e,a=!zLt.jitless,l=a&&Qmo.value,u=t.catchall,p;e._zod.parse=(d,f)=>{p??(p=n.value);let m=d.value;return s(m)?a&&l&&f?.async===!1&&f.jitless!==!0?(o||(o=i(t.shape)),d=o(d,f),u?YUc([],m,d,f,p,e):d):r(d,f):(d.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),d)}});XLt=Cr("$ZodUnion",(e,t)=>{Jl.init(e,t),Up(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Up(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Up(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Up(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>LLt(o.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,o)=>{if(r)return n(i,o);let s=!1,a=[];for(let c of t.options){let l=c._zod.run({value:i.value,issues:[]},o);if(l instanceof Promise)a.push(l),s=!0;else{if(l.issues.length===0)return l;a.push(l)}}return s?Promise.all(a).then(c=>zUc(c,i,e,o)):zUc(a,i,e,o)}});Bgo=Cr("$ZodXor",(e,t)=>{XLt.init(e,t),t.inclusive=!1;let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,o)=>{if(r)return n(i,o);let s=!1,a=[];for(let c of t.options){let l=c._zod.run({value:i.value,issues:[]},o);l instanceof Promise?(a.push(l),s=!0):a.push(l)}return s?Promise.all(a).then(c=>QUc(c,i,e,o)):QUc(a,i,e,o)}}),Dgo=Cr("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,XLt.init(e,t);let r=e._zod.parse;Up(e._zod,"propValues",()=>{let i={};for(let o of t.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let[a,c]of Object.entries(s)){i[a]||(i[a]=new Set);for(let l of c)i[a].add(l)}}return i});let n=dtt(()=>{let i=t.options,o=new Map;for(let s of i){let a=s._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let c of a){if(o.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);o.set(c,s)}}return o});e._zod.parse=(i,o)=>{let s=i.value;if(!h6e(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),i;let a=n.value.get(s?.[t.discriminator]);return a?a._zod.run(i,o):t.unionFallback?r(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),i)}}),Rgo=Cr("$ZodIntersection",(e,t)=>{Jl.init(e,t),e._zod.parse=(r,n)=>{let i=r.value,o=t.left._zod.run({value:i,issues:[]},n),s=t.right._zod.run({value:i,issues:[]},n);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([c,l])=>MUc(r,c,l)):MUc(r,o,s)}});CRr=Cr("$ZodTuple",(e,t)=>{Jl.init(e,t);let r=t.items;e._zod.parse=(n,i)=>{let o=n.value;if(!Array.isArray(o))return n.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),n;n.value=[];let s=[],a=[...r].reverse().findIndex(u=>u._zod.optin!=="optional"),c=a===-1?0:r.length-a;if(!t.rest){let u=o.length>r.length,p=o.length<c-1;if(u||p)return n.issues.push({...u?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:o,inst:e,origin:"array"}),n}let l=-1;for(let u of r){if(l++,l>=o.length&&l>=c)continue;let p=u._zod.run({value:o[l],issues:[]},i);p instanceof Promise?s.push(p.then(d=>gRr(d,n,l))):gRr(p,n,l)}if(t.rest){let u=o.slice(r.length);for(let p of u){l++;let d=t.rest._zod.run({value:p,issues:[]},i);d instanceof Promise?s.push(d.then(f=>gRr(f,n,l))):gRr(d,n,l)}}return s.length?Promise.all(s).then(()=>n):n}});kgo=Cr("$ZodRecord",(e,t)=>{Jl.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!ive(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s){r.value={};let a=new Set;for(let l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){a.add(typeof l=="number"?l.toString():l);let u=t.valueType._zod.run({value:i[l],issues:[]},n);u instanceof Promise?o.push(u.then(p=>{p.issues.length&&r.issues.push(...W6(l,p.issues)),r.value[l]=p.value})):(u.issues.length&&r.issues.push(...W6(l,u.issues)),r.value[l]=u.value)}let c;for(let l in i)a.has(l)||(c=c??[],c.push(l));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(i)){if(a==="__proto__")continue;let c=t.keyType._zod.run({value:a,issues:[]},n);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&pRr.test(a)&&c.issues.length){let p=t.keyType._zod.run({value:Number(a),issues:[]},n);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(c=p)}if(c.issues.length){t.mode==="loose"?r.value[a]=i[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(p=>Fz(p,n,GI())),input:a,path:[a],inst:e});continue}let u=t.valueType._zod.run({value:i[a],issues:[]},n);u instanceof Promise?o.push(u.then(p=>{p.issues.length&&r.issues.push(...W6(a,p.issues)),r.value[c.value]=p.value})):(u.issues.length&&r.issues.push(...W6(a,u.issues)),r.value[c.value]=u.value)}}return o.length?Promise.all(o).then(()=>r):r}}),Fgo=Cr("$ZodMap",(e,t)=>{Jl.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),r;let o=[];r.value=new Map;for(let[s,a]of i){let c=t.keyType._zod.run({value:s,issues:[]},n),l=t.valueType._zod.run({value:a,issues:[]},n);c instanceof Promise||l instanceof Promise?o.push(Promise.all([c,l]).then(([u,p])=>{LUc(u,p,r,s,i,e,n)})):LUc(c,l,r,s,i,e,n)}return o.length?Promise.all(o).then(()=>r):r}});Ngo=Cr("$ZodSet",(e,t)=>{Jl.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Set))return r.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let s of i){let a=t.valueType._zod.run({value:s,issues:[]},n);a instanceof Promise?o.push(a.then(c=>_Uc(c,r))):_Uc(a,r)}return o.length?Promise.all(o).then(()=>r):r}});jgo=Cr("$ZodEnum",(e,t)=>{Jl.init(e,t);let r=MLt(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>_Lt.has(typeof i)).map(i=>typeof i=="string"?FV(i):i.toString()).join("|")})$`),e._zod.parse=(i,o)=>{let s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:r,input:s,inst:e}),i}}),zgo=Cr("$ZodLiteral",(e,t)=>{if(Jl.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?FV(n):n?FV(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let o=n.value;return r.has(o)||n.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),n}}),Qgo=Cr("$ZodFile",(e,t)=>{Jl.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return i instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:i,inst:e}),r}}),Mgo=Cr("$ZodTransform",(e,t)=>{Jl.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new tve(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(s=>(r.value=s,r));if(i instanceof Promise)throw new vH;return r.value=i,r}});xRr=Cr("$ZodOptional",(e,t)=>{Jl.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Up(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Up(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${LLt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>UUc(o,r.value)):UUc(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),Lgo=Cr("$ZodExactOptional",(e,t)=>{xRr.init(e,t),Up(e._zod,"values",()=>t.innerType._zod.values),Up(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),_go=Cr("$ZodNullable",(e,t)=>{Jl.init(e,t),Up(e._zod,"optin",()=>t.innerType._zod.optin),Up(e._zod,"optout",()=>t.innerType._zod.optout),Up(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${LLt(r.source)}|null)$`):void 0}),Up(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),Ugo=Cr("$ZodDefault",(e,t)=>{Jl.init(e,t),e._zod.optin="optional",Up(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>VUc(o,t)):VUc(i,t)}});Vgo=Cr("$ZodPrefault",(e,t)=>{Jl.init(e,t),e._zod.optin="optional",Up(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),Ggo=Cr("$ZodNonOptional",(e,t)=>{Jl.init(e,t),Up(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>GUc(o,e)):GUc(i,e)}});qgo=Cr("$ZodSuccess",(e,t)=>{Jl.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new tve("ZodSuccess");let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>(r.value=o.issues.length===0,r)):(r.value=i.issues.length===0,r)}}),Wgo=Cr("$ZodCatch",(e,t)=>{Jl.init(e,t),Up(e._zod,"optin",()=>t.innerType._zod.optin),Up(e._zod,"optout",()=>t.innerType._zod.optout),Up(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(s=>Fz(s,n,GI()))},input:r.value}),r.issues=[]),r)):(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(o=>Fz(o,n,GI()))},input:r.value}),r.issues=[]),r)}}),Hgo=Cr("$ZodNaN",(e,t)=>{Jl.init(e,t),e._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),Kgo=Cr("$ZodPipe",(e,t)=>{Jl.init(e,t),Up(e._zod,"values",()=>t.in._zod.values),Up(e._zod,"optin",()=>t.in._zod.optin),Up(e._zod,"optout",()=>t.out._zod.optout),Up(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let o=t.out._zod.run(r,n);return o instanceof Promise?o.then(s=>ARr(s,t.in,n)):ARr(o,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(o=>ARr(o,t.out,n)):ARr(i,t.out,n)}});ZLt=Cr("$ZodCodec",(e,t)=>{Jl.init(e,t),Up(e._zod,"values",()=>t.in._zod.values),Up(e._zod,"optin",()=>t.in._zod.optin),Up(e._zod,"optout",()=>t.out._zod.optout),Up(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>yRr(s,t,n)):yRr(o,t,n)}else{let o=t.out._zod.run(r,n);return o instanceof Promise?o.then(s=>yRr(s,t,n)):yRr(o,t,n)}}});Jgo=Cr("$ZodReadonly",(e,t)=>{Jl.init(e,t),Up(e._zod,"propValues",()=>t.innerType._zod.propValues),Up(e._zod,"values",()=>t.innerType._zod.values),Up(e._zod,"optin",()=>t.innerType?._zod?.optin),Up(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(qUc):qUc(i)}});Ygo=Cr("$ZodTemplateLiteral",(e,t)=>{Jl.init(e,t);let r=[];for(let n of t.parts)if(typeof n=="object"&&n!==null){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let i=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!i)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let o=i.startsWith("^")?1:0,s=i.endsWith("$")?i.length-1:i.length;r.push(i.slice(o,s))}else if(n===null||Lmo.has(typeof n))r.push(FV(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(n,i)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}),n):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),n)}),Xgo=Cr("$ZodFunction",(e,t)=>(Jl.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...n){let i=e._def.input?eRr(e._def.input,n):n,o=Reflect.apply(r,this,i);return e._def.output?eRr(e._def.output,o):o}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...n){let i=e._def.input?await tRr(e._def.input,n):n,o=await Reflect.apply(r,this,i);return e._def.output?await tRr(e._def.output,o):o}},e._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let n=e.constructor;return Array.isArray(r[0])?new n({type:"function",input:new CRr({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new n({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let n=e.constructor;return new n({type:"function",input:e._def.input,output:r})},e)),Zgo=Cr("$ZodPromise",(e,t)=>{Jl.init(e,t),e._zod.parse=(r,n)=>Promise.resolve(r.value).then(i=>t.innerType._zod.run({value:i,issues:[]},n))}),$go=Cr("$ZodLazy",(e,t)=>{Jl.init(e,t),Up(e._zod,"innerType",()=>t.getter()),Up(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Up(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Up(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Up(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n)}),eAo=Cr("$ZodCustom",(e,t)=>{zA.init(e,t),Jl.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(o=>WUc(o,r,n,e));WUc(i,r,n,e)}})});function ZUc(){return{localeError:yQd()}}var yQd,$Uc=h(()=>{"use strict";Va();yQd=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(i){return e[i]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${i.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":return i.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${ci(i.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${i.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${i.prefix}"`:o.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${o.suffix}"`:o.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${o.includes}"`:o.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${o.pattern}`:`${r[o.format]??i.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${i.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${i.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${i.keys.length>1?"\u0629":""}: ${rn(i.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${i.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${i.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}}});function eVc(){return{localeError:bQd()}}var bQd,tVc=h(()=>{"use strict";Va();bQd=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(i){return e[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${i.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${a}`}case"invalid_value":return i.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${ci(i.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${o}${i.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${o}${i.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[o.format]??i.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${i.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${i.keys.length>1?"lar":""}: ${rn(i.keys,", ")}`;case"invalid_key":return`${i.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${i.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}}});function rVc(e,t,r,n){let i=Math.abs(e),o=i%10,s=i%100;return s>=11&&s<=19?n:o===1?t:o>=2&&o<=4?r:n}function nVc(){return{localeError:EQd()}}var EQd,iVc=h(()=>{"use strict";Va();EQd=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(i){return e[i]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},n={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${i.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":return i.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${ci(i.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);if(s){let a=Number(i.maximum),c=rVc(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${i.maximum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);if(s){let a=Number(i.minimum),c=rVc(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${i.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[o.format]??i.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${i.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${rn(i.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${i.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${i.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}}});function oVc(){return{localeError:IQd()}}var IQd,sVc=h(()=>{"use strict";Va();IQd=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(i){return e[i]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${ci(i.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${i.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${i.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;if(o.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${o.prefix}"`;if(o.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${o.suffix}"`;if(o.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${o.includes}"`;if(o.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${o.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${r[o.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${i.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${i.keys.length>1?"\u043E\u0432\u0435":""}: ${rn(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${i.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}}});function aVc(){return{localeError:vQd()}}var vQd,cVc=h(()=>{"use strict";Va();vQd=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(i){return e[i]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${i.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${a}`}case"invalid_value":return i.values.length===1?`Valor inv\xE0lid: s'esperava ${ci(i.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${rn(i.values," o ")}`;case"too_big":{let o=i.inclusive?"com a m\xE0xim":"menys de",s=t(i.origin);return s?`Massa gran: s'esperava que ${i.origin??"el valor"} contingu\xE9s ${o} ${i.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${i.origin??"el valor"} fos ${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?"com a m\xEDnim":"m\xE9s de",s=t(i.origin);return s?`Massa petit: s'esperava que ${i.origin} contingu\xE9s ${o} ${i.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${i.origin} fos ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${r[o.format]??i.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${i.divisor}`;case"unrecognized_keys":return`Clau${i.keys.length>1?"s":""} no reconeguda${i.keys.length>1?"s":""}: ${rn(i.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${i.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${i.origin}`;default:return"Entrada inv\xE0lida"}}}});function lVc(){return{localeError:CQd()}}var CQd,uVc=h(()=>{"use strict";Va();CQd=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(i){return e[i]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},n={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${i.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${a}`}case"invalid_value":return i.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${ci(i.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${o}${i.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${o}${i.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${r[o.format]??i.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${i.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${rn(i.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${i.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${i.origin}`;default:return"Neplatn\xFD vstup"}}}});function pVc(){return{localeError:xQd()}}var xQd,fVc=h(()=>{"use strict";Va();xQd=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(i){return e[i]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Ugyldigt input: forventede instanceof ${i.expected}, fik ${a}`:`Ugyldigt input: forventede ${o}, fik ${a}`}case"invalid_value":return i.values.length===1?`Ugyldig v\xE6rdi: forventede ${ci(i.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin),a=n[i.origin]??i.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${o} ${i.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin),a=n[i.origin]??i.origin;return s?`For lille: forventede ${a} ${s.verb} ${o} ${i.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.format]??i.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${rn(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${i.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${i.origin}`;default:return"Ugyldigt input"}}}});function dVc(){return{localeError:SQd()}}var SQd,mVc=h(()=>{"use strict";Va();SQd=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(i){return e[i]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},n={nan:"NaN",number:"Zahl",array:"Array"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${i.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${a}`}case"invalid_value":return i.values.length===1?`Ung\xFCltige Eingabe: erwartet ${ci(i.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${o}${i.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${o}${i.maximum.toString()} ist`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Zu klein: erwartet, dass ${i.origin} ${o}${i.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${i.origin} ${o}${i.minimum.toString()} ist`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${r[o.format]??i.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${i.divisor} sein`;case"unrecognized_keys":return`${i.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${rn(i.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${i.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${i.origin}`;default:return"Ung\xFCltige Eingabe"}}}});function SRr(){return{localeError:wQd()}}var wQd,rAo=h(()=>{"use strict";Va();wQd=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${ci(i.values[0])}`:`Invalid option: expected one of ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Too big: expected ${i.origin??"value"} to have ${o}${i.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Too small: expected ${i.origin} to have ${o}${i.minimum.toString()} ${s.unit}`:`Too small: expected ${i.origin} to be ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${rn(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}}});function hVc(){return{localeError:TQd()}}var TQd,gVc=h(()=>{"use strict";Va();TQd=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(i){return e[i]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},n={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${i.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${a}`}case"invalid_value":return i.values.length===1?`Nevalida enigo: atendi\u011Dis ${ci(i.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${o}${i.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Tro malgranda: atendi\u011Dis ke ${i.origin} havu ${o}${i.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${i.origin} estu ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.format]??i.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${i.divisor}`;case"unrecognized_keys":return`Nekonata${i.keys.length>1?"j":""} \u015Dlosilo${i.keys.length>1?"j":""}: ${rn(i.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${i.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${i.origin}`;default:return"Nevalida enigo"}}}});function AVc(){return{localeError:OQd()}}var OQd,yVc=h(()=>{"use strict";Va();OQd=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(i){return e[i]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${i.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${a}`}case"invalid_value":return i.values.length===1?`Entrada inv\xE1lida: se esperaba ${ci(i.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin),a=n[i.origin]??i.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${o}${i.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin),a=n[i.origin]??i.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${o}${i.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${r[o.format]??i.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${i.divisor}`;case"unrecognized_keys":return`Llave${i.keys.length>1?"s":""} desconocida${i.keys.length>1?"s":""}: ${rn(i.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${n[i.origin]??i.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${n[i.origin]??i.origin}`;default:return"Entrada inv\xE1lida"}}}});function bVc(){return{localeError:PQd()}}var PQd,EVc=h(()=>{"use strict";Va();PQd=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(i){return e[i]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},n={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${i.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return i.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${ci(i.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${rn(i.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${i.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[o.format]??i.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${i.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${i.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${rn(i.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${i.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${i.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}}});function IVc(){return{localeError:BQd()}}var BQd,vVc=h(()=>{"use strict";Va();BQd=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(i){return e[i]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Virheellinen tyyppi: odotettiin instanceof ${i.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${a}`}case"invalid_value":return i.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${ci(i.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${i.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${i.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${r[o.format]??i.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${i.divisor} monikerta`;case"unrecognized_keys":return`${i.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${rn(i.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}}});function CVc(){return{localeError:DQd()}}var DQd,xVc=h(()=>{"use strict";Va();DQd=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(i){return e[i]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},n={nan:"NaN",number:"nombre",array:"tableau"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Entr\xE9e invalide : instanceof ${i.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${a} re\xE7u`}case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : ${ci(i.values[0])} attendu`:`Option invalide : une valeur parmi ${rn(i.values,"|")} attendue`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Trop grand : ${i.origin??"valeur"} doit ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i.origin??"valeur"} doit \xEAtre ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Trop petit : ${i.origin} doit ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`Trop petit : ${i.origin} doit \xEAtre ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${r[o.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${rn(i.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${i.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entr\xE9e invalide"}}}});function SVc(){return{localeError:RQd()}}var RQd,wVc=h(()=>{"use strict";Va();RQd=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(i){return e[i]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Entr\xE9e invalide : attendu instanceof ${i.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${a}`}case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : attendu ${ci(i.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"\u2264":"<",s=t(i.origin);return s?`Trop grand : attendu que ${i.origin??"la valeur"} ait ${o}${i.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${i.origin??"la valeur"} soit ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?"\u2265":">",s=t(i.origin);return s?`Trop petit : attendu que ${i.origin} ait ${o}${i.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${i.origin} soit ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${r[o.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${rn(i.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${i.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entr\xE9e invalide"}}}});function TVc(){return{localeError:kQd()}}var kQd,OVc=h(()=>{"use strict";Va();kQd=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=l=>l?e[l]:void 0,n=l=>{let u=r(l);return u?u.label:l??e.unknown.label},i=l=>`\u05D4${n(l)}`,o=l=>(r(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=l=>l?t[l]??null:null,a={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let u=l.expected,p=c[u??""]??n(u),d=Ai(l.input),f=c[d]??e[d]?.label??d;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(l.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${ci(l.values[0])}`;let u=l.values.map(f=>ci(f));if(l.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u[0]} \u05D0\u05D5 ${u[1]}`;let p=u[u.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let u=s(l.origin),p=i(l.origin??"value");if(l.origin==="string")return`${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let m=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(l.origin==="array"||l.origin==="set"){let m=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",g=l.inclusive?`${l.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${u?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${g}`.trim()}let d=l.inclusive?"<=":"<",f=o(l.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${p} ${f} ${d}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${f} ${d}${l.maximum.toString()}`}case"too_small":{let u=s(l.origin),p=i(l.origin??"value");if(l.origin==="string")return`${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let m=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(l.origin==="array"||l.origin==="set"){let m=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let A=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${A}`}let g=l.inclusive?`${l.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${u?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${g}`.trim()}let d=l.inclusive?">=":">",f=o(l.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${p} ${f} ${d}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${f} ${d}${l.minimum.toString()}`}case"invalid_format":{let u=l;if(u.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${u.pattern}`;let p=a[u.format],d=p?.label??u.format,m=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${d} \u05DC\u05D0 ${m}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${rn(l.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${i(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}}});function PVc(){return{localeError:FQd()}}var FQd,BVc=h(()=>{"use strict";Va();FQd=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(i){return e[i]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},n={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${i.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return i.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${ci(i.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`T\xFAl nagy: ${i.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${i.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${i.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} m\xE9rete t\xFAl kicsi ${o}${i.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} t\xFAl kicsi ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[o.format]??i.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${i.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${i.keys.length>1?"s":""}: ${rn(i.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${i.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${i.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}}});function DVc(e,t,r){return Math.abs(e)===1?t:r}function Ett(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}function RVc(){return{localeError:NQd()}}var NQd,kVc=h(()=>{"use strict";Va();NQd=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(i){return e[i]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},n={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${i.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":return i.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${ci(i.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);if(s){let a=Number(i.maximum),c=DVc(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ett(i.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${i.maximum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ett(i.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);if(s){let a=Number(i.minimum),c=DVc(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ett(i.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${i.minimum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ett(i.origin)} \u056C\u056B\u0576\u056B ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[o.format]??i.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${i.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${i.keys.length>1?"\u0576\u0565\u0580":""}. ${rn(i.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Ett(i.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Ett(i.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}}});function FVc(){return{localeError:jQd()}}var jQd,NVc=h(()=>{"use strict";Va();jQd=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(i){return e[i]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Input tidak valid: diharapkan instanceof ${i.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${o}, diterima ${a}`}case"invalid_value":return i.values.length===1?`Input tidak valid: diharapkan ${ci(i.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Terlalu besar: diharapkan ${i.origin??"value"} memiliki ${o}${i.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${i.origin??"value"} menjadi ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Terlalu kecil: diharapkan ${i.origin} memiliki ${o}${i.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${i.origin} menjadi ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${r[o.format]??i.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${i.keys.length>1?"s":""}: ${rn(i.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${i.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${i.origin}`;default:return"Input tidak valid"}}}});function jVc(){return{localeError:zQd()}}var zQd,zVc=h(()=>{"use strict";Va();zQd=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(i){return e[i]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},n={nan:"NaN",number:"n\xFAmer",array:"fylki"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${i.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return i.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${ci(i.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} hafi ${o}${i.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} s\xE9 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} hafi ${o}${i.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} s\xE9 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${r[o.format]??i.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${i.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${i.keys.length>1?"ir lyklar":"ur lykill"}: ${rn(i.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${i.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${i.origin}`;default:return"Rangt gildi"}}}});function QVc(){return{localeError:QQd()}}var QQd,MVc=h(()=>{"use strict";Va();QQd=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(i){return e[i]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"numero",array:"vettore"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Input non valido: atteso instanceof ${i.expected}, ricevuto ${a}`:`Input non valido: atteso ${o}, ricevuto ${a}`}case"invalid_value":return i.values.length===1?`Input non valido: atteso ${ci(i.values[0])}`:`Opzione non valida: atteso uno tra ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Troppo grande: ${i.origin??"valore"} deve avere ${o}${i.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${i.origin??"valore"} deve essere ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Troppo piccolo: ${i.origin} deve avere ${o}${i.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${i.origin} deve essere ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${r[o.format]??i.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${i.divisor}`;case"unrecognized_keys":return`Chiav${i.keys.length>1?"i":"e"} non riconosciut${i.keys.length>1?"e":"a"}: ${rn(i.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${i.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${i.origin}`;default:return"Input non valido"}}}});function LVc(){return{localeError:MQd()}}var MQd,_Vc=h(()=>{"use strict";Va();MQd=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(i){return e[i]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},n={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${i.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return i.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${ci(i.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${rn(i.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=i.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=t(i.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=i.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=t(i.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[o.format]??i.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${i.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${i.keys.length>1?"\u7FA4":""}: ${rn(i.keys,"\u3001")}`;case"invalid_key":return`${i.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${i.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}}});function UVc(){return{localeError:LQd()}}var LQd,VVc=h(()=>{"use strict";Va();LQd=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(i){return e[i]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},n={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${i.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":return i.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${ci(i.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${rn(i.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${i.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin} ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.prefix}"-\u10D8\u10D7`:o.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.suffix}"-\u10D8\u10D7`:o.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${o.includes}"-\u10E1`:o.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[o.format]??i.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${i.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${i.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${rn(i.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${i.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${i.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}}});function wRr(){return{localeError:_Qd()}}var _Qd,nAo=h(()=>{"use strict";Va();_Qd=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(i){return e[i]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},n={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${i.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":return i.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${ci(i.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${i.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${o} ${i.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${o.prefix}"`:o.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${o.suffix}"`:o.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${o.includes}"`:o.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[o.format]??i.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${i.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${rn(i.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${i.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${i.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}}});function GVc(){return wRr()}var qVc=h(()=>{"use strict";nAo()});function WVc(){return{localeError:UQd()}}var UQd,HVc=h(()=>{"use strict";Va();UQd=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(i){return e[i]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${i.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return i.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${ci(i.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${rn(i.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=i.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(i.origin),c=a?.unit??"\uC694\uC18C";return a?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()}${c} ${o}${s}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()} ${o}${s}`}case"too_small":{let o=i.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(i.origin),c=a?.unit??"\uC694\uC18C";return a?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()}${c} ${o}${s}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[o.format]??i.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${i.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${rn(i.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${i.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${i.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}}});function KVc(e){let t=Math.abs(e),r=t%10,n=t%100;return n>=11&&n<=19||r===0?"many":r===1?"one":"few"}function JVc(){return{localeError:VQd()}}var $Lt,VQd,YVc=h(()=>{"use strict";Va();$Lt=e=>e.charAt(0).toUpperCase()+e.slice(1);VQd=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(i,o,s,a){let c=e[i]??null;return c===null?c:{unit:c.unit[o],verb:c.verb[a][s?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},n={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${i.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${o}`}case"invalid_value":return i.values.length===1?`Privalo b\u016Bti ${ci(i.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${rn(i.values,"|")} pasirinkim\u0173`;case"too_big":{let o=n[i.origin]??i.origin,s=t(i.origin,KVc(Number(i.maximum)),i.inclusive??!1,"smaller");if(s?.verb)return`${$Lt(o??i.origin??"reik\u0161m\u0117")} ${s.verb} ${i.maximum.toString()} ${s.unit??"element\u0173"}`;let a=i.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${$Lt(o??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${i.maximum.toString()} ${s?.unit}`}case"too_small":{let o=n[i.origin]??i.origin,s=t(i.origin,KVc(Number(i.minimum)),i.inclusive??!1,"bigger");if(s?.verb)return`${$Lt(o??i.origin??"reik\u0161m\u0117")} ${s.verb} ${i.minimum.toString()} ${s.unit??"element\u0173"}`;let a=i.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${$Lt(o??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${i.minimum.toString()} ${s?.unit}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${r[o.format]??i.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${i.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${i.keys.length>1?"i":"as"} rakt${i.keys.length>1?"ai":"as"}: ${rn(i.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=n[i.origin]??i.origin;return`${$Lt(o??i.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}}});function XVc(){return{localeError:GQd()}}var GQd,ZVc=h(()=>{"use strict";Va();GQd=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(i){return e[i]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},n={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${i.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${ci(i.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${i.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${i.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${o.pattern}`:`Invalid ${r[o.format]??i.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${rn(i.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${i.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${i.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}}});function $Vc(){return{localeError:qQd()}}var qQd,e5c=h(()=>{"use strict";Va();qQd=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(i){return e[i]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"nombor"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Input tidak sah: dijangka instanceof ${i.expected}, diterima ${a}`:`Input tidak sah: dijangka ${o}, diterima ${a}`}case"invalid_value":return i.values.length===1?`Input tidak sah: dijangka ${ci(i.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Terlalu besar: dijangka ${i.origin??"nilai"} ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${i.origin??"nilai"} adalah ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Terlalu kecil: dijangka ${i.origin} ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${i.origin} adalah ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${r[o.format]??i.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${rn(i.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${i.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${i.origin}`;default:return"Input tidak sah"}}}});function t5c(){return{localeError:WQd()}}var WQd,r5c=h(()=>{"use strict";Va();WQd=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(i){return e[i]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},n={nan:"NaN",number:"getal"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Ongeldige invoer: verwacht instanceof ${i.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${o}, ontving ${a}`}case"invalid_value":return i.values.length===1?`Ongeldige invoer: verwacht ${ci(i.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin),a=i.origin==="date"?"laat":i.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${i.origin??"waarde"} ${o}${i.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${i.origin??"waarde"} ${o}${i.maximum.toString()} is`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin),a=i.origin==="date"?"vroeg":i.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${i.origin} ${o}${i.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${i.origin} ${o}${i.minimum.toString()} is`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${r[o.format]??i.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${i.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${i.keys.length>1?"s":""}: ${rn(i.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${i.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${i.origin}`;default:return"Ongeldige invoer"}}}});function n5c(){return{localeError:HQd()}}var HQd,i5c=h(()=>{"use strict";Va();HQd=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(i){return e[i]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"tall",array:"liste"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Ugyldig input: forventet instanceof ${i.expected}, fikk ${a}`:`Ugyldig input: forventet ${o}, fikk ${a}`}case"invalid_value":return i.values.length===1?`Ugyldig verdi: forventet ${ci(i.values[0])}`:`Ugyldig valg: forventet en av ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${o}${i.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`For lite(n): forventet ${i.origin} til \xE5 ha ${o}${i.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${i.origin} til \xE5 ha ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.format]??i.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${rn(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${i.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${i.origin}`;default:return"Ugyldig input"}}}});function o5c(){return{localeError:KQd()}}var KQd,s5c=h(()=>{"use strict";Va();KQd=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(i){return e[i]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},n={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`F\xE2sit giren: umulan instanceof ${i.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${a}`}case"invalid_value":return i.values.length===1?`F\xE2sit giren: umulan ${ci(i.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${o}${i.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${o}${i.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${o}${i.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${o}${i.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=i;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[o.format]??i.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${i.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${i.keys.length>1?"s":""}: ${rn(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${i.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}}});function a5c(){return{localeError:JQd()}}var JQd,c5c=h(()=>{"use strict";Va();JQd=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(i){return e[i]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},n={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${i.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return i.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${ci(i.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${rn(i.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${i.maximum.toString()} \u0648\u064A`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[o.format]??i.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${i.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${i.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${rn(i.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${i.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${i.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}}});function l5c(){return{localeError:YQd()}}var YQd,u5c=h(()=>{"use strict";Va();YQd=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(i){return e[i]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},n={nan:"NaN",number:"liczba",array:"tablica"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${i.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${a}`}case"invalid_value":return i.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${ci(i.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${i.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${i.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[o.format]??i.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${i.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${i.keys.length>1?"s":""}: ${rn(i.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${i.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${i.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}}});function p5c(){return{localeError:XQd()}}var XQd,f5c=h(()=>{"use strict";Va();XQd=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(i){return e[i]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",number:"n\xFAmero",null:"nulo"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Tipo inv\xE1lido: esperado instanceof ${i.expected}, recebido ${a}`:`Tipo inv\xE1lido: esperado ${o}, recebido ${a}`}case"invalid_value":return i.values.length===1?`Entrada inv\xE1lida: esperado ${ci(i.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Muito grande: esperado que ${i.origin??"valor"} tivesse ${o}${i.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${i.origin??"valor"} fosse ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Muito pequeno: esperado que ${i.origin} tivesse ${o}${i.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${i.origin} fosse ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${r[o.format]??i.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${i.divisor}`;case"unrecognized_keys":return`Chave${i.keys.length>1?"s":""} desconhecida${i.keys.length>1?"s":""}: ${rn(i.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${i.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${i.origin}`;default:return"Campo inv\xE1lido"}}}});function d5c(e,t,r,n){let i=Math.abs(e),o=i%10,s=i%100;return s>=11&&s<=19?n:o===1?t:o>=2&&o<=4?r:n}function m5c(){return{localeError:ZQd()}}var ZQd,h5c=h(()=>{"use strict";Va();ZQd=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(i){return e[i]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${ci(i.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);if(s){let a=Number(i.maximum),c=d5c(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${i.maximum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);if(s){let a=Number(i.minimum),c=d5c(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${i.minimum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[o.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${i.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0438":""}: ${rn(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${i.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}}});function g5c(){return{localeError:$Qd()}}var $Qd,A5c=h(()=>{"use strict";Va();$Qd=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(i){return e[i]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},n={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${i.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${a}`}case"invalid_value":return i.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${ci(i.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} imelo ${o}${i.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${i.origin} imelo ${o}${i.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${r[o.format]??i.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${i.divisor}`;case"unrecognized_keys":return`Neprepoznan${i.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${rn(i.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${i.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${i.origin}`;default:return"Neveljaven vnos"}}}});function y5c(){return{localeError:eMd()}}var eMd,b5c=h(()=>{"use strict";Va();eMd=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(i){return e[i]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},n={nan:"NaN",number:"antal",array:"lista"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${i.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${a}`}case"invalid_value":return i.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${ci(i.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${o}${i.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${i.origin??"v\xE4rdet"} att ha ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${o}${i.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${r[o.format]??i.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${rn(i.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${i.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${i.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}}});function E5c(){return{localeError:tMd()}}var tMd,I5c=h(()=>{"use strict";Va();tMd=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(i){return e[i]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${i.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":return i.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${ci(i.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${rn(i.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${i.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${i.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin} ${o}${i.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin} ${o}${i.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[o.format]??i.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${i.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${i.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${rn(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${i.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}}});function v5c(){return{localeError:rMd()}}var rMd,C5c=h(()=>{"use strict";Va();rMd=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(i){return e[i]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},n={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${i.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":return i.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${ci(i.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=t(i.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${i.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=t(i.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${i.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${o.prefix}"`:o.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${o.suffix}"`:o.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[o.format]??i.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${i.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${rn(i.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${i.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${i.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}}});function x5c(){return{localeError:nMd()}}var nMd,S5c=h(()=>{"use strict";Va();nMd=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(i){return e[i]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${i.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${a}`}case"invalid_value":return i.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${ci(i.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${o}${i.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${o}${i.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.format]??i.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${i.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${i.keys.length>1?"lar":""}: ${rn(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${i.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}}});function TRr(){return{localeError:iMd()}}var iMd,iAo=h(()=>{"use strict";Va();iMd=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(i){return e[i]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${i.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${ci(i.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin} ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin} \u0431\u0443\u0434\u0435 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[o.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0456":""}: ${rn(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${i.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}}});function w5c(){return TRr()}var T5c=h(()=>{"use strict";iAo()});function O5c(){return{localeError:oMd()}}var oMd,P5c=h(()=>{"use strict";Va();oMd=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(i){return e[i]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},n={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${i.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return i.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${ci(i.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${rn(i.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${i.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u06D2 ${o}${i.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u0627 ${o}${i.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[o.format]??i.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${i.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${i.keys.length>1?"\u0632":""}: ${rn(i.keys,"\u060C ")}`;case"invalid_key":return`${i.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${i.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}}});function B5c(){return{localeError:sMd()}}var sMd,D5c=h(()=>{"use strict";Va();sMd=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"}};function t(i){return e[i]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},n={nan:"NaN",number:"raqam",array:"massiv"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${i.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${a}`}case"invalid_value":return i.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${ci(i.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Juda katta: kutilgan ${i.origin??"qiymat"} ${o}${i.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${i.origin??"qiymat"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Juda kichik: kutilgan ${i.origin} ${o}${i.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[o.format]??i.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${i.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${i.keys.length>1?"lar":""}: ${rn(i.keys,", ")}`;case"invalid_key":return`${i.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${i.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}}});function R5c(){return{localeError:aMd()}}var aMd,k5c=h(()=>{"use strict";Va();aMd=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(i){return e[i]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},n={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${i.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return i.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${ci(i.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${r[o.format]??i.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${i.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${rn(i.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${i.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${i.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}}});function F5c(){return{localeError:cMd()}}var cMd,N5c=h(()=>{"use strict";Va();cMd=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(i){return e[i]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},n={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${i.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return i.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${ci(i.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${o}${i.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${o}${i.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${r[o.format]??i.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${i.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${rn(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${i.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}}});function j5c(){return{localeError:lMd()}}var lMd,z5c=h(()=>{"use strict";Va();lMd=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(i){return e[i]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${i.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return i.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${ci(i.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${o}${i.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${o}${i.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${r[o.format]??i.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${i.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${i.keys.length>1?"\u5011":""}\uFF1A${rn(i.keys,"\u3001")}`;case"invalid_key":return`${i.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${i.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}}});function Q5c(){return{localeError:uMd()}}var uMd,M5c=h(()=>{"use strict";Va();uMd=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(i){return e[i]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},n={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=Ai(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${i.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return i.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${ci(i.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${rn(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=t(i.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${i.origin??"iye"} ${s.verb} ${o}${i.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${i.maximum}`}case"too_small":{let o=i.inclusive?">=":">",s=t(i.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${i.origin} ${s.verb} ${o}${i.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${i.minimum}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${r[o.format]??i.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${i.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${rn(i.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${i.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${i.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}}});var e6t={};ne(e6t,{ar:()=>ZUc,az:()=>eVc,be:()=>nVc,bg:()=>oVc,ca:()=>aVc,cs:()=>lVc,da:()=>pVc,de:()=>dVc,en:()=>SRr,eo:()=>hVc,es:()=>AVc,fa:()=>bVc,fi:()=>IVc,fr:()=>CVc,frCA:()=>SVc,he:()=>TVc,hu:()=>PVc,hy:()=>RVc,id:()=>FVc,is:()=>jVc,it:()=>QVc,ja:()=>LVc,ka:()=>UVc,kh:()=>GVc,km:()=>wRr,ko:()=>WVc,lt:()=>JVc,mk:()=>XVc,ms:()=>$Vc,nl:()=>t5c,no:()=>n5c,ota:()=>o5c,pl:()=>l5c,ps:()=>a5c,pt:()=>p5c,ru:()=>m5c,sl:()=>g5c,sv:()=>y5c,ta:()=>E5c,th:()=>v5c,tr:()=>x5c,ua:()=>w5c,uk:()=>TRr,ur:()=>O5c,uz:()=>B5c,vi:()=>R5c,yo:()=>Q5c,zhCN:()=>F5c,zhTW:()=>j5c});var oAo=h(()=>{"use strict";$Uc();tVc();iVc();sVc();cVc();uVc();fVc();mVc();rAo();gVc();yVc();EVc();vVc();xVc();wVc();OVc();BVc();kVc();NVc();zVc();MVc();_Vc();VVc();qVc();nAo();HVc();YVc();ZVc();e5c();r5c();i5c();s5c();c5c();u5c();f5c();h5c();A5c();b5c();I5c();C5c();S5c();T5c();iAo();P5c();D5c();k5c();N5c();z5c();M5c()});function PRr(){return new ORr}var L5c,sAo,aAo,ORr,RP,t6t=h(()=>{"use strict";sAo=Symbol("ZodOutput"),aAo=Symbol("ZodInput"),ORr=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};(L5c=globalThis).__zod_globalRegistry??(L5c.__zod_globalRegistry=PRr());RP=globalThis.__zod_globalRegistry});function cAo(e,t){return new e({type:"string",...Bi(t)})}function lAo(e,t){return new e({type:"string",coerce:!0,...Bi(t)})}function BRr(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Bi(t)})}function r6t(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Bi(t)})}function DRr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Bi(t)})}function RRr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Bi(t)})}function kRr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Bi(t)})}function FRr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Bi(t)})}function n6t(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Bi(t)})}function NRr(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Bi(t)})}function jRr(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Bi(t)})}function zRr(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Bi(t)})}function QRr(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Bi(t)})}function MRr(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Bi(t)})}function LRr(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Bi(t)})}function _Rr(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Bi(t)})}function URr(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Bi(t)})}function VRr(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Bi(t)})}function uAo(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...Bi(t)})}function GRr(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Bi(t)})}function qRr(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Bi(t)})}function WRr(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Bi(t)})}function HRr(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Bi(t)})}function KRr(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Bi(t)})}function JRr(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Bi(t)})}function fAo(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Bi(t)})}function dAo(e,t){return new e({type:"string",format:"date",check:"string_format",...Bi(t)})}function mAo(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Bi(t)})}function hAo(e,t){return new e({type:"string",format:"duration",check:"string_format",...Bi(t)})}function gAo(e,t){return new e({type:"number",checks:[],...Bi(t)})}function AAo(e,t){return new e({type:"number",coerce:!0,checks:[],...Bi(t)})}function yAo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Bi(t)})}function bAo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...Bi(t)})}function EAo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...Bi(t)})}function IAo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...Bi(t)})}function vAo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...Bi(t)})}function CAo(e,t){return new e({type:"boolean",...Bi(t)})}function xAo(e,t){return new e({type:"boolean",coerce:!0,...Bi(t)})}function SAo(e,t){return new e({type:"bigint",...Bi(t)})}function wAo(e,t){return new e({type:"bigint",coerce:!0,...Bi(t)})}function TAo(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Bi(t)})}function OAo(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Bi(t)})}function PAo(e,t){return new e({type:"symbol",...Bi(t)})}function BAo(e,t){return new e({type:"undefined",...Bi(t)})}function DAo(e,t){return new e({type:"null",...Bi(t)})}function RAo(e){return new e({type:"any"})}function kAo(e){return new e({type:"unknown"})}function FAo(e,t){return new e({type:"never",...Bi(t)})}function NAo(e,t){return new e({type:"void",...Bi(t)})}function jAo(e,t){return new e({type:"date",...Bi(t)})}function zAo(e,t){return new e({type:"date",coerce:!0,...Bi(t)})}function QAo(e,t){return new e({type:"nan",...Bi(t)})}function mee(e,t){return new dRr({check:"less_than",...Bi(t),value:e,inclusive:!1})}function H6(e,t){return new dRr({check:"less_than",...Bi(t),value:e,inclusive:!0})}function hee(e,t){return new mRr({check:"greater_than",...Bi(t),value:e,inclusive:!1})}function MF(e,t){return new mRr({check:"greater_than",...Bi(t),value:e,inclusive:!0})}function YRr(e){return hee(0,e)}function XRr(e){return mee(0,e)}function ZRr(e){return H6(0,e)}function $Rr(e){return MF(0,e)}function sve(e,t){return new xho({check:"multiple_of",...Bi(t),value:e})}function ave(e,t){return new Tho({check:"max_size",...Bi(t),maximum:e})}function gee(e,t){return new Oho({check:"min_size",...Bi(t),minimum:e})}function y6e(e,t){return new Pho({check:"size_equals",...Bi(t),size:e})}function b6e(e,t){return new Bho({check:"max_length",...Bi(t),maximum:e})}function wfe(e,t){return new Dho({check:"min_length",...Bi(t),minimum:e})}function E6e(e,t){return new Rho({check:"length_equals",...Bi(t),length:e})}function Itt(e,t){return new kho({check:"string_format",format:"regex",...Bi(t),pattern:e})}function vtt(e){return new Fho({check:"string_format",format:"lowercase",...Bi(e)})}function Ctt(e){return new Nho({check:"string_format",format:"uppercase",...Bi(e)})}function xtt(e,t){return new jho({check:"string_format",format:"includes",...Bi(t),includes:e})}function Stt(e,t){return new zho({check:"string_format",format:"starts_with",...Bi(t),prefix:e})}function wtt(e,t){return new Qho({check:"string_format",format:"ends_with",...Bi(t),suffix:e})}function ekr(e,t,r){return new Mho({check:"property",property:e,schema:t,...Bi(r)})}function Ttt(e,t){return new Lho({check:"mime_type",mime:e,...Bi(t)})}function CH(e){return new _ho({check:"overwrite",tx:e})}function Ott(e){return CH(t=>t.normalize(e))}function Ptt(){return CH(e=>e.trim())}function Btt(){return CH(e=>e.toLowerCase())}function Dtt(){return CH(e=>e.toUpperCase())}function Rtt(){return CH(e=>zmo(e))}function MAo(e,t,r){return new e({type:"array",element:t,...Bi(r)})}function fMd(e,t,r){return new e({type:"union",options:t,...Bi(r)})}function dMd(e,t,r){return new e({type:"union",options:t,inclusive:!1,...Bi(r)})}function mMd(e,t,r,n){return new e({type:"union",options:r,discriminator:t,...Bi(n)})}function hMd(e,t,r){return new e({type:"intersection",left:t,right:r})}function gMd(e,t,r,n){let i=r instanceof Jl,o=i?n:r,s=i?r:null;return new e({type:"tuple",items:t,rest:s,...Bi(o)})}function AMd(e,t,r,n){return new e({type:"record",keyType:t,valueType:r,...Bi(n)})}function yMd(e,t,r,n){return new e({type:"map",keyType:t,valueType:r,...Bi(n)})}function bMd(e,t,r){return new e({type:"set",valueType:t,...Bi(r)})}function EMd(e,t,r){let n=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new e({type:"enum",entries:n,...Bi(r)})}function IMd(e,t,r){return new e({type:"enum",entries:t,...Bi(r)})}function vMd(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...Bi(r)})}function LAo(e,t){return new e({type:"file",...Bi(t)})}function CMd(e,t){return new e({type:"transform",transform:t})}function xMd(e,t){return new e({type:"optional",innerType:t})}function SMd(e,t){return new e({type:"nullable",innerType:t})}function wMd(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():Mmo(r)}})}function TMd(e,t,r){return new e({type:"nonoptional",innerType:t,...Bi(r)})}function OMd(e,t){return new e({type:"success",innerType:t})}function PMd(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function BMd(e,t,r){return new e({type:"pipe",in:t,out:r})}function DMd(e,t){return new e({type:"readonly",innerType:t})}function RMd(e,t,r){return new e({type:"template_literal",parts:t,...Bi(r)})}function kMd(e,t){return new e({type:"lazy",getter:t})}function FMd(e,t){return new e({type:"promise",innerType:t})}function _Ao(e,t,r){let n=Bi(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function UAo(e,t,r){return new e({type:"custom",check:"custom",fn:t,...Bi(r)})}function VAo(e){let t=_5c(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(mtt(n,r.value,t._zod.def));else{let i=n;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),r.issues.push(mtt(i))}},e(r.value,r)));return t}function _5c(e,t){let r=new zA({check:"custom",...Bi(t)});return r._zod.check=e,r}function GAo(e){let t=new zA({check:"describe"});return t._zod.onattach=[r=>{let n=RP.get(r)??{};RP.add(r,{...n,description:e})}],t._zod.check=()=>{},t}function qAo(e){let t=new zA({check:"meta"});return t._zod.onattach=[r=>{let n=RP.get(r)??{};RP.add(r,{...n,...e})}],t._zod.check=()=>{},t}function WAo(e,t){let r=Bi(t),n=r.truthy??["true","1","yes","on","y","enabled"],i=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(f=>typeof f=="string"?f.toLowerCase():f),i=i.map(f=>typeof f=="string"?f.toLowerCase():f));let o=new Set(n),s=new Set(i),a=e.Codec??ZLt,c=e.Boolean??YLt,l=e.String??A6e,u=new l({type:"string",error:r.error}),p=new c({type:"boolean",error:r.error}),d=new a({type:"pipe",in:u,out:p,transform:((f,m)=>{let g=f;return r.case!=="sensitive"&&(g=g.toLowerCase()),o.has(g)?!0:s.has(g)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:m.value,inst:d,continue:!1}),{})}),reverseTransform:((f,m)=>f===!0?n[0]||"true":i[0]||"false"),error:r.error});return d}function ktt(e,t,r,n={}){let i=Bi(n),o={...Bi(n),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:a=>r.test(a),...i};return r instanceof RegExp&&(o.pattern=r),new e(o)}var pAo,U5c=h(()=>{"use strict";hRr();t6t();tAo();Va();pAo={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function cve(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??RP,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Wh(e,t,r={path:[],schemaPath:[]}){var n;let i=e._zod.def,o=t.seen.get(e);if(o)return o.count++,r.schemaPath.includes(e)&&(o.cycle=r.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let u={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,u);else{let d=s.schema,f=t.processors[i.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);f(e,t,d,u)}let p=e._zod.parent;p&&(s.ref||(s.ref=p),Wh(p,t,u),t.seen.get(p).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(s.schema,c),t.io==="input"&&LF(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&s.schema._prefault&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function lve(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let c=n.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,s[0])}}let i=s=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(s[0])?.id,d=e.external.uri??(m=>m);if(p)return{ref:d(p)};let f=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=f,{defId:f,ref:`${d("__shared")}#/${a}/${f}`}}if(s[1]===r)return{ref:"#"};let l=`#/${a}/`,u=s[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:l+u}},o=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:l}=i(s);a.def={...a.schema},l&&(a.defId=l);let u=a.schema;for(let p in u)delete u[p];u.$ref=c};if(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
238
238
|
|
|
239
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){o(s);continue}if(e.external){let l=e.external.registry.get(s[0])?.id;if(t!==s[0]&&l){o(s);continue}}if(e.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}if(a.count>1&&e.reused==="ref"){o(s);continue}}}function uve(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=s=>{let a=e.seen.get(s);if(a.ref===null)return;let c=a.def??a.schema,l={...c},u=a.ref;if(a.ref=null,u){n(u);let d=e.seen.get(u),f=d.schema;if(f.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(f)):Object.assign(c,f),Object.assign(c,l),s._zod.parent===u)for(let g in c)g==="$ref"||g==="allOf"||g in l||delete c[g];if(f.$ref&&d.def)for(let g in c)g==="$ref"||g==="allOf"||g in d.def&&JSON.stringify(c[g])===JSON.stringify(d.def[g])&&delete c[g]}let p=s._zod.parent;if(p&&p!==u){n(p);let d=e.seen.get(p);if(d?.schema.$ref&&(c.$ref=d.schema.$ref,d.def))for(let f in c)f==="$ref"||f==="allOf"||f in d.def&&JSON.stringify(c[f])===JSON.stringify(d.def[f])&&delete c[f]}e.override({zodSchema:s,jsonSchema:c,path:a.path??[]})};for(let s of[...e.seen.entries()].reverse())n(s[0]);let i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(s)}Object.assign(i,r.def??r.schema);let o=e.external?.defs??{};for(let s of e.seen.entries()){let a=s[1];a.def&&a.defId&&(o[a.defId]=a.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{let s=JSON.parse(JSON.stringify(i));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ftt(t,"input",e.processors),output:Ftt(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function LF(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return LF(n.element,r);if(n.type==="set")return LF(n.valueType,r);if(n.type==="lazy")return LF(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return LF(n.innerType,r);if(n.type==="intersection")return LF(n.left,r)||LF(n.right,r);if(n.type==="record"||n.type==="map")return LF(n.keyType,r)||LF(n.valueType,r);if(n.type==="pipe")return LF(n.in,r)||LF(n.out,r);if(n.type==="object"){for(let i in n.shape)if(LF(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(LF(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(LF(i,r))return!0;return!!(n.rest&&LF(n.rest,r))}return!1}var HAo,Ftt,i6t=h(()=>{"use strict";t6t();HAo=(e,t={})=>r=>{let n=cve({...r,processors:t});return Wh(e,n),lve(n,e),uve(n,e)},Ftt=(e,t,r={})=>n=>{let{libraryOptions:i,target:o}=n??{},s=cve({...i??{},target:o,io:t,processors:r});return Wh(e,s),lve(s,e),uve(s,e)}});function ikr(e,t){if("_idmap"in e){let n=e,i=cve({...t,processors:tkr}),o={};for(let c of n._idmap.entries()){let[l,u]=c;Wh(u,i)}let s={},a={registry:n,uri:t?.uri,defs:o};i.external=a;for(let c of n._idmap.entries()){let[l,u]=c;lve(i,u),s[l]=uve(i,u)}if(Object.keys(o).length>0){let c=i.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:o}}return{schemas:s}}let r=cve({...t,processors:tkr});return Wh(e,r),lve(r,e),uve(r,e)}var NMd,KAo,JAo,YAo,XAo,ZAo,$Ao,eyo,tyo,ryo,nyo,iyo,oyo,syo,ayo,cyo,lyo,uyo,pyo,fyo,dyo,myo,hyo,gyo,Ayo,yyo,rkr,byo,Eyo,Iyo,vyo,Cyo,xyo,Syo,wyo,Tyo,Oyo,Pyo,nkr,Byo,tkr,o6t=h(()=>{"use strict";i6t();Va();NMd={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},KAo=(e,t,r,n)=>{let i=r;i.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof s=="number"&&(i.maxLength=s),a&&(i.format=NMd[a]??a,i.format===""&&delete i.format,a==="time"&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let u=[...c];u.length===1?i.pattern=u[0].source:u.length>1&&(i.allOf=[...u.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},JAo=(e,t,r,n)=>{let i=r,{minimum:o,maximum:s,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof a=="string"&&a.includes("int")?i.type="integer":i.type="number",typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof o=="number"&&(i.minimum=o,typeof u=="number"&&t.target!=="draft-04"&&(u>=o?delete i.minimum:delete i.exclusiveMinimum)),typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof s=="number"&&(i.maximum=s,typeof l=="number"&&t.target!=="draft-04"&&(l<=s?delete i.maximum:delete i.exclusiveMaximum)),typeof c=="number"&&(i.multipleOf=c)},YAo=(e,t,r,n)=>{r.type="boolean"},XAo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},ZAo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},$Ao=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},eyo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},tyo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},ryo=(e,t,r,n)=>{r.not={}},nyo=(e,t,r,n)=>{},iyo=(e,t,r,n)=>{},oyo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},syo=(e,t,r,n)=>{let i=e._zod.def,o=MLt(i.entries);o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o},ayo=(e,t,r,n)=>{let i=e._zod.def,o=[];for(let s of i.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),o.every(s=>typeof s=="boolean")&&(r.type="boolean"),o.every(s=>s===null)&&(r.type="null"),r.enum=o},cyo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},lyo=(e,t,r,n)=>{let i=r,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=o.source},uyo=(e,t,r,n)=>{let i=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:c}=e._zod.bag;s!==void 0&&(o.minLength=s),a!==void 0&&(o.maxLength=a),c?c.length===1?(o.contentMediaType=c[0],Object.assign(i,o)):(Object.assign(i,o),i.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(i,o)},pyo=(e,t,r,n)=>{r.type="boolean"},fyo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},dyo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},myo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},hyo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},gyo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Ayo=(e,t,r,n)=>{let i=r,o=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;typeof s=="number"&&(i.minItems=s),typeof a=="number"&&(i.maxItems=a),i.type="array",i.items=Wh(o.element,t,{...n,path:[...n.path,"items"]})},yyo=(e,t,r,n)=>{let i=r,o=e._zod.def;i.type="object",i.properties={};let s=o.shape;for(let l in s)i.properties[l]=Wh(s[l],t,{...n,path:[...n.path,"properties",l]});let a=new Set(Object.keys(s)),c=new Set([...a].filter(l=>{let u=o.shape[l]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(i.required=Array.from(c)),o.catchall?._zod.def.type==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=Wh(o.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},rkr=(e,t,r,n)=>{let i=e._zod.def,o=i.inclusive===!1,s=i.options.map((a,c)=>Wh(a,t,{...n,path:[...n.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=s:r.anyOf=s},byo=(e,t,r,n)=>{let i=e._zod.def,o=Wh(i.left,t,{...n,path:[...n.path,"allOf",0]}),s=Wh(i.right,t,{...n,path:[...n.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];r.allOf=c},Eyo=(e,t,r,n)=>{let i=r,o=e._zod.def;i.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((d,f)=>Wh(d,t,{...n,path:[...n.path,s,f]})),l=o.rest?Wh(o.rest,t,{...n,path:[...n.path,a,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null;t.target==="draft-2020-12"?(i.prefixItems=c,l&&(i.items=l)):t.target==="openapi-3.0"?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:p}=e._zod.bag;typeof u=="number"&&(i.minItems=u),typeof p=="number"&&(i.maxItems=p)},Iyo=(e,t,r,n)=>{let i=r,o=e._zod.def;i.type="object";let s=o.keyType,c=s._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){let u=Wh(o.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(let p of c)i.patternProperties[p.source]=u}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=Wh(o.keyType,t,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=Wh(o.valueType,t,{...n,path:[...n.path,"additionalProperties"]});let l=s._zod.values;if(l){let u=[...l].filter(p=>typeof p=="string"||typeof p=="number");u.length>0&&(i.required=u)}},vyo=(e,t,r,n)=>{let i=e._zod.def,o=Wh(i.innerType,t,n),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=i.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},Cyo=(e,t,r,n)=>{let i=e._zod.def;Wh(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType},xyo=(e,t,r,n)=>{let i=e._zod.def;Wh(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},Syo=(e,t,r,n)=>{let i=e._zod.def;Wh(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},wyo=(e,t,r,n)=>{let i=e._zod.def;Wh(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType;let s;try{s=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},Tyo=(e,t,r,n)=>{let i=e._zod.def,o=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;Wh(o,t,n);let s=t.seen.get(e);s.ref=o},Oyo=(e,t,r,n)=>{let i=e._zod.def;Wh(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType,r.readOnly=!0},Pyo=(e,t,r,n)=>{let i=e._zod.def;Wh(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType},nkr=(e,t,r,n)=>{let i=e._zod.def;Wh(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType},Byo=(e,t,r,n)=>{let i=e._zod.innerType;Wh(i,t,n);let o=t.seen.get(e);o.ref=i},tkr={string:KAo,number:JAo,boolean:YAo,bigint:XAo,symbol:ZAo,null:$Ao,undefined:eyo,void:tyo,never:ryo,any:nyo,unknown:iyo,date:oyo,enum:syo,literal:ayo,nan:cyo,template_literal:lyo,file:uyo,success:pyo,custom:fyo,function:dyo,transform:myo,map:hyo,set:gyo,array:Ayo,object:yyo,union:rkr,intersection:byo,tuple:Eyo,record:Iyo,nullable:vyo,nonoptional:Cyo,default:xyo,prefault:Syo,catch:wyo,pipe:Tyo,readonly:Oyo,promise:Pyo,optional:nkr,lazy:Byo}});var okr,V5c=h(()=>{"use strict";o6t();i6t();okr=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=cve({processors:tkr,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return Wh(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),lve(this.ctx,t);let n=uve(this.ctx,t),{"~standard":i,...o}=n;return o}}});var G5c={};var q5c=h(()=>{"use strict"});var Tfe={};ne(Tfe,{$ZodAny:()=>Cgo,$ZodArray:()=>Ogo,$ZodAsyncError:()=>vH,$ZodBase64:()=>dgo,$ZodBase64URL:()=>mgo,$ZodBigInt:()=>vRr,$ZodBigIntFormat:()=>bgo,$ZodBoolean:()=>YLt,$ZodCIDRv4:()=>ugo,$ZodCIDRv6:()=>pgo,$ZodCUID:()=>Zho,$ZodCUID2:()=>$ho,$ZodCatch:()=>Wgo,$ZodCheck:()=>zA,$ZodCheckBigIntFormat:()=>who,$ZodCheckEndsWith:()=>Qho,$ZodCheckGreaterThan:()=>mRr,$ZodCheckIncludes:()=>jho,$ZodCheckLengthEquals:()=>Rho,$ZodCheckLessThan:()=>dRr,$ZodCheckLowerCase:()=>Fho,$ZodCheckMaxLength:()=>Bho,$ZodCheckMaxSize:()=>Tho,$ZodCheckMimeType:()=>Lho,$ZodCheckMinLength:()=>Dho,$ZodCheckMinSize:()=>Oho,$ZodCheckMultipleOf:()=>xho,$ZodCheckNumberFormat:()=>Sho,$ZodCheckOverwrite:()=>_ho,$ZodCheckProperty:()=>Mho,$ZodCheckRegex:()=>kho,$ZodCheckSizeEquals:()=>Pho,$ZodCheckStartsWith:()=>zho,$ZodCheckStringFormat:()=>btt,$ZodCheckUpperCase:()=>Nho,$ZodCodec:()=>ZLt,$ZodCustom:()=>eAo,$ZodCustomStringFormat:()=>Ago,$ZodDate:()=>Tgo,$ZodDefault:()=>Ugo,$ZodDiscriminatedUnion:()=>Dgo,$ZodE164:()=>hgo,$ZodEmail:()=>Kho,$ZodEmoji:()=>Yho,$ZodEncodeError:()=>tve,$ZodEnum:()=>jgo,$ZodError:()=>GLt,$ZodExactOptional:()=>Lgo,$ZodFile:()=>Qgo,$ZodFunction:()=>Xgo,$ZodGUID:()=>Who,$ZodIPv4:()=>ago,$ZodIPv6:()=>cgo,$ZodISODate:()=>igo,$ZodISODateTime:()=>ngo,$ZodISODuration:()=>sgo,$ZodISOTime:()=>ogo,$ZodIntersection:()=>Rgo,$ZodJWT:()=>ggo,$ZodKSUID:()=>rgo,$ZodLazy:()=>$go,$ZodLiteral:()=>zgo,$ZodMAC:()=>lgo,$ZodMap:()=>Fgo,$ZodNaN:()=>Hgo,$ZodNanoID:()=>Xho,$ZodNever:()=>Sgo,$ZodNonOptional:()=>Ggo,$ZodNull:()=>vgo,$ZodNullable:()=>_go,$ZodNumber:()=>IRr,$ZodNumberFormat:()=>ygo,$ZodObject:()=>XUc,$ZodObjectJIT:()=>Pgo,$ZodOptional:()=>xRr,$ZodPipe:()=>Kgo,$ZodPrefault:()=>Vgo,$ZodPromise:()=>Zgo,$ZodReadonly:()=>Jgo,$ZodRealError:()=>Nz,$ZodRecord:()=>kgo,$ZodRegistry:()=>ORr,$ZodSet:()=>Ngo,$ZodString:()=>A6e,$ZodStringFormat:()=>uA,$ZodSuccess:()=>qgo,$ZodSymbol:()=>Ego,$ZodTemplateLiteral:()=>Ygo,$ZodTransform:()=>Mgo,$ZodTuple:()=>CRr,$ZodType:()=>Jl,$ZodULID:()=>ego,$ZodURL:()=>Jho,$ZodUUID:()=>Hho,$ZodUndefined:()=>Igo,$ZodUnion:()=>XLt,$ZodUnknown:()=>xgo,$ZodVoid:()=>wgo,$ZodXID:()=>tgo,$ZodXor:()=>Bgo,$brand:()=>XDr,$constructor:()=>Cr,$input:()=>aAo,$output:()=>sAo,Doc:()=>JLt,JSONSchema:()=>G5c,JSONSchemaGenerator:()=>okr,NEVER:()=>kmo,TimePrecision:()=>pAo,_any:()=>RAo,_array:()=>MAo,_base64:()=>WRr,_base64url:()=>HRr,_bigint:()=>SAo,_boolean:()=>CAo,_catch:()=>PMd,_check:()=>_5c,_cidrv4:()=>GRr,_cidrv6:()=>qRr,_coercedBigint:()=>wAo,_coercedBoolean:()=>xAo,_coercedDate:()=>zAo,_coercedNumber:()=>AAo,_coercedString:()=>lAo,_cuid:()=>zRr,_cuid2:()=>QRr,_custom:()=>_Ao,_date:()=>jAo,_decode:()=>nRr,_decodeAsync:()=>oRr,_default:()=>wMd,_discriminatedUnion:()=>mMd,_e164:()=>KRr,_email:()=>BRr,_emoji:()=>NRr,_encode:()=>rRr,_encodeAsync:()=>iRr,_endsWith:()=>wtt,_enum:()=>EMd,_file:()=>LAo,_float32:()=>bAo,_float64:()=>EAo,_gt:()=>hee,_gte:()=>MF,_guid:()=>r6t,_includes:()=>xtt,_int:()=>yAo,_int32:()=>IAo,_int64:()=>TAo,_intersection:()=>hMd,_ipv4:()=>URr,_ipv6:()=>VRr,_isoDate:()=>dAo,_isoDateTime:()=>fAo,_isoDuration:()=>hAo,_isoTime:()=>mAo,_jwt:()=>JRr,_ksuid:()=>_Rr,_lazy:()=>kMd,_length:()=>E6e,_literal:()=>vMd,_lowercase:()=>vtt,_lt:()=>mee,_lte:()=>H6,_mac:()=>uAo,_map:()=>yMd,_max:()=>H6,_maxLength:()=>b6e,_maxSize:()=>ave,_mime:()=>Ttt,_min:()=>MF,_minLength:()=>wfe,_minSize:()=>gee,_multipleOf:()=>sve,_nan:()=>QAo,_nanoid:()=>jRr,_nativeEnum:()=>IMd,_negative:()=>XRr,_never:()=>FAo,_nonnegative:()=>$Rr,_nonoptional:()=>TMd,_nonpositive:()=>ZRr,_normalize:()=>Ott,_null:()=>DAo,_nullable:()=>SMd,_number:()=>gAo,_optional:()=>xMd,_overwrite:()=>CH,_parse:()=>htt,_parseAsync:()=>gtt,_pipe:()=>BMd,_positive:()=>YRr,_promise:()=>FMd,_property:()=>ekr,_readonly:()=>DMd,_record:()=>AMd,_refine:()=>UAo,_regex:()=>Itt,_safeDecode:()=>aRr,_safeDecodeAsync:()=>lRr,_safeEncode:()=>sRr,_safeEncodeAsync:()=>cRr,_safeParse:()=>Att,_safeParseAsync:()=>ytt,_set:()=>bMd,_size:()=>y6e,_slugify:()=>Rtt,_startsWith:()=>Stt,_string:()=>cAo,_stringFormat:()=>ktt,_stringbool:()=>WAo,_success:()=>OMd,_superRefine:()=>VAo,_symbol:()=>PAo,_templateLiteral:()=>RMd,_toLowerCase:()=>Btt,_toUpperCase:()=>Dtt,_transform:()=>CMd,_trim:()=>Ptt,_tuple:()=>gMd,_uint32:()=>vAo,_uint64:()=>OAo,_ulid:()=>MRr,_undefined:()=>BAo,_union:()=>fMd,_unknown:()=>kAo,_uppercase:()=>Ctt,_url:()=>n6t,_uuid:()=>DRr,_uuidv4:()=>RRr,_uuidv6:()=>kRr,_uuidv7:()=>FRr,_void:()=>NAo,_xid:()=>LRr,_xor:()=>dMd,clone:()=>QF,config:()=>GI,createStandardJSONSchemaMethod:()=>Ftt,createToJSONSchemaMethod:()=>HAo,decode:()=>zzd,decodeAsync:()=>Mzd,describe:()=>GAo,encode:()=>jzd,encodeAsync:()=>Qzd,extractDefs:()=>lve,finalize:()=>uve,flattenError:()=>qLt,formatError:()=>WLt,globalConfig:()=>zLt,globalRegistry:()=>RP,initializeContext:()=>cve,isValidBase64:()=>fgo,isValidBase64URL:()=>HUc,isValidJWT:()=>KUc,locales:()=>e6t,meta:()=>qAo,parse:()=>eRr,parseAsync:()=>tRr,prettifyError:()=>qmo,process:()=>Wh,regexes:()=>NV,registry:()=>PRr,safeDecode:()=>_zd,safeDecodeAsync:()=>Vzd,safeEncode:()=>Lzd,safeEncodeAsync:()=>Uzd,safeParse:()=>Hmo,safeParseAsync:()=>Kmo,toDotPath:()=>PUc,toJSONSchema:()=>ikr,treeifyError:()=>Gmo,util:()=>vi,version:()=>Vho});var jz=h(()=>{"use strict";ptt();Jmo();Wmo();tAo();hRr();Gho();Va();fRr();oAo();t6t();Uho();U5c();i6t();o6t();V5c();q5c()});var skr={};ne(skr,{endsWith:()=>wtt,gt:()=>hee,gte:()=>MF,includes:()=>xtt,length:()=>E6e,lowercase:()=>vtt,lt:()=>mee,lte:()=>H6,maxLength:()=>b6e,maxSize:()=>ave,mime:()=>Ttt,minLength:()=>wfe,minSize:()=>gee,multipleOf:()=>sve,negative:()=>XRr,nonnegative:()=>$Rr,nonpositive:()=>ZRr,normalize:()=>Ott,overwrite:()=>CH,positive:()=>YRr,property:()=>ekr,regex:()=>Itt,size:()=>y6e,slugify:()=>Rtt,startsWith:()=>Stt,toLowerCase:()=>Btt,toUpperCase:()=>Dtt,trim:()=>Ptt,uppercase:()=>Ctt});var akr=h(()=>{"use strict";jz()});var Ntt={};ne(Ntt,{ZodISODate:()=>lkr,ZodISODateTime:()=>ckr,ZodISODuration:()=>pkr,ZodISOTime:()=>ukr,date:()=>Ryo,datetime:()=>Dyo,duration:()=>Fyo,time:()=>kyo});function Dyo(e){return fAo(ckr,e)}function Ryo(e){return dAo(lkr,e)}function kyo(e){return mAo(ukr,e)}function Fyo(e){return hAo(pkr,e)}var ckr,lkr,ukr,pkr,s6t=h(()=>{"use strict";jz();c6t();ckr=Cr("ZodISODateTime",(e,t)=>{ngo.init(e,t),pA.init(e,t)});lkr=Cr("ZodISODate",(e,t)=>{igo.init(e,t),pA.init(e,t)});ukr=Cr("ZodISOTime",(e,t)=>{ogo.init(e,t),pA.init(e,t)});pkr=Cr("ZodISODuration",(e,t)=>{sgo.init(e,t),pA.init(e,t)})});var W5c,zMd,zz,Nyo=h(()=>{"use strict";jz();jz();Va();W5c=(e,t)=>{GLt.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>WLt(e,r)},flatten:{value:r=>qLt(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,ftt,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,ftt,2)}},isEmpty:{get(){return e.issues.length===0}}})},zMd=Cr("ZodError",W5c),zz=Cr("ZodError",W5c,{Parent:Error})});var jyo,zyo,Qyo,Myo,Lyo,_yo,Uyo,Vyo,Gyo,qyo,Wyo,Hyo,Kyo=h(()=>{"use strict";jz();Nyo();jyo=htt(zz),zyo=gtt(zz),Qyo=Att(zz),Myo=ytt(zz),Lyo=rRr(zz),_yo=nRr(zz),Uyo=iRr(zz),Vyo=oRr(zz),Gyo=sRr(zz),qyo=aRr(zz),Wyo=cRr(zz),Hyo=lRr(zz)});var a6t={};ne(a6t,{ZodAny:()=>rbo,ZodArray:()=>sbo,ZodBase64:()=>Tkr,ZodBase64URL:()=>Okr,ZodBigInt:()=>_tt,ZodBigIntFormat:()=>Dkr,ZodBoolean:()=>Ltt,ZodCIDRv4:()=>Skr,ZodCIDRv6:()=>wkr,ZodCUID:()=>ykr,ZodCUID2:()=>bkr,ZodCatch:()=>Obo,ZodCodec:()=>Mkr,ZodCustom:()=>b6t,ZodCustomStringFormat:()=>Qtt,ZodDate:()=>m6t,ZodDefault:()=>vbo,ZodDiscriminatedUnion:()=>cbo,ZodE164:()=>Pkr,ZodEmail:()=>hkr,ZodEmoji:()=>gkr,ZodEnum:()=>jtt,ZodExactOptional:()=>bbo,ZodFile:()=>Abo,ZodFunction:()=>zbo,ZodGUID:()=>l6t,ZodIPv4:()=>Ckr,ZodIPv6:()=>xkr,ZodIntersection:()=>lbo,ZodJWT:()=>Bkr,ZodKSUID:()=>vkr,ZodLazy:()=>Fbo,ZodLiteral:()=>gbo,ZodMAC:()=>Jyo,ZodMap:()=>mbo,ZodNaN:()=>Bbo,ZodNanoID:()=>Akr,ZodNever:()=>ibo,ZodNonOptional:()=>zkr,ZodNull:()=>ebo,ZodNullable:()=>Ibo,ZodNumber:()=>Mtt,ZodNumberFormat:()=>v6e,ZodObject:()=>g6t,ZodOptional:()=>jkr,ZodPipe:()=>Qkr,ZodPrefault:()=>xbo,ZodPromise:()=>jbo,ZodReadonly:()=>Dbo,ZodRecord:()=>y6t,ZodSet:()=>hbo,ZodString:()=>ztt,ZodStringFormat:()=>pA,ZodSuccess:()=>Tbo,ZodSymbol:()=>Zyo,ZodTemplateLiteral:()=>kbo,ZodTransform:()=>ybo,ZodTuple:()=>pbo,ZodType:()=>cp,ZodULID:()=>Ekr,ZodURL:()=>d6t,ZodUUID:()=>Aee,ZodUndefined:()=>$yo,ZodUnion:()=>A6t,ZodUnknown:()=>nbo,ZodVoid:()=>obo,ZodXID:()=>Ikr,ZodXor:()=>abo,_ZodString:()=>mkr,_default:()=>Cbo,_function:()=>Z8c,any:()=>B8c,array:()=>h6t,base64:()=>d8c,base64url:()=>m8c,bigint:()=>S8c,boolean:()=>Xyo,catch:()=>Pbo,check:()=>$8c,cidrv4:()=>p8c,cidrv6:()=>f8c,codec:()=>J8c,cuid:()=>n8c,cuid2:()=>i8c,custom:()=>eGc,date:()=>R8c,describe:()=>tGc,discriminatedUnion:()=>Q8c,e164:()=>h8c,email:()=>H5c,emoji:()=>t8c,enum:()=>Fkr,exactOptional:()=>Ebo,file:()=>q8c,float32:()=>I8c,float64:()=>v8c,function:()=>Z8c,guid:()=>K5c,hash:()=>E8c,hex:()=>b8c,hostname:()=>y8c,httpUrl:()=>e8c,instanceof:()=>nGc,int:()=>dkr,int32:()=>C8c,int64:()=>w8c,intersection:()=>ubo,ipv4:()=>c8c,ipv6:()=>u8c,json:()=>oGc,jwt:()=>g8c,keyof:()=>k8c,ksuid:()=>a8c,lazy:()=>Nbo,literal:()=>G8c,looseObject:()=>j8c,looseRecord:()=>L8c,mac:()=>l8c,map:()=>_8c,meta:()=>rGc,nan:()=>K8c,nanoid:()=>r8c,nativeEnum:()=>V8c,never:()=>Rkr,nonoptional:()=>wbo,null:()=>tbo,nullable:()=>p6t,nullish:()=>W8c,number:()=>Yyo,object:()=>F8c,optional:()=>u6t,partialRecord:()=>M8c,pipe:()=>f6t,prefault:()=>Sbo,preprocess:()=>sGc,promise:()=>X8c,readonly:()=>Rbo,record:()=>dbo,refine:()=>Qbo,set:()=>U8c,strictObject:()=>N8c,string:()=>fkr,stringFormat:()=>A8c,stringbool:()=>iGc,success:()=>H8c,superRefine:()=>Mbo,symbol:()=>O8c,templateLiteral:()=>Y8c,transform:()=>Nkr,tuple:()=>fbo,uint32:()=>x8c,uint64:()=>T8c,ulid:()=>o8c,undefined:()=>P8c,union:()=>kkr,unknown:()=>I6e,url:()=>$5c,uuid:()=>J5c,uuidv4:()=>Y5c,uuidv6:()=>X5c,uuidv7:()=>Z5c,void:()=>D8c,xid:()=>s8c,xor:()=>z8c});function fkr(e){return cAo(ztt,e)}function H5c(e){return BRr(hkr,e)}function K5c(e){return r6t(l6t,e)}function J5c(e){return DRr(Aee,e)}function Y5c(e){return RRr(Aee,e)}function X5c(e){return kRr(Aee,e)}function Z5c(e){return FRr(Aee,e)}function $5c(e){return n6t(d6t,e)}function e8c(e){return n6t(d6t,{protocol:/^https?$/,hostname:NV.domain,...vi.normalizeParams(e)})}function t8c(e){return NRr(gkr,e)}function r8c(e){return jRr(Akr,e)}function n8c(e){return zRr(ykr,e)}function i8c(e){return QRr(bkr,e)}function o8c(e){return MRr(Ekr,e)}function s8c(e){return LRr(Ikr,e)}function a8c(e){return _Rr(vkr,e)}function c8c(e){return URr(Ckr,e)}function l8c(e){return uAo(Jyo,e)}function u8c(e){return VRr(xkr,e)}function p8c(e){return GRr(Skr,e)}function f8c(e){return qRr(wkr,e)}function d8c(e){return WRr(Tkr,e)}function m8c(e){return HRr(Okr,e)}function h8c(e){return KRr(Pkr,e)}function g8c(e){return JRr(Bkr,e)}function A8c(e,t,r={}){return ktt(Qtt,e,t,r)}function y8c(e){return ktt(Qtt,"hostname",NV.hostname,e)}function b8c(e){return ktt(Qtt,"hex",NV.hex,e)}function E8c(e,t){let r=t?.enc??"hex",n=`${e}_${r}`,i=NV[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return ktt(Qtt,n,i,t)}function Yyo(e){return gAo(Mtt,e)}function dkr(e){return yAo(v6e,e)}function I8c(e){return bAo(v6e,e)}function v8c(e){return EAo(v6e,e)}function C8c(e){return IAo(v6e,e)}function x8c(e){return vAo(v6e,e)}function Xyo(e){return CAo(Ltt,e)}function S8c(e){return SAo(_tt,e)}function w8c(e){return TAo(Dkr,e)}function T8c(e){return OAo(Dkr,e)}function O8c(e){return PAo(Zyo,e)}function P8c(e){return BAo($yo,e)}function tbo(e){return DAo(ebo,e)}function B8c(){return RAo(rbo)}function I6e(){return kAo(nbo)}function Rkr(e){return FAo(ibo,e)}function D8c(e){return NAo(obo,e)}function R8c(e){return jAo(m6t,e)}function h6t(e,t){return MAo(sbo,e,t)}function k8c(e){let t=e._zod.def.shape;return Fkr(Object.keys(t))}function F8c(e,t){let r={type:"object",shape:e??{},...vi.normalizeParams(t)};return new g6t(r)}function N8c(e,t){return new g6t({type:"object",shape:e,catchall:Rkr(),...vi.normalizeParams(t)})}function j8c(e,t){return new g6t({type:"object",shape:e,catchall:I6e(),...vi.normalizeParams(t)})}function kkr(e,t){return new A6t({type:"union",options:e,...vi.normalizeParams(t)})}function z8c(e,t){return new abo({type:"union",options:e,inclusive:!1,...vi.normalizeParams(t)})}function Q8c(e,t,r){return new cbo({type:"union",options:t,discriminator:e,...vi.normalizeParams(r)})}function ubo(e,t){return new lbo({type:"intersection",left:e,right:t})}function fbo(e,t,r){let n=t instanceof Jl,i=n?r:t,o=n?t:null;return new pbo({type:"tuple",items:e,rest:o,...vi.normalizeParams(i)})}function dbo(e,t,r){return new y6t({type:"record",keyType:e,valueType:t,...vi.normalizeParams(r)})}function M8c(e,t,r){let n=QF(e);return n._zod.values=void 0,new y6t({type:"record",keyType:n,valueType:t,...vi.normalizeParams(r)})}function L8c(e,t,r){return new y6t({type:"record",keyType:e,valueType:t,mode:"loose",...vi.normalizeParams(r)})}function _8c(e,t,r){return new mbo({type:"map",keyType:e,valueType:t,...vi.normalizeParams(r)})}function U8c(e,t){return new hbo({type:"set",valueType:e,...vi.normalizeParams(t)})}function Fkr(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new jtt({type:"enum",entries:r,...vi.normalizeParams(t)})}function V8c(e,t){return new jtt({type:"enum",entries:e,...vi.normalizeParams(t)})}function G8c(e,t){return new gbo({type:"literal",values:Array.isArray(e)?e:[e],...vi.normalizeParams(t)})}function q8c(e){return LAo(Abo,e)}function Nkr(e){return new ybo({type:"transform",transform:e})}function u6t(e){return new jkr({type:"optional",innerType:e})}function Ebo(e){return new bbo({type:"optional",innerType:e})}function p6t(e){return new Ibo({type:"nullable",innerType:e})}function W8c(e){return u6t(p6t(e))}function Cbo(e,t){return new vbo({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():vi.shallowClone(t)}})}function Sbo(e,t){return new xbo({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():vi.shallowClone(t)}})}function wbo(e,t){return new zkr({type:"nonoptional",innerType:e,...vi.normalizeParams(t)})}function H8c(e){return new Tbo({type:"success",innerType:e})}function Pbo(e,t){return new Obo({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function K8c(e){return QAo(Bbo,e)}function f6t(e,t){return new Qkr({type:"pipe",in:e,out:t})}function J8c(e,t,r){return new Mkr({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function Rbo(e){return new Dbo({type:"readonly",innerType:e})}function Y8c(e,t){return new kbo({type:"template_literal",parts:e,...vi.normalizeParams(t)})}function Nbo(e){return new Fbo({type:"lazy",getter:e})}function X8c(e){return new jbo({type:"promise",innerType:e})}function Z8c(e){return new zbo({type:"function",input:Array.isArray(e?.input)?fbo(e?.input):e?.input??h6t(I6e()),output:e?.output??I6e()})}function $8c(e){let t=new zA({check:"custom"});return t._zod.check=e,t}function eGc(e,t){return _Ao(b6t,e??(()=>!0),t)}function Qbo(e,t={}){return UAo(b6t,e,t)}function Mbo(e){return VAo(e)}function nGc(e,t={}){let r=new b6t({type:"custom",check:"custom",fn:n=>n instanceof e,abort:!0,...vi.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=n=>{n.value instanceof e||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}function oGc(e){let t=Nbo(()=>kkr([fkr(e),Yyo(),Xyo(),tbo(),h6t(t),dbo(fkr(),t)]));return t}function sGc(e,t){return f6t(Nkr(e),t)}var cp,mkr,ztt,pA,hkr,l6t,Aee,d6t,gkr,Akr,ykr,bkr,Ekr,Ikr,vkr,Ckr,Jyo,xkr,Skr,wkr,Tkr,Okr,Pkr,Bkr,Qtt,Mtt,v6e,Ltt,_tt,Dkr,Zyo,$yo,ebo,rbo,nbo,ibo,obo,m6t,sbo,g6t,A6t,abo,cbo,lbo,pbo,y6t,mbo,hbo,jtt,gbo,Abo,ybo,jkr,bbo,Ibo,vbo,xbo,zkr,Tbo,Obo,Bbo,Qkr,Mkr,Dbo,kbo,Fbo,jbo,zbo,b6t,tGc,rGc,iGc,c6t=h(()=>{"use strict";jz();jz();o6t();i6t();akr();s6t();Kyo();cp=Cr("ZodType",(e,t)=>(Jl.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Ftt(e,"input"),output:Ftt(e,"output")}}),e.toJSONSchema=HAo(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(vi.mergeDefs(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(r,n)=>QF(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>jyo(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Qyo(e,r,n),e.parseAsync=async(r,n)=>zyo(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Myo(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>Lyo(e,r,n),e.decode=(r,n)=>_yo(e,r,n),e.encodeAsync=async(r,n)=>Uyo(e,r,n),e.decodeAsync=async(r,n)=>Vyo(e,r,n),e.safeEncode=(r,n)=>Gyo(e,r,n),e.safeDecode=(r,n)=>qyo(e,r,n),e.safeEncodeAsync=async(r,n)=>Wyo(e,r,n),e.safeDecodeAsync=async(r,n)=>Hyo(e,r,n),e.refine=(r,n)=>e.check(Qbo(r,n)),e.superRefine=r=>e.check(Mbo(r)),e.overwrite=r=>e.check(CH(r)),e.optional=()=>u6t(e),e.exactOptional=()=>Ebo(e),e.nullable=()=>p6t(e),e.nullish=()=>u6t(p6t(e)),e.nonoptional=r=>wbo(e,r),e.array=()=>h6t(e),e.or=r=>kkr([e,r]),e.and=r=>ubo(e,r),e.transform=r=>f6t(e,Nkr(r)),e.default=r=>Cbo(e,r),e.prefault=r=>Sbo(e,r),e.catch=r=>Pbo(e,r),e.pipe=r=>f6t(e,r),e.readonly=()=>Rbo(e),e.describe=r=>{let n=e.clone();return RP.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return RP.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return RP.get(e);let n=e.clone();return RP.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),mkr=Cr("_ZodString",(e,t)=>{A6e.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(n,i,o)=>KAo(e,n,i,o);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(Itt(...n)),e.includes=(...n)=>e.check(xtt(...n)),e.startsWith=(...n)=>e.check(Stt(...n)),e.endsWith=(...n)=>e.check(wtt(...n)),e.min=(...n)=>e.check(wfe(...n)),e.max=(...n)=>e.check(b6e(...n)),e.length=(...n)=>e.check(E6e(...n)),e.nonempty=(...n)=>e.check(wfe(1,...n)),e.lowercase=n=>e.check(vtt(n)),e.uppercase=n=>e.check(Ctt(n)),e.trim=()=>e.check(Ptt()),e.normalize=(...n)=>e.check(Ott(...n)),e.toLowerCase=()=>e.check(Btt()),e.toUpperCase=()=>e.check(Dtt()),e.slugify=()=>e.check(Rtt())}),ztt=Cr("ZodString",(e,t)=>{A6e.init(e,t),mkr.init(e,t),e.email=r=>e.check(BRr(hkr,r)),e.url=r=>e.check(n6t(d6t,r)),e.jwt=r=>e.check(JRr(Bkr,r)),e.emoji=r=>e.check(NRr(gkr,r)),e.guid=r=>e.check(r6t(l6t,r)),e.uuid=r=>e.check(DRr(Aee,r)),e.uuidv4=r=>e.check(RRr(Aee,r)),e.uuidv6=r=>e.check(kRr(Aee,r)),e.uuidv7=r=>e.check(FRr(Aee,r)),e.nanoid=r=>e.check(jRr(Akr,r)),e.guid=r=>e.check(r6t(l6t,r)),e.cuid=r=>e.check(zRr(ykr,r)),e.cuid2=r=>e.check(QRr(bkr,r)),e.ulid=r=>e.check(MRr(Ekr,r)),e.base64=r=>e.check(WRr(Tkr,r)),e.base64url=r=>e.check(HRr(Okr,r)),e.xid=r=>e.check(LRr(Ikr,r)),e.ksuid=r=>e.check(_Rr(vkr,r)),e.ipv4=r=>e.check(URr(Ckr,r)),e.ipv6=r=>e.check(VRr(xkr,r)),e.cidrv4=r=>e.check(GRr(Skr,r)),e.cidrv6=r=>e.check(qRr(wkr,r)),e.e164=r=>e.check(KRr(Pkr,r)),e.datetime=r=>e.check(Dyo(r)),e.date=r=>e.check(Ryo(r)),e.time=r=>e.check(kyo(r)),e.duration=r=>e.check(Fyo(r))});pA=Cr("ZodStringFormat",(e,t)=>{uA.init(e,t),mkr.init(e,t)}),hkr=Cr("ZodEmail",(e,t)=>{Kho.init(e,t),pA.init(e,t)});l6t=Cr("ZodGUID",(e,t)=>{Who.init(e,t),pA.init(e,t)});Aee=Cr("ZodUUID",(e,t)=>{Hho.init(e,t),pA.init(e,t)});d6t=Cr("ZodURL",(e,t)=>{Jho.init(e,t),pA.init(e,t)});gkr=Cr("ZodEmoji",(e,t)=>{Yho.init(e,t),pA.init(e,t)});Akr=Cr("ZodNanoID",(e,t)=>{Xho.init(e,t),pA.init(e,t)});ykr=Cr("ZodCUID",(e,t)=>{Zho.init(e,t),pA.init(e,t)});bkr=Cr("ZodCUID2",(e,t)=>{$ho.init(e,t),pA.init(e,t)});Ekr=Cr("ZodULID",(e,t)=>{ego.init(e,t),pA.init(e,t)});Ikr=Cr("ZodXID",(e,t)=>{tgo.init(e,t),pA.init(e,t)});vkr=Cr("ZodKSUID",(e,t)=>{rgo.init(e,t),pA.init(e,t)});Ckr=Cr("ZodIPv4",(e,t)=>{ago.init(e,t),pA.init(e,t)});Jyo=Cr("ZodMAC",(e,t)=>{lgo.init(e,t),pA.init(e,t)});xkr=Cr("ZodIPv6",(e,t)=>{cgo.init(e,t),pA.init(e,t)});Skr=Cr("ZodCIDRv4",(e,t)=>{ugo.init(e,t),pA.init(e,t)});wkr=Cr("ZodCIDRv6",(e,t)=>{pgo.init(e,t),pA.init(e,t)});Tkr=Cr("ZodBase64",(e,t)=>{dgo.init(e,t),pA.init(e,t)});Okr=Cr("ZodBase64URL",(e,t)=>{mgo.init(e,t),pA.init(e,t)});Pkr=Cr("ZodE164",(e,t)=>{hgo.init(e,t),pA.init(e,t)});Bkr=Cr("ZodJWT",(e,t)=>{ggo.init(e,t),pA.init(e,t)});Qtt=Cr("ZodCustomStringFormat",(e,t)=>{Ago.init(e,t),pA.init(e,t)});Mtt=Cr("ZodNumber",(e,t)=>{IRr.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(n,i,o)=>JAo(e,n,i,o),e.gt=(n,i)=>e.check(hee(n,i)),e.gte=(n,i)=>e.check(MF(n,i)),e.min=(n,i)=>e.check(MF(n,i)),e.lt=(n,i)=>e.check(mee(n,i)),e.lte=(n,i)=>e.check(H6(n,i)),e.max=(n,i)=>e.check(H6(n,i)),e.int=n=>e.check(dkr(n)),e.safe=n=>e.check(dkr(n)),e.positive=n=>e.check(hee(0,n)),e.nonnegative=n=>e.check(MF(0,n)),e.negative=n=>e.check(mee(0,n)),e.nonpositive=n=>e.check(H6(0,n)),e.multipleOf=(n,i)=>e.check(sve(n,i)),e.step=(n,i)=>e.check(sve(n,i)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});v6e=Cr("ZodNumberFormat",(e,t)=>{ygo.init(e,t),Mtt.init(e,t)});Ltt=Cr("ZodBoolean",(e,t)=>{YLt.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>YAo(e,r,n,i)});_tt=Cr("ZodBigInt",(e,t)=>{vRr.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(n,i,o)=>XAo(e,n,i,o),e.gte=(n,i)=>e.check(MF(n,i)),e.min=(n,i)=>e.check(MF(n,i)),e.gt=(n,i)=>e.check(hee(n,i)),e.gte=(n,i)=>e.check(MF(n,i)),e.min=(n,i)=>e.check(MF(n,i)),e.lt=(n,i)=>e.check(mee(n,i)),e.lte=(n,i)=>e.check(H6(n,i)),e.max=(n,i)=>e.check(H6(n,i)),e.positive=n=>e.check(hee(BigInt(0),n)),e.negative=n=>e.check(mee(BigInt(0),n)),e.nonpositive=n=>e.check(H6(BigInt(0),n)),e.nonnegative=n=>e.check(MF(BigInt(0),n)),e.multipleOf=(n,i)=>e.check(sve(n,i));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});Dkr=Cr("ZodBigIntFormat",(e,t)=>{bgo.init(e,t),_tt.init(e,t)});Zyo=Cr("ZodSymbol",(e,t)=>{Ego.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>ZAo(e,r,n,i)});$yo=Cr("ZodUndefined",(e,t)=>{Igo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>eyo(e,r,n,i)});ebo=Cr("ZodNull",(e,t)=>{vgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>$Ao(e,r,n,i)});rbo=Cr("ZodAny",(e,t)=>{Cgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>nyo(e,r,n,i)});nbo=Cr("ZodUnknown",(e,t)=>{xgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>iyo(e,r,n,i)});ibo=Cr("ZodNever",(e,t)=>{Sgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>ryo(e,r,n,i)});obo=Cr("ZodVoid",(e,t)=>{wgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>tyo(e,r,n,i)});m6t=Cr("ZodDate",(e,t)=>{Tgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(n,i,o)=>oyo(e,n,i,o),e.min=(n,i)=>e.check(MF(n,i)),e.max=(n,i)=>e.check(H6(n,i));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});sbo=Cr("ZodArray",(e,t)=>{Ogo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Ayo(e,r,n,i),e.element=t.element,e.min=(r,n)=>e.check(wfe(r,n)),e.nonempty=r=>e.check(wfe(1,r)),e.max=(r,n)=>e.check(b6e(r,n)),e.length=(r,n)=>e.check(E6e(r,n)),e.unwrap=()=>e.element});g6t=Cr("ZodObject",(e,t)=>{Pgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>yyo(e,r,n,i),vi.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Fkr(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:I6e()}),e.loose=()=>e.clone({...e._zod.def,catchall:I6e()}),e.strict=()=>e.clone({...e._zod.def,catchall:Rkr()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>vi.extend(e,r),e.safeExtend=r=>vi.safeExtend(e,r),e.merge=r=>vi.merge(e,r),e.pick=r=>vi.pick(e,r),e.omit=r=>vi.omit(e,r),e.partial=(...r)=>vi.partial(jkr,e,r[0]),e.required=(...r)=>vi.required(zkr,e,r[0])});A6t=Cr("ZodUnion",(e,t)=>{XLt.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>rkr(e,r,n,i),e.options=t.options});abo=Cr("ZodXor",(e,t)=>{A6t.init(e,t),Bgo.init(e,t),e._zod.processJSONSchema=(r,n,i)=>rkr(e,r,n,i),e.options=t.options});cbo=Cr("ZodDiscriminatedUnion",(e,t)=>{A6t.init(e,t),Dgo.init(e,t)});lbo=Cr("ZodIntersection",(e,t)=>{Rgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>byo(e,r,n,i)});pbo=Cr("ZodTuple",(e,t)=>{CRr.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Eyo(e,r,n,i),e.rest=r=>e.clone({...e._zod.def,rest:r})});y6t=Cr("ZodRecord",(e,t)=>{kgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Iyo(e,r,n,i),e.keyType=t.keyType,e.valueType=t.valueType});mbo=Cr("ZodMap",(e,t)=>{Fgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>hyo(e,r,n,i),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(gee(...r)),e.nonempty=r=>e.check(gee(1,r)),e.max=(...r)=>e.check(ave(...r)),e.size=(...r)=>e.check(y6e(...r))});hbo=Cr("ZodSet",(e,t)=>{Ngo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>gyo(e,r,n,i),e.min=(...r)=>e.check(gee(...r)),e.nonempty=r=>e.check(gee(1,r)),e.max=(...r)=>e.check(ave(...r)),e.size=(...r)=>e.check(y6e(...r))});jtt=Cr("ZodEnum",(e,t)=>{jgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(n,i,o)=>syo(e,n,i,o),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,i)=>{let o={};for(let s of n)if(r.has(s))o[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new jtt({...t,checks:[],...vi.normalizeParams(i),entries:o})},e.exclude=(n,i)=>{let o={...t.entries};for(let s of n)if(r.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new jtt({...t,checks:[],...vi.normalizeParams(i),entries:o})}});gbo=Cr("ZodLiteral",(e,t)=>{zgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>ayo(e,r,n,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});Abo=Cr("ZodFile",(e,t)=>{Qgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>uyo(e,r,n,i),e.min=(r,n)=>e.check(gee(r,n)),e.max=(r,n)=>e.check(ave(r,n)),e.mime=(r,n)=>e.check(Ttt(Array.isArray(r)?r:[r],n))});ybo=Cr("ZodTransform",(e,t)=>{Mgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>myo(e,r,n,i),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new tve(e.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(vi.issue(o,r.value,t));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(vi.issue(s))}};let i=t.transform(r.value,r);return i instanceof Promise?i.then(o=>(r.value=o,r)):(r.value=i,r)}});jkr=Cr("ZodOptional",(e,t)=>{xRr.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>nkr(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});bbo=Cr("ZodExactOptional",(e,t)=>{Lgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>nkr(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});Ibo=Cr("ZodNullable",(e,t)=>{_go.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>vyo(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});vbo=Cr("ZodDefault",(e,t)=>{Ugo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>xyo(e,r,n,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});xbo=Cr("ZodPrefault",(e,t)=>{Vgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Syo(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});zkr=Cr("ZodNonOptional",(e,t)=>{Ggo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Cyo(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});Tbo=Cr("ZodSuccess",(e,t)=>{qgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>pyo(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});Obo=Cr("ZodCatch",(e,t)=>{Wgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>wyo(e,r,n,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});Bbo=Cr("ZodNaN",(e,t)=>{Hgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>cyo(e,r,n,i)});Qkr=Cr("ZodPipe",(e,t)=>{Kgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Tyo(e,r,n,i),e.in=t.in,e.out=t.out});Mkr=Cr("ZodCodec",(e,t)=>{Qkr.init(e,t),ZLt.init(e,t)});Dbo=Cr("ZodReadonly",(e,t)=>{Jgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Oyo(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});kbo=Cr("ZodTemplateLiteral",(e,t)=>{Ygo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>lyo(e,r,n,i)});Fbo=Cr("ZodLazy",(e,t)=>{$go.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Byo(e,r,n,i),e.unwrap=()=>e._zod.def.getter()});jbo=Cr("ZodPromise",(e,t)=>{Zgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Pyo(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});zbo=Cr("ZodFunction",(e,t)=>{Xgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>dyo(e,r,n,i)});b6t=Cr("ZodCustom",(e,t)=>{eAo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>fyo(e,r,n,i)});tGc=GAo,rGc=qAo;iGc=(...e)=>WAo({Codec:Mkr,Boolean:Ltt,String:ztt},...e)});function LMd(e){GI({customError:e})}function _Md(){return GI().customError}var MMd,Lbo,aGc=h(()=>{"use strict";jz();jz();MMd={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};Lbo||(Lbo={})});function VMd(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function GMd(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let n=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let i=r[1];if(!i||!t.defs[i])throw new Error(`Reference not found: ${e}`);return t.defs[i]}throw new Error(`Reference not found: ${e}`)}function cGc(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return ko.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let i=e.$ref;if(t.refs.has(i))return t.refs.get(i);if(t.processing.has(i))return ko.lazy(()=>{if(!t.refs.has(i))throw new Error(`Circular reference not resolved: ${i}`);return t.refs.get(i)});t.processing.add(i);let o=GMd(i,t),s=BD(o,t);return t.refs.set(i,s),t.processing.delete(i),s}if(e.enum!==void 0){let i=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&i.length===1&&i[0]===null)return ko.null();if(i.length===0)return ko.never();if(i.length===1)return ko.literal(i[0]);if(i.every(s=>typeof s=="string"))return ko.enum(i);let o=i.map(s=>ko.literal(s));return o.length<2?o[0]:ko.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return ko.literal(e.const);let r=e.type;if(Array.isArray(r)){let i=r.map(o=>{let s={...e,type:o};return cGc(s,t)});return i.length===0?ko.never():i.length===1?i[0]:ko.union(i)}if(!r)return ko.any();let n;switch(r){case"string":{let i=ko.string();if(e.format){let o=e.format;o==="email"?i=i.check(ko.email()):o==="uri"||o==="uri-reference"?i=i.check(ko.url()):o==="uuid"||o==="guid"?i=i.check(ko.uuid()):o==="date-time"?i=i.check(ko.iso.datetime()):o==="date"?i=i.check(ko.iso.date()):o==="time"?i=i.check(ko.iso.time()):o==="duration"?i=i.check(ko.iso.duration()):o==="ipv4"?i=i.check(ko.ipv4()):o==="ipv6"?i=i.check(ko.ipv6()):o==="mac"?i=i.check(ko.mac()):o==="cidr"?i=i.check(ko.cidrv4()):o==="cidr-v6"?i=i.check(ko.cidrv6()):o==="base64"?i=i.check(ko.base64()):o==="base64url"?i=i.check(ko.base64url()):o==="e164"?i=i.check(ko.e164()):o==="jwt"?i=i.check(ko.jwt()):o==="emoji"?i=i.check(ko.emoji()):o==="nanoid"?i=i.check(ko.nanoid()):o==="cuid"?i=i.check(ko.cuid()):o==="cuid2"?i=i.check(ko.cuid2()):o==="ulid"?i=i.check(ko.ulid()):o==="xid"?i=i.check(ko.xid()):o==="ksuid"&&(i=i.check(ko.ksuid()))}typeof e.minLength=="number"&&(i=i.min(e.minLength)),typeof e.maxLength=="number"&&(i=i.max(e.maxLength)),e.pattern&&(i=i.regex(new RegExp(e.pattern))),n=i;break}case"number":case"integer":{let i=r==="integer"?ko.number().int():ko.number();typeof e.minimum=="number"&&(i=i.min(e.minimum)),typeof e.maximum=="number"&&(i=i.max(e.maximum)),typeof e.exclusiveMinimum=="number"?i=i.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(i=i.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?i=i.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(i=i.lt(e.maximum)),typeof e.multipleOf=="number"&&(i=i.multipleOf(e.multipleOf)),n=i;break}case"boolean":{n=ko.boolean();break}case"null":{n=ko.null();break}case"object":{let i={},o=e.properties||{},s=new Set(e.required||[]);for(let[c,l]of Object.entries(o)){let u=BD(l,t);i[c]=s.has(c)?u:u.optional()}if(e.propertyNames){let c=BD(e.propertyNames,t),l=e.additionalProperties&&typeof e.additionalProperties=="object"?BD(e.additionalProperties,t):ko.any();if(Object.keys(i).length===0){n=ko.record(c,l);break}let u=ko.object(i).passthrough(),p=ko.looseRecord(c,l);n=ko.intersection(u,p);break}if(e.patternProperties){let c=e.patternProperties,l=Object.keys(c),u=[];for(let d of l){let f=BD(c[d],t),m=ko.string().regex(new RegExp(d));u.push(ko.looseRecord(m,f))}let p=[];if(Object.keys(i).length>0&&p.push(ko.object(i).passthrough()),p.push(...u),p.length===0)n=ko.object({}).passthrough();else if(p.length===1)n=p[0];else{let d=ko.intersection(p[0],p[1]);for(let f=2;f<p.length;f++)d=ko.intersection(d,p[f]);n=d}break}let a=ko.object(i);e.additionalProperties===!1?n=a.strict():typeof e.additionalProperties=="object"?n=a.catchall(BD(e.additionalProperties,t)):n=a.passthrough();break}case"array":{let i=e.prefixItems,o=e.items;if(i&&Array.isArray(i)){let s=i.map(c=>BD(c,t)),a=o&&typeof o=="object"&&!Array.isArray(o)?BD(o,t):void 0;a?n=ko.tuple(s).rest(a):n=ko.tuple(s),typeof e.minItems=="number"&&(n=n.check(ko.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(ko.maxLength(e.maxItems)))}else if(Array.isArray(o)){let s=o.map(c=>BD(c,t)),a=e.additionalItems&&typeof e.additionalItems=="object"?BD(e.additionalItems,t):void 0;a?n=ko.tuple(s).rest(a):n=ko.tuple(s),typeof e.minItems=="number"&&(n=n.check(ko.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(ko.maxLength(e.maxItems)))}else if(o!==void 0){let s=BD(o,t),a=ko.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),n=a}else n=ko.array(ko.any());break}default:throw new Error(`Unsupported type: ${r}`)}return e.description&&(n=n.describe(e.description)),e.default!==void 0&&(n=n.default(e.default)),n}function BD(e,t){if(typeof e=="boolean")return e?ko.any():ko.never();let r=cGc(e,t),n=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(l=>BD(l,t)),c=ko.union(a);r=n?ko.intersection(r,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(l=>BD(l,t)),c=ko.xor(a);r=n?ko.intersection(r,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=n?r:ko.any();else{let a=n?r:BD(e.allOf[0],t),c=n?0:1;for(let l=c;l<e.allOf.length;l++)a=ko.intersection(a,BD(e.allOf[l],t));r=a}e.nullable===!0&&t.version==="openapi-3.0"&&(r=ko.nullable(r)),e.readOnly===!0&&(r=ko.readonly(r));let i={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of o)a in e&&(i[a]=e[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in e&&(i[a]=e[a]);for(let a of Object.keys(e))UMd.has(a)||(i[a]=e[a]);return Object.keys(i).length>0&&t.registry.add(r,i),r}function lGc(e,t){if(typeof e=="boolean")return e?ko.any():ko.never();let r=VMd(e,t?.defaultTarget),n=e.$defs||e.definitions||{},i={version:r,defs:n,refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??RP};return BD(e,i)}var ko,UMd,uGc=h(()=>{"use strict";t6t();akr();s6t();c6t();ko={...a6t,...skr,iso:Ntt},UMd=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"])});var _bo={};ne(_bo,{bigint:()=>KMd,boolean:()=>HMd,date:()=>JMd,number:()=>WMd,string:()=>qMd});function qMd(e){return lAo(ztt,e)}function WMd(e){return AAo(Mtt,e)}function HMd(e){return xAo(Ltt,e)}function KMd(e){return wAo(_tt,e)}function JMd(e){return zAo(m6t,e)}var pGc=h(()=>{"use strict";jz();c6t()});var T={};ne(T,{$brand:()=>XDr,$input:()=>aAo,$output:()=>sAo,NEVER:()=>kmo,TimePrecision:()=>pAo,ZodAny:()=>rbo,ZodArray:()=>sbo,ZodBase64:()=>Tkr,ZodBase64URL:()=>Okr,ZodBigInt:()=>_tt,ZodBigIntFormat:()=>Dkr,ZodBoolean:()=>Ltt,ZodCIDRv4:()=>Skr,ZodCIDRv6:()=>wkr,ZodCUID:()=>ykr,ZodCUID2:()=>bkr,ZodCatch:()=>Obo,ZodCodec:()=>Mkr,ZodCustom:()=>b6t,ZodCustomStringFormat:()=>Qtt,ZodDate:()=>m6t,ZodDefault:()=>vbo,ZodDiscriminatedUnion:()=>cbo,ZodE164:()=>Pkr,ZodEmail:()=>hkr,ZodEmoji:()=>gkr,ZodEnum:()=>jtt,ZodError:()=>zMd,ZodExactOptional:()=>bbo,ZodFile:()=>Abo,ZodFirstPartyTypeKind:()=>Lbo,ZodFunction:()=>zbo,ZodGUID:()=>l6t,ZodIPv4:()=>Ckr,ZodIPv6:()=>xkr,ZodISODate:()=>lkr,ZodISODateTime:()=>ckr,ZodISODuration:()=>pkr,ZodISOTime:()=>ukr,ZodIntersection:()=>lbo,ZodIssueCode:()=>MMd,ZodJWT:()=>Bkr,ZodKSUID:()=>vkr,ZodLazy:()=>Fbo,ZodLiteral:()=>gbo,ZodMAC:()=>Jyo,ZodMap:()=>mbo,ZodNaN:()=>Bbo,ZodNanoID:()=>Akr,ZodNever:()=>ibo,ZodNonOptional:()=>zkr,ZodNull:()=>ebo,ZodNullable:()=>Ibo,ZodNumber:()=>Mtt,ZodNumberFormat:()=>v6e,ZodObject:()=>g6t,ZodOptional:()=>jkr,ZodPipe:()=>Qkr,ZodPrefault:()=>xbo,ZodPromise:()=>jbo,ZodReadonly:()=>Dbo,ZodRealError:()=>zz,ZodRecord:()=>y6t,ZodSet:()=>hbo,ZodString:()=>ztt,ZodStringFormat:()=>pA,ZodSuccess:()=>Tbo,ZodSymbol:()=>Zyo,ZodTemplateLiteral:()=>kbo,ZodTransform:()=>ybo,ZodTuple:()=>pbo,ZodType:()=>cp,ZodULID:()=>Ekr,ZodURL:()=>d6t,ZodUUID:()=>Aee,ZodUndefined:()=>$yo,ZodUnion:()=>A6t,ZodUnknown:()=>nbo,ZodVoid:()=>obo,ZodXID:()=>Ikr,ZodXor:()=>abo,_ZodString:()=>mkr,_default:()=>Cbo,_function:()=>Z8c,any:()=>B8c,array:()=>h6t,base64:()=>d8c,base64url:()=>m8c,bigint:()=>S8c,boolean:()=>Xyo,catch:()=>Pbo,check:()=>$8c,cidrv4:()=>p8c,cidrv6:()=>f8c,clone:()=>QF,codec:()=>J8c,coerce:()=>_bo,config:()=>GI,core:()=>Tfe,cuid:()=>n8c,cuid2:()=>i8c,custom:()=>eGc,date:()=>R8c,decode:()=>_yo,decodeAsync:()=>Vyo,describe:()=>tGc,discriminatedUnion:()=>Q8c,e164:()=>h8c,email:()=>H5c,emoji:()=>t8c,encode:()=>Lyo,encodeAsync:()=>Uyo,endsWith:()=>wtt,enum:()=>Fkr,exactOptional:()=>Ebo,file:()=>q8c,flattenError:()=>qLt,float32:()=>I8c,float64:()=>v8c,formatError:()=>WLt,fromJSONSchema:()=>lGc,function:()=>Z8c,getErrorMap:()=>_Md,globalRegistry:()=>RP,gt:()=>hee,gte:()=>MF,guid:()=>K5c,hash:()=>E8c,hex:()=>b8c,hostname:()=>y8c,httpUrl:()=>e8c,includes:()=>xtt,instanceof:()=>nGc,int:()=>dkr,int32:()=>C8c,int64:()=>w8c,intersection:()=>ubo,ipv4:()=>c8c,ipv6:()=>u8c,iso:()=>Ntt,json:()=>oGc,jwt:()=>g8c,keyof:()=>k8c,ksuid:()=>a8c,lazy:()=>Nbo,length:()=>E6e,literal:()=>G8c,locales:()=>e6t,looseObject:()=>j8c,looseRecord:()=>L8c,lowercase:()=>vtt,lt:()=>mee,lte:()=>H6,mac:()=>l8c,map:()=>_8c,maxLength:()=>b6e,maxSize:()=>ave,meta:()=>rGc,mime:()=>Ttt,minLength:()=>wfe,minSize:()=>gee,multipleOf:()=>sve,nan:()=>K8c,nanoid:()=>r8c,nativeEnum:()=>V8c,negative:()=>XRr,never:()=>Rkr,nonnegative:()=>$Rr,nonoptional:()=>wbo,nonpositive:()=>ZRr,normalize:()=>Ott,null:()=>tbo,nullable:()=>p6t,nullish:()=>W8c,number:()=>Yyo,object:()=>F8c,optional:()=>u6t,overwrite:()=>CH,parse:()=>jyo,parseAsync:()=>zyo,partialRecord:()=>M8c,pipe:()=>f6t,positive:()=>YRr,prefault:()=>Sbo,preprocess:()=>sGc,prettifyError:()=>qmo,promise:()=>X8c,property:()=>ekr,readonly:()=>Rbo,record:()=>dbo,refine:()=>Qbo,regex:()=>Itt,regexes:()=>NV,registry:()=>PRr,safeDecode:()=>qyo,safeDecodeAsync:()=>Hyo,safeEncode:()=>Gyo,safeEncodeAsync:()=>Wyo,safeParse:()=>Qyo,safeParseAsync:()=>Myo,set:()=>U8c,setErrorMap:()=>LMd,size:()=>y6e,slugify:()=>Rtt,startsWith:()=>Stt,strictObject:()=>N8c,string:()=>fkr,stringFormat:()=>A8c,stringbool:()=>iGc,success:()=>H8c,superRefine:()=>Mbo,symbol:()=>O8c,templateLiteral:()=>Y8c,toJSONSchema:()=>ikr,toLowerCase:()=>Btt,toUpperCase:()=>Dtt,transform:()=>Nkr,treeifyError:()=>Gmo,trim:()=>Ptt,tuple:()=>fbo,uint32:()=>x8c,uint64:()=>T8c,ulid:()=>o8c,undefined:()=>P8c,union:()=>kkr,unknown:()=>I6e,uppercase:()=>Ctt,url:()=>$5c,util:()=>vi,uuid:()=>J5c,uuidv4:()=>Y5c,uuidv6:()=>X5c,uuidv7:()=>Z5c,void:()=>D8c,xid:()=>s8c,xor:()=>z8c});var Ubo=h(()=>{"use strict";jz();c6t();akr();Nyo();Kyo();aGc();jz();rAo();jz();o6t();uGc();oAo();s6t();s6t();pGc();GI(SRr())});var is=h(()=>{"use strict";Ubo();Ubo()});var fGc=h(()=>{"use strict"});var iEo={};ne(iEo,{AIChatConfig:()=>Wbo,AIChatDatasource:()=>n9c,AIChatLocation:()=>hGc,AIChatModel:()=>gGc,AIChatWebsiteDatasource:()=>r9c,AbsoluteProductPath:()=>Iqc,AgentsConfig:()=>s9c,AiExamplesConfig:()=>t9c,AnalyticsConfig:()=>e9c,AnnouncementConfig:()=>Gkr,ApiReferenceConfiguration:()=>lqc,ApiReferenceEndpointConfiguration:()=>Z9c,ApiReferenceLayout:()=>OGc,ApiReferenceLayoutItem:()=>x6t,ApiReferenceOperationConfiguration:()=>$9c,ApiReferencePackageConfiguration:()=>rqc,ApiReferencePackageConfigurationWithOptions:()=>tqc,ApiReferenceSectionConfiguration:()=>eqc,ApiSpecConfiguration:()=>cqc,ApiSpecErrorResponseEnsure:()=>oqc,ApiSpecErrorResponseHttpMethod:()=>iqc,ApiSpecErrorResponses:()=>sqc,ApiSpecImportSettings:()=>aqc,ApiSpecType:()=>nqc,Audience:()=>I6t,AudienceId:()=>Vbo,Availability:()=>Pfe,BackgroundImageConfiguration:()=>GGc,BackgroundImageThemedConfig:()=>VGc,BlogConfiguration:()=>J9c,BodyThemeConfig:()=>NGc,BreadcrumbsConfig:()=>p9c,ChangelogConfiguration:()=>K9c,ChangelogFolderRelativePath:()=>E6t,ChangelogLayout:()=>TGc,CheckConfig:()=>Q9c,CheckRuleSeverity:()=>Ofe,CheckRulesConfig:()=>z9c,CodeBlockTheme:()=>Gbo,CodeBlocksThemeConfig:()=>DGc,CollapsedStringValue:()=>WGc,CollapsedValue:()=>v6t,ColorConfig:()=>Ix,ColorThemedConfig:()=>LGc,ColorsConfiguration:()=>h9c,ContentAlignment:()=>SGc,CssConfig:()=>qGc,CustomDomain:()=>_Gc,CustomPageAction:()=>g9c,DocsConfiguration:()=>tLd,DocsInstance:()=>I9c,DocsSettingsConfig:()=>m9c,DocsTypographyConfig:()=>l9c,EditThisPageConfig:()=>E9c,EditThisPageLaunch:()=>AGc,EmbeddingConfig:()=>o9c,ExperimentalConfig:()=>U9c,ExternalProduct:()=>yqc,ExternalSitemapConfigSchema:()=>L9c,ExternalSitemapSchema:()=>_9c,FeatureFlag:()=>qbo,FeatureFlagConfiguration:()=>HGc,FolderConfiguration:()=>X9c,FontConfig:()=>Lkr,FontConfigPath:()=>c9c,FontConfigVariant:()=>a9c,FontDisplay:()=>IGc,FontStyle:()=>Ybo,FontWeight:()=>Zbo,FooterLinksConfig:()=>B9c,FooterNavThemeConfig:()=>kGc,FullStoryAnalyticsConfig:()=>JGc,GTMConfig:()=>ZGc,GitLibraryInputSchema:()=>V9c,GithubEditThisPageConfig:()=>b9c,GoogleAnalytics4Config:()=>$Gc,HeaderPosition:()=>wGc,HttpSnippetLanguage:()=>QGc,HttpSnippetsConfig:()=>UGc,IntegrationsConfig:()=>M9c,IntercomConfig:()=>YGc,InternalProduct:()=>Aqc,JsConfig:()=>F9c,JsConfigOptions:()=>Hbo,JsFileConfig:()=>R9c,JsFileConfigSettings:()=>D9c,JsRemoteConfig:()=>k9c,JsScriptStrategy:()=>Xbo,Language:()=>Ukr,LanguageSwitcherThemeConfig:()=>BGc,LayoutConfig:()=>f9c,LibraryConfiguration:()=>H9c,LibraryInputConfiguration:()=>q9c,LibraryLanguage:()=>EGc,LibraryName:()=>Kbo,LibraryOutputConfiguration:()=>W9c,LibraryReferenceConfiguration:()=>Y9c,LinkConfiguration:()=>eEo,LogoConfiguration:()=>v9c,MetadataConfig:()=>N9c,NavbarDropdownConfig:()=>O9c,NavbarGithubConfig:()=>T9c,NavbarGithubConfigWithOptions:()=>w9c,NavbarLink:()=>P9c,NavbarLinkConfig:()=>C6e,NavigationConfig:()=>qkr,NavigationItem:()=>S6t,PageActionOption:()=>mGc,PageActionOptions:()=>A9c,PageActionsConfig:()=>y9c,PageActionsThemeConfig:()=>zGc,PageConfiguration:()=>Gtt,PageDescriptionSource:()=>i9c,PathLibraryInputSchema:()=>G9c,PlaygroundButtonSettings:()=>S9c,PlaygroundSettings:()=>C6t,PostHogConfig:()=>XGc,ProductConfig:()=>bqc,ProductConfigBase:()=>nEo,ProductFileConfig:()=>eLd,ProductPath:()=>$Md,ProductSwitcherThemeConfig:()=>PGc,ProgrammingLanguage:()=>dGc,RedirectConfig:()=>tEo,RedirectsConfiguration:()=>j9c,RedirectsFile:()=>XMd,RelativeProductPath:()=>Eqc,Role:()=>$bo,RoleId:()=>_kr,SearchSettingsConfig:()=>d9c,SearchbarPlacement:()=>vGc,SectionConfiguration:()=>uqc,SegmentConfig:()=>KGc,SidebarThemeConfig:()=>jGc,SiteSwitcherThemeConfig:()=>RGc,SnippetLanguageConfiguration:()=>xH,SnippetsConfiguration:()=>x9c,SortByAvailabilityValue:()=>yGc,SwitcherPlacement:()=>xGc,TabConfig:()=>Wkr,TabId:()=>Utt,TabVariant:()=>fqc,TabbedNavigationConfig:()=>gqc,TabbedNavigationItem:()=>hqc,TabbedNavigationItemWithLayout:()=>dqc,TabbedNavigationItemWithVariants:()=>mqc,TabsPlacement:()=>CGc,TabsThemeConfig:()=>FGc,Target:()=>Vtt,ThemeConfig:()=>u9c,TitleSource:()=>Jbo,TranslationConfig:()=>Cqc,TranslationConfigObject:()=>vqc,TwitterCardSetting:()=>MGc,UntabbedNavigationConfig:()=>pqc,VersionAvailability:()=>bGc,VersionConfig:()=>rEo,VersionFileConfig:()=>ZMd,VersionedSnippetLanguageConfiguration:()=>C9c,WithFeatureFlags:()=>FP,WithPermissions:()=>kP,WithViewers:()=>Vkr,normalizeTranslationConfig:()=>xqc});function xqc(e){return typeof e=="string"?{lang:e}:e}var Utt,E6t,Vbo,_kr,Kbo,dGc,Ukr,mGc,hGc,gGc,AGc,Pfe,yGc,bGc,Jbo,EGc,Ybo,IGc,vGc,CGc,xGc,SGc,wGc,TGc,OGc,PGc,BGc,Gbo,DGc,RGc,kGc,FGc,NGc,jGc,zGc,QGc,Vtt,MGc,Xbo,Zbo,LGc,Ix,I6t,$bo,_Gc,UGc,VGc,GGc,qGc,WGc,v6t,kP,qbo,HGc,FP,Vkr,KGc,JGc,YGc,XGc,ZGc,$Gc,e9c,t9c,r9c,n9c,i9c,o9c,s9c,Wbo,a9c,c9c,Lkr,l9c,u9c,p9c,f9c,d9c,m9c,h9c,g9c,A9c,y9c,b9c,E9c,I9c,v9c,eEo,C9c,xH,x9c,S9c,C6t,Gkr,C6e,w9c,T9c,O9c,P9c,B9c,D9c,R9c,k9c,Hbo,F9c,N9c,tEo,j9c,XMd,Ofe,z9c,Q9c,M9c,L9c,_9c,U9c,V9c,G9c,q9c,W9c,H9c,Gtt,K9c,J9c,Y9c,X9c,Z9c,$9c,x6t,eqc,tqc,rqc,nqc,iqc,oqc,sqc,aqc,cqc,lqc,S6t,uqc,pqc,fqc,dqc,mqc,hqc,gqc,qkr,Wkr,rEo,ZMd,nEo,Aqc,yqc,bqc,Eqc,Iqc,$Md,eLd,vqc,Cqc,tLd,Sqc=h(()=>{"use strict";is();Utt=T.string(),E6t=T.string(),Vbo=T.string(),_kr=T.string(),Kbo=T.string(),dGc=T.enum(["typescript","javascript","python","java","go","ruby","csharp","php","swift","rust","nodets","nodejs","dotnet","curl","jvm","ts","js"]),Ukr=T.string().regex(/^[a-zA-Z]{2,8}(-[a-zA-Z0-9]{1,8})*$/,"Language must be a valid BCP 47 language tag (e.g. 'en', 'ja', 'ja-JP', 'pt-BR', 'zh-Hans-CN')"),mGc=T.enum(["copy-page","view-as-markdown","ask-ai","chatgpt","claude","cursor","vscode"]),hGc=T.enum(["docs","slack","discord"]),gGc=T.enum(["claude-3.7","claude-4","command-a"]),AGc=T.enum(["github","dashboard"]),Pfe=T.enum(["stable","generally-available","in-development","pre-release","deprecated","beta","alpha","preview","legacy"]),yGc=T.enum(["unset","stable","generally-available","in-development","pre-release","deprecated","beta","alpha","preview","legacy"]),bGc=T.enum(["deprecated","ga","stable","beta"]),Jbo=T.enum(["frontmatter","filename"]),EGc=T.enum(["python","cpp"]),Ybo=T.enum(["normal","italic"]),IGc=T.enum(["auto","block","swap","fallback","optional"]),vGc=T.enum(["header","header-tabs","sidebar"]),CGc=T.enum(["header","sidebar"]),xGc=T.enum(["header","sidebar"]),SGc=T.enum(["center","left"]),wGc=T.enum(["fixed","static"]),TGc=T.enum(["timeline","classic"]),OGc=T.enum(["indented","cards"]),PGc=T.enum(["default","toggle","tabs"]),BGc=T.enum(["default","minimal"]),Gbo=T.enum(["github-dark","github-dark-default","github-dark-dimmed","github-dark-high-contrast","github-light","github-light-default","github-light-high-contrast","material-theme-darker","min-dark","min-light"]),DGc=T.object({light:Gbo.optional(),dark:Gbo.optional()}),RGc=T.object({enabled:T.boolean().optional(),order:T.array(T.string()).optional(),hide:T.array(T.string()).optional(),labels:T.record(T.string(),T.string()).optional(),"show-products":T.boolean().optional()}),kGc=T.enum(["default","minimal"]),FGc=T.enum(["default","bubble"]),NGc=T.enum(["default","canvas"]),jGc=T.enum(["default","minimal"]),zGc=T.enum(["default","toolbar"]),QGc=T.enum(["curl","csharp","go","java","javascript","php","python","ruby","swift","typescript"]),Vtt=T.enum(["_blank","_self","_parent","_top"]),MGc=T.enum(["summary","summary_large_image","app","player"]),Xbo=T.enum(["beforeInteractive","afterInteractive","lazyOnload"]),Zbo=T.union([T.string(),T.number().int()]),LGc=T.object({dark:T.string().optional(),light:T.string().optional()}),Ix=T.union([T.string(),LGc]),I6t=T.union([Vbo,T.array(Vbo)]),$bo=T.union([_kr,T.array(_kr)]),_Gc=T.union([T.string(),T.array(T.string())]),UGc=T.union([T.boolean(),T.array(QGc)]),VGc=T.object({dark:T.string().optional(),light:T.string().optional()}),GGc=T.union([T.string(),VGc]),qGc=T.union([T.string(),T.array(T.string())]),WGc=T.enum(["open-by-default"]),v6t=T.union([T.boolean(),WGc]),kP=T.object({viewers:$bo.optional(),orphaned:T.boolean().optional()}),qbo=T.object({flag:T.string(),"fallback-value":T.unknown().optional(),match:T.unknown().optional()}),HGc=T.union([T.string(),qbo,T.array(qbo)]),FP=T.object({"feature-flag":HGc.optional()}),Vkr=T.object({viewers:$bo.optional()}),KGc=T.object({"write-key":T.string()}),JGc=T.object({"org-id":T.string()}),YGc=T.object({"app-id":T.string(),"api-base":T.string().optional()}),XGc=T.object({"api-key":T.string(),endpoint:T.string().optional()}),ZGc=T.object({"container-id":T.string()}),$Gc=T.object({"measurement-id":T.string()}),e9c=T.object({segment:KGc.optional(),fullstory:JGc.optional(),intercom:YGc.optional(),posthog:XGc.optional(),gtm:ZGc.optional(),ga4:$Gc.optional()}),t9c=T.object({enabled:T.boolean().optional(),style:T.string().optional()}),r9c=T.object({url:T.string(),title:T.string().optional()}),n9c=r9c,i9c=T.enum(["description","subtitle"]),o9c=T.object({"allowed-origins":T.array(T.string())}),s9c=T.object({"page-directive":T.string().optional(),"page-description-source":i9c.optional(),"llms-txt":T.string().optional(),"llms-full-txt":T.string().optional()}),Wbo=T.object({model:gGc.optional(),"system-prompt":T.string().optional(),location:T.array(hGc).optional(),datasources:T.array(n9c).optional(),"mask-pii":T.boolean().optional(),disclaimer:T.string().optional()}),a9c=T.object({path:T.string(),weight:Zbo.optional(),style:Ybo.optional()}),c9c=T.union([T.string(),a9c]),Lkr=T.object({name:T.string().optional(),path:T.string().optional(),weight:Zbo.optional(),style:Ybo.optional(),paths:T.array(c9c).optional(),display:IGc.optional(),fallback:T.array(T.string()).optional(),"font-variation-settings":T.string().optional()}),l9c=T.object({headingsFont:Lkr.optional(),bodyFont:Lkr.optional(),codeFont:Lkr.optional()}),u9c=T.object({sidebar:jGc.optional(),body:NGc.optional(),tabs:FGc.optional(),"page-actions":zGc.optional(),"footer-nav":kGc.optional(),"language-switcher":BGc.optional(),"product-switcher":PGc.optional(),"site-switcher":RGc.optional(),"code-blocks":DGc.optional()}),p9c=T.object({"current-page":T.boolean().optional()}),f9c=T.object({"page-width":T.string().optional(),"content-width":T.string().optional(),"sidebar-width":T.string().optional(),"header-height":T.string().optional(),"searchbar-placement":vGc.optional(),"tabs-placement":CGc.optional(),"switcher-placement":xGc.optional(),"content-alignment":SGc.optional(),"header-position":wGc.optional(),"disable-header":T.boolean().optional(),"hide-nav-links":T.boolean().optional(),"hide-feedback":T.boolean().optional(),"mobile-toc":T.boolean().optional(),"changelog-layout":TGc.optional(),"api-reference-layout":OGc.optional(),"api-reference-expand-properties":T.boolean().optional(),"show-nav-availability-badges":T.boolean().optional(),"hide-webhook-method-badges":T.boolean().optional(),breadcrumbs:p9c.optional()}),d9c=T.object({"prioritize-current-product":T.boolean().optional(),"default-filter-by-current-product":T.boolean().optional()}),m9c=T.object({"search-text":T.string().optional(),"disable-search":T.boolean().optional(),"dark-mode-code":T.boolean().optional(),"default-search-filters":T.boolean().optional(),search:d9c.optional(),"http-snippets":UGc.optional(),"hide-404-page":T.boolean().optional(),"use-javascript-as-typescript":T.boolean().optional(),"disable-explorer-proxy":T.boolean().optional(),"disable-analytics":T.boolean().optional(),"require-analytics-consent":T.boolean().optional(),language:Ukr.optional(),"folder-title-source":Jbo.optional(),"substitute-env-vars":T.boolean().optional(),"websocket-oneof-display":T.enum(["flat","grouped"]).optional(),embedding:o9c.optional()}),h9c=T.object({"accent-primary":Ix.optional(),accentPrimary:Ix.optional(),background:Ix.optional(),border:Ix.optional(),"sidebar-background":Ix.optional(),"header-background":Ix.optional(),"card-background":Ix.optional(),"accent-1":Ix.optional(),"accent-2":Ix.optional(),"accent-3":Ix.optional(),"accent-4":Ix.optional(),"accent-5":Ix.optional(),"accent-6":Ix.optional(),"accent-7":Ix.optional(),"accent-8":Ix.optional(),"accent-9":Ix.optional(),"accent-10":Ix.optional(),"accent-11":Ix.optional(),"accent-12":Ix.optional()}),g9c=T.object({title:T.string(),subtitle:T.string().optional(),url:T.string(),icon:T.string().optional(),default:T.boolean().optional()}),A9c=T.object({"copy-page":T.boolean().optional(),"view-as-markdown":T.boolean().optional(),"ask-ai":T.boolean().optional(),chatgpt:T.boolean().optional(),claude:T.boolean().optional(),cursor:T.boolean().optional(),mcp:T.boolean().optional(),vscode:T.boolean().optional(),custom:T.array(g9c).optional()}),y9c=T.object({default:mGc.optional(),options:A9c.optional()}),b9c=T.object({host:T.string().optional(),owner:T.string(),repo:T.string(),branch:T.string().optional()}),E9c=T.object({github:b9c.optional(),launch:AGc.optional()}),I9c=T.object({url:T.string(),"custom-domain":_Gc.optional(),"edit-this-page":E9c.optional(),audiences:I6t.optional(),"multi-source":T.boolean().optional()}),v9c=T.object({dark:T.string().optional(),light:T.string().optional(),height:T.number().optional(),href:T.string().optional(),"right-text":T.string().optional()}),eEo=T.object({link:T.string(),href:T.string(),icon:T.string().optional(),target:Vtt.optional()}),C9c=T.object({version:T.string(),package:T.string()}),xH=T.union([T.string(),C9c]),x9c=T.object({python:xH.optional(),typescript:xH.optional(),go:xH.optional(),java:xH.optional(),ruby:xH.optional(),csharp:xH.optional(),php:xH.optional(),swift:xH.optional(),cli:xH.optional(),rust:xH.optional()}),S9c=T.object({href:T.string().optional()}),C6t=T.object({hidden:T.boolean().optional(),environments:T.array(T.string()).optional(),button:S9c.optional(),oauth:T.boolean().optional(),"limit-websocket-messages-per-connection":T.number().int().optional(),"send-optional-defaults":T.boolean().optional()}),Gkr=T.object({message:T.string()}),C6e=Vkr.merge(T.object({href:T.string().optional(),target:Vtt.optional(),url:T.string().optional(),text:T.string().optional(),icon:T.string().optional(),rightIcon:T.string().optional(),rounded:T.boolean().optional()})),w9c=Vkr.merge(T.object({url:T.string(),target:Vtt.optional()})),T9c=T.union([T.string(),w9c]),O9c=Vkr.merge(T.object({links:T.array(C6e),text:T.string().optional(),icon:T.string().optional(),rightIcon:T.string().optional(),rounded:T.boolean().optional()})),P9c=T.union([C6e.merge(T.object({type:T.literal("filled")})),C6e.merge(T.object({type:T.literal("outlined")})),C6e.merge(T.object({type:T.literal("minimal")})),T.object({type:T.literal("github"),value:T9c}),O9c.merge(T.object({type:T.literal("dropdown")})),C6e.merge(T.object({type:T.literal("primary")})),C6e.merge(T.object({type:T.literal("secondary")}))]),B9c=T.object({github:T.string().optional(),twitter:T.string().optional(),x:T.string().optional(),linkedin:T.string().optional(),youtube:T.string().optional(),instagram:T.string().optional(),facebook:T.string().optional(),discord:T.string().optional(),slack:T.string().optional(),hackernews:T.string().optional(),medium:T.string().optional(),website:T.string().optional()}),D9c=T.object({path:T.string(),strategy:Xbo.optional()}),R9c=T.union([T.string(),D9c]),k9c=T.object({url:T.string(),strategy:Xbo.optional(),"disable-sri":T.boolean().optional()}),Hbo=T.union([k9c,R9c]),F9c=T.union([Hbo,T.array(Hbo)]),N9c=T.object({"og:site_name":T.string().optional(),"og:title":T.string().optional(),"og:description":T.string().optional(),"og:url":T.string().optional(),"og:image":T.string().optional(),"og:image:width":T.number().optional(),"og:image:height":T.number().optional(),"og:locale":T.string().optional(),"og:logo":T.string().optional(),"twitter:title":T.string().optional(),"twitter:description":T.string().optional(),"twitter:handle":T.string().optional(),"twitter:image":T.string().optional(),"twitter:site":T.string().optional(),"twitter:url":T.string().optional(),"twitter:card":MGc.optional(),"og:dynamic":T.boolean().optional(),"og:dynamic:background-image":T.string().optional(),"og:dynamic:text-color":T.string().optional(),"og:dynamic:background-color":T.string().optional(),"og:dynamic:logo-color":T.enum(["dark","light"]).optional(),"og:dynamic:show-logo":T.boolean().optional(),"og:dynamic:show-section":T.boolean().optional(),"og:dynamic:show-description":T.boolean().optional(),"og:dynamic:show-url":T.boolean().optional(),"og:dynamic:show-gradient":T.boolean().optional(),"canonical-host":T.string().optional()}),tEo=T.object({source:T.string(),destination:T.string(),permanent:T.boolean().optional()}),j9c=T.union([T.array(tEo),T.string(),T.array(T.string())]),XMd=T.object({redirects:T.array(tEo.strict())}).strict(),Ofe=T.enum(["warn","error"]),z9c=T.object({"example-validation":Ofe.optional(),"broken-links":Ofe.optional(),"no-non-component-refs":Ofe.optional(),"valid-local-references":Ofe.optional(),"no-circular-redirects":Ofe.optional(),"valid-docs-endpoints":Ofe.optional(),"missing-redirects":Ofe.optional(),"valid-changelog-slug":Ofe.optional()}),Q9c=T.object({rules:z9c.optional()}),M9c=T.object({intercom:T.string().optional(),context7:T.string().optional()}),L9c=T.object({url:T.string(),locale:T.string().optional()}),_9c=T.union([T.string(),L9c]),U9c=T.object({"mdx-components":T.array(T.string()).optional(),"disable-stream-toggle":T.boolean().optional(),"openapi-parser-v2":T.boolean().optional(),"openapi-parser-v3":T.boolean().optional(),"dynamic-snippets":T.boolean().optional(),"ai-examples":T.boolean().optional(),"ai-example-style-instructions":T.string().optional(),"exclude-apis":T.boolean().optional(),"basepath-aware":T.boolean().optional(),"robots-txt-on-instance-url":T.boolean().optional(),"external-sitemaps":T.array(_9c).optional()}),V9c=T.object({git:T.string(),subpath:T.string().optional(),ref:T.string().optional()}),G9c=T.object({path:T.string()}),q9c=T.union([V9c,G9c]),W9c=T.object({path:T.string()}),H9c=T.object({input:q9c,output:W9c,lang:EGc}),Gtt=kP.merge(FP).merge(T.object({page:T.string(),path:T.string(),slug:T.string().optional(),icon:T.string().optional(),hidden:T.boolean().optional(),noindex:T.boolean().optional(),availability:Pfe.optional()})),K9c=kP.merge(FP).merge(T.object({changelog:E6t,title:T.string().optional(),slug:T.string().optional(),icon:T.string().optional(),hidden:T.boolean().optional()})),J9c=kP.merge(FP).merge(T.object({blog:E6t,title:T.string().optional(),slug:T.string().optional(),icon:T.string().optional(),hidden:T.boolean().optional()})),Y9c=kP.merge(FP).merge(T.object({library:Kbo,title:T.string().optional(),slug:T.string().optional()})),X9c=kP.merge(FP).merge(T.object({folder:T.string(),title:T.string().optional(),"title-source":Jbo.optional(),slug:T.string().optional(),icon:T.string().optional(),hidden:T.boolean().optional(),"skip-slug":T.boolean().optional(),collapsed:v6t.optional(),collapsible:T.boolean().optional(),"collapsed-by-default":T.boolean().optional(),availability:Pfe.optional()})),Z9c=kP.merge(FP).merge(T.object({endpoint:T.string(),title:T.string().optional(),slug:T.string().optional(),icon:T.string().optional(),hidden:T.boolean().optional(),availability:Pfe.optional(),playground:C6t.optional()})),$9c=kP.merge(FP).merge(T.object({operation:T.string(),title:T.string().optional(),slug:T.string().optional(),hidden:T.boolean().optional(),availability:Pfe.optional()})),x6t=T.lazy(()=>T.union([T.string(),T.record(T.string(),rqc),eqc,Z9c,$9c,Gtt,eEo])),eqc=kP.merge(FP).merge(T.object({section:T.string(),"referenced-packages":T.array(T.string()).optional(),summary:T.string().optional(),contents:T.array(x6t).optional(),slug:T.string().optional(),icon:T.string().optional(),hidden:T.boolean().optional(),"skip-slug":T.boolean().optional(),collapsed:v6t.optional(),collapsible:T.boolean().optional(),"collapsed-by-default":T.boolean().optional(),availability:Pfe.optional(),playground:C6t.optional()})),tqc=kP.merge(FP).merge(T.object({title:T.string().optional(),summary:T.string().optional(),contents:T.array(x6t).optional(),availability:Pfe.optional(),slug:T.string().optional(),icon:T.string().optional(),hidden:T.boolean().optional(),"skip-slug":T.boolean().optional(),playground:C6t.optional()})),rqc=T.lazy(()=>T.union([T.array(x6t),tqc])),nqc=T.enum(["openapi","asyncapi","graphql"]),iqc=T.enum(["get","post","put","patch","delete","head","options","trace"]),oqc=T.object({"status-code":T.number().int().min(400).max(599),methods:T.array(iqc).optional()}),sqc=T.object({schema:T.union([T.string(),T.record(T.string(),T.unknown())]),name:T.string().optional(),"apply-to":T.enum(["all","untyped"]).optional(),ensure:T.array(oqc).optional()}),aqc=T.object({"type-dates-as-strings":T.boolean().optional(),"use-bytes-for-binary-response":T.boolean().optional(),"respect-parameter-content":T.boolean().optional(),"respect-operation-id-word-boundaries":T.boolean().optional(),"infer-forward-compatible":T.boolean().optional(),"preserve-one-of-in-all-of":T.boolean().optional(),"any-of-sibling-properties-as-object":T.boolean().optional(),"error-responses":sqc.optional()}),cqc=T.object({type:nqc,path:T.string(),namespace:T.string().optional(),overlays:T.string().optional(),overrides:T.array(T.string()).optional(),settings:aqc.optional()}),lqc=kP.merge(FP).merge(T.object({api:T.string(),"api-name":T.string().optional(),specs:T.array(cqc).optional(),openrpc:T.string().optional(),audiences:I6t.optional(),"display-errors":T.boolean().optional(),"tag-description-pages":T.boolean().optional(),snippets:x9c.optional(),postman:T.string().optional(),summary:T.string().optional(),layout:T.array(x6t).optional(),collapsed:v6t.optional(),icon:T.string().optional(),slug:T.string().optional(),hidden:T.boolean().optional(),availability:Pfe.optional(),"skip-slug":T.boolean().optional(),alphabetized:T.boolean().optional(),"sort-by-availability":T.array(yGc).optional(),flattened:T.boolean().optional(),paginated:T.boolean().optional(),playground:C6t.optional()})),S6t=T.lazy(()=>T.union([Gtt,uqc,lqc,Y9c,eEo,K9c,J9c,X9c])),uqc=kP.merge(FP).merge(T.object({section:T.string(),path:T.string().optional(),contents:T.array(S6t),collapsed:v6t.optional(),collapsible:T.boolean().optional(),"collapsed-by-default":T.boolean().optional(),slug:T.string().optional(),icon:T.string().optional(),hidden:T.boolean().optional(),"skip-slug":T.boolean().optional(),availability:Pfe.optional()})),pqc=T.array(S6t),fqc=kP.merge(FP).merge(T.object({title:T.string(),subtitle:T.string().optional(),icon:T.string().optional(),layout:T.array(S6t),slug:T.string().optional(),"skip-slug":T.boolean().optional(),hidden:T.boolean().optional(),default:T.boolean().optional()})),dqc=T.object({tab:Utt,layout:T.array(S6t).optional()}),mqc=T.object({tab:Utt,variants:T.array(fqc)}),hqc=T.union([dqc,mqc]),gqc=T.array(hqc),qkr=T.union([gqc,pqc]),Wkr=kP.merge(FP).merge(T.object({"display-name":T.string(),icon:T.string().optional(),slug:T.string().optional(),"skip-slug":T.boolean().optional(),hidden:T.boolean().optional(),href:T.string().optional(),target:Vtt.optional(),changelog:E6t.optional(),blog:E6t.optional()})),rEo=kP.merge(FP).merge(T.object({"display-name":T.string(),path:T.string().optional(),ref:T.string().optional(),slug:T.string().optional(),availability:bGc.optional(),audiences:I6t.optional(),hidden:T.boolean().optional(),announcement:Gkr.optional()})),ZMd=T.object({tabs:T.record(Utt,Wkr).optional(),"landing-page":Gtt.optional(),navigation:qkr}),nEo=kP.merge(FP).merge(T.object({"display-name":T.string(),subtitle:T.string().optional(),icon:T.string().optional(),image:T.string().optional(),versions:T.array(rEo).optional(),audiences:I6t.optional()})),Aqc=nEo.merge(T.object({path:T.string(),slug:T.string().optional(),announcement:Gkr.optional()})),yqc=nEo.merge(T.object({href:T.string(),target:Vtt.optional()})),bqc=T.union([Aqc,yqc]),Eqc=kP.merge(FP).merge(T.object({"display-name":T.string(),path:T.string(),slug:T.string().optional()})),Iqc=T.object({href:T.string()}),$Md=T.union([Eqc,Iqc]),eLd=T.object({tabs:T.record(Utt,Wkr).optional(),"landing-page":Gtt.optional(),navigation:qkr}),vqc=T.object({lang:Ukr,default:T.boolean().optional()}),Cqc=T.union([Ukr,vqc]);tLd=T.object({instances:T.array(I9c),title:T.string().optional(),libraries:T.record(Kbo,H9c).optional(),analytics:e9c.optional(),announcement:Gkr.optional(),roles:T.array(_kr).optional(),tabs:T.record(Utt,Wkr).optional(),versions:T.array(rEo).optional(),products:T.array(bqc).optional(),"landing-page":Gtt.optional(),navigation:qkr.optional(),"navbar-links":T.array(P9c).optional(),"footer-links":B9c.optional(),"page-actions":y9c.optional(),experimental:U9c.optional(),"default-language":dGc.optional(),languages:T.array(T.string()).optional(),translations:T.array(Cqc).optional().superRefine((e,t)=>{if(e==null)return;let n=e.map(xqc).filter(i=>i.default===!0).length;n>1&&t.addIssue({code:T.ZodIssueCode.custom,message:`Only one translation entry can be marked as default, but ${n} were found`})}),"ai-chat":Wbo.optional(),"ai-search":Wbo.optional(),"ai-examples":t9c.optional(),agents:s9c.optional(),metadata:N9c.optional(),redirects:j9c.optional(),check:Q9c.optional(),logo:v9c.optional(),favicon:T.string().optional(),"background-image":GGc.optional(),colors:h9c.optional(),typography:l9c.optional(),layout:f9c.optional(),settings:m9c.optional(),theme:u9c.optional(),"global-theme":T.string().optional(),integrations:M9c.optional(),css:qGc.optional(),js:F9c.optional(),header:T.string().optional(),footer:T.string().optional()})});function iLd(e){if("changelog"in e)return e.changelog;if("blog"in e)return e.blog}function oLd(e){return e.changelog??e.blog}var rLd,nLd,wqc=h(()=>{"use strict";rLd="Changelog",nLd="Blog"});var Tqc=h(()=>{"use strict"});var Oqc=h(()=>{"use strict"});var Pqc=h(()=>{"use strict"});var Bqc=h(()=>{"use strict"});var Dqc=h(()=>{"use strict"});var oEo,Rqc=h(()=>{"use strict";oEo={Docs:"docs",Slack:"slack",Discord:"discord"}});var sEo,kqc=h(()=>{"use strict";sEo={Claude37:"claude-3.7",Claude4:"claude-4",CommandA:"command-a"}});var Fqc=h(()=>{"use strict"});var Nqc=h(()=>{"use strict"});var jqc=h(()=>{"use strict"});var zqc=h(()=>{"use strict"});var Qqc=h(()=>{"use strict"});var Mqc=h(()=>{"use strict"});var aEo,Lqc=h(()=>{"use strict";aEo={Indented:"indented",Cards:"cards"}});var _qc=h(()=>{"use strict"});var Uqc=h(()=>{"use strict"});var Vqc=h(()=>{"use strict"});var Gqc=h(()=>{"use strict"});var qqc=h(()=>{"use strict"});var Wqc=h(()=>{"use strict"});var cEo,Hqc=h(()=>{"use strict";cEo={All:"all",Untyped:"untyped"}});var Kqc=h(()=>{"use strict"});var lEo,Jqc=h(()=>{"use strict";lEo={Get:"get",Post:"post",Put:"put",Patch:"patch",Delete:"delete",Head:"head",Options:"options",Trace:"trace"}});var Yqc=h(()=>{"use strict"});var Xqc=h(()=>{"use strict"});var Zqc=h(()=>{"use strict"});var uEo,$qc=h(()=>{"use strict";uEo={Openapi:"openapi",Asyncapi:"asyncapi",Graphql:"graphql"}});var eWc=h(()=>{"use strict"});var tWc=h(()=>{"use strict"});var pEo,rWc=h(()=>{"use strict";pEo={Stable:"stable",GenerallyAvailable:"generally-available",InDevelopment:"in-development",PreRelease:"pre-release",Deprecated:"deprecated",Beta:"beta",Alpha:"alpha",Preview:"preview",Legacy:"legacy"}});var nWc=h(()=>{"use strict"});var iWc=h(()=>{"use strict"});var oWc=h(()=>{"use strict"});var fEo,sWc=h(()=>{"use strict";fEo={Default:"default",Canvas:"canvas"}});var aWc=h(()=>{"use strict"});var cWc=h(()=>{"use strict"});var lWc=h(()=>{"use strict"});var dEo,uWc=h(()=>{"use strict";dEo={Timeline:"timeline",Classic:"classic"}});var pWc=h(()=>{"use strict"});var mEo,fWc=h(()=>{"use strict";mEo={Warn:"warn",Error:"error"}});var dWc=h(()=>{"use strict"});var mWc=h(()=>{"use strict"});var hEo,hWc=h(()=>{"use strict";hEo={GithubDark:"github-dark",GithubDarkDefault:"github-dark-default",GithubDarkDimmed:"github-dark-dimmed",GithubDarkHighContrast:"github-dark-high-contrast",GithubLight:"github-light",GithubLightDefault:"github-light-default",GithubLightHighContrast:"github-light-high-contrast",MaterialThemeDarker:"material-theme-darker",MinDark:"min-dark",MinLight:"min-light"}});var gEo,gWc=h(()=>{"use strict";gEo={OpenByDefault:"open-by-default"}});var AWc=h(()=>{"use strict"});var yWc=h(()=>{"use strict"});var bWc=h(()=>{"use strict"});var EWc=h(()=>{"use strict"});var AEo,IWc=h(()=>{"use strict";AEo={Center:"center",Left:"left"}});var vWc=h(()=>{"use strict"});var CWc=h(()=>{"use strict"});var xWc=h(()=>{"use strict"});var SWc=h(()=>{"use strict"});var wWc=h(()=>{"use strict"});var TWc=h(()=>{"use strict"});var OWc=h(()=>{"use strict"});var PWc=h(()=>{"use strict"});var yEo,BWc=h(()=>{"use strict";yEo={Github:"github",Dashboard:"dashboard"}});var DWc=h(()=>{"use strict"});var RWc=h(()=>{"use strict"});var kWc=h(()=>{"use strict"});var FWc=h(()=>{"use strict"});var NWc=h(()=>{"use strict"});var jWc=h(()=>{"use strict"});var zWc=h(()=>{"use strict"});var QWc=h(()=>{"use strict"});var MWc=h(()=>{"use strict"});var LWc=h(()=>{"use strict"});var _Wc=h(()=>{"use strict"});var bEo,UWc=h(()=>{"use strict";bEo={Auto:"auto",Block:"block",Swap:"swap",Fallback:"fallback",Optional:"optional"}});var EEo,VWc=h(()=>{"use strict";EEo={Normal:"normal",Italic:"italic"}});var GWc=h(()=>{"use strict"});var qWc=h(()=>{"use strict"});var IEo,WWc=h(()=>{"use strict";IEo={Default:"default",Minimal:"minimal"}});var HWc=h(()=>{"use strict"});var KWc=h(()=>{"use strict"});var JWc=h(()=>{"use strict"});var YWc=h(()=>{"use strict"});var XWc=h(()=>{"use strict"});var vEo,ZWc=h(()=>{"use strict";vEo={Fixed:"fixed",Static:"static"}});var CEo,$Wc=h(()=>{"use strict";CEo={Curl:"curl",Csharp:"csharp",Go:"go",Java:"java",Javascript:"javascript",Php:"php",Python:"python",Ruby:"ruby",Swift:"swift",Typescript:"typescript"}});var e7c=h(()=>{"use strict"});var t7c=h(()=>{"use strict"});var r7c=h(()=>{"use strict"});var n7c=h(()=>{"use strict"});var i7c=h(()=>{"use strict"});var o7c=h(()=>{"use strict"});var s7c=h(()=>{"use strict"});var a7c=h(()=>{"use strict"});var c7c=h(()=>{"use strict"});var xEo,l7c=h(()=>{"use strict";xEo={BeforeInteractive:"beforeInteractive",AfterInteractive:"afterInteractive",LazyOnload:"lazyOnload"}});var u7c=h(()=>{"use strict"});var SEo,p7c=h(()=>{"use strict";SEo={Default:"default",Minimal:"minimal"}});var f7c=h(()=>{"use strict"});var d7c=h(()=>{"use strict"});var m7c=h(()=>{"use strict"});var h7c=h(()=>{"use strict"});var wEo,g7c=h(()=>{"use strict";wEo={Python:"python",Cpp:"cpp"}});var A7c=h(()=>{"use strict"});var TEo,y7c=h(()=>{"use strict";TEo={Kind:"kind",Header:"header"}});var b7c=h(()=>{"use strict"});var E7c=h(()=>{"use strict"});var OEo,I7c=h(()=>{"use strict";OEo={Compact:"compact",Hyphenated:"hyphenated"}});var v7c=h(()=>{"use strict"});var C7c=h(()=>{"use strict"});var x7c=h(()=>{"use strict"});var S7c=h(()=>{"use strict"});var w7c=h(()=>{"use strict"});var T7c=h(()=>{"use strict"});var O7c=h(()=>{"use strict"});var P7c=h(()=>{"use strict"});var B7c=h(()=>{"use strict"});var D7c=h(()=>{"use strict"});var PEo,R7c=h(()=>{"use strict";PEo={Dark:"dark",Light:"light"}});var BEo,k7c=h(()=>{"use strict";BEo={CopyPage:"copy-page",ViewAsMarkdown:"view-as-markdown",AskAi:"ask-ai",Chatgpt:"chatgpt",Claude:"claude",Cursor:"cursor",ClaudeCode:"claude-code",Vscode:"vscode"}});var F7c=h(()=>{"use strict"});var N7c=h(()=>{"use strict"});var DEo,j7c=h(()=>{"use strict";DEo={Default:"default",Toolbar:"toolbar"}});var z7c=h(()=>{"use strict"});var REo,Q7c=h(()=>{"use strict";REo={Description:"description",Subtitle:"subtitle"}});var M7c=h(()=>{"use strict"});var L7c=h(()=>{"use strict"});var _7c=h(()=>{"use strict"});var U7c=h(()=>{"use strict"});var V7c=h(()=>{"use strict"});var G7c=h(()=>{"use strict"});var q7c=h(()=>{"use strict"});var W7c=h(()=>{"use strict"});var kEo,H7c=h(()=>{"use strict";kEo={Default:"default",Toggle:"toggle",Tabs:"tabs"}});var FEo,K7c=h(()=>{"use strict";FEo={Typescript:"typescript",Javascript:"javascript",Python:"python",Java:"java",Go:"go",Ruby:"ruby",Csharp:"csharp",Php:"php",Swift:"swift",Rust:"rust",Nodets:"nodets",Nodejs:"nodejs",Dotnet:"dotnet",Curl:"curl",Jvm:"jvm",Ts:"ts",Js:"js"}});var J7c=h(()=>{"use strict"});var Y7c=h(()=>{"use strict"});var X7c=h(()=>{"use strict"});var Z7c=h(()=>{"use strict"});var $7c=h(()=>{"use strict"});var NEo,eHc=h(()=>{"use strict";NEo={Header:"header",HeaderTabs:"header-tabs",Sidebar:"sidebar"}});var tHc=h(()=>{"use strict"});var rHc=h(()=>{"use strict"});var nHc=h(()=>{"use strict"});var jEo,iHc=h(()=>{"use strict";jEo={Default:"default",Minimal:"minimal"}});var oHc=h(()=>{"use strict"});var sHc=h(()=>{"use strict"});var aHc=h(()=>{"use strict"});var cHc=h(()=>{"use strict"});var lHc=h(()=>{"use strict"});var uHc=h(()=>{"use strict"});var zEo,pHc=h(()=>{"use strict";zEo={Unset:"unset",Stable:"stable",GenerallyAvailable:"generally-available",InDevelopment:"in-development",PreRelease:"pre-release",Deprecated:"deprecated",Beta:"beta",Alpha:"alpha",Preview:"preview",Legacy:"legacy"}});var QEo,fHc=h(()=>{"use strict";QEo={Header:"header",Sidebar:"sidebar"}});var dHc=h(()=>{"use strict"});var mHc=h(()=>{"use strict"});var hHc=h(()=>{"use strict"});var gHc=h(()=>{"use strict"});var AHc=h(()=>{"use strict"});var yHc=h(()=>{"use strict"});var MEo,bHc=h(()=>{"use strict";MEo={Left:"left",Center:"center"}});var LEo,EHc=h(()=>{"use strict";LEo={Header:"header",Sidebar:"sidebar"}});var IHc=h(()=>{"use strict"});var vHc=h(()=>{"use strict"});var _Eo,CHc=h(()=>{"use strict";_Eo={Default:"default",Bubble:"bubble"}});var xHc=h(()=>{"use strict"});var UEo,SHc=h(()=>{"use strict";UEo={Blank:"_blank",Self:"_self",Parent:"_parent",Top:"_top"}});var wHc=h(()=>{"use strict"});var VEo,THc=h(()=>{"use strict";VEo={Frontmatter:"frontmatter",Filename:"filename"}});var OHc=h(()=>{"use strict"});var PHc=h(()=>{"use strict"});var GEo,BHc=h(()=>{"use strict";GEo={Summary:"summary",SummaryLargeImage:"summary_large_image",App:"app",Player:"player"}});var DHc=h(()=>{"use strict"});var qEo,RHc=h(()=>{"use strict";qEo={Deprecated:"deprecated",Legacy:"legacy",Ga:"ga",Stable:"stable",Beta:"beta",Alpha:"alpha",Preview:"preview"}});var kHc=h(()=>{"use strict"});var FHc=h(()=>{"use strict"});var NHc=h(()=>{"use strict"});var WEo,jHc=h(()=>{"use strict";WEo={Flat:"flat",Grouped:"grouped"}});var zHc=h(()=>{"use strict"});var QHc=h(()=>{"use strict"});var MHc=h(()=>{"use strict"});var HEo=h(()=>{"use strict";Oqc();Pqc();Bqc();Dqc();Rqc();kqc();Fqc();Nqc();jqc();zqc();Qqc();Mqc();Lqc();_qc();Uqc();Vqc();Gqc();qqc();Wqc();Hqc();Kqc();Jqc();Yqc();Xqc();Zqc();$qc();eWc();tWc();rWc();nWc();iWc();oWc();sWc();aWc();cWc();lWc();uWc();pWc();fWc();dWc();mWc();hWc();gWc();AWc();yWc();bWc();EWc();IWc();vWc();CWc();xWc();SWc();wWc();TWc();OWc();PWc();BWc();DWc();RWc();kWc();FWc();NWc();jWc();zWc();QWc();MWc();LWc();_Wc();UWc();VWc();GWc();qWc();WWc();HWc();KWc();JWc();YWc();XWc();ZWc();$Wc();e7c();t7c();r7c();n7c();i7c();o7c();s7c();a7c();c7c();l7c();u7c();p7c();f7c();d7c();m7c();h7c();g7c();A7c();y7c();b7c();E7c();I7c();v7c();C7c();x7c();S7c();w7c();T7c();O7c();P7c();B7c();D7c();R7c();k7c();F7c();N7c();j7c();z7c();Q7c();M7c();L7c();_7c();U7c();V7c();G7c();q7c();W7c();H7c();K7c();J7c();Y7c();X7c();Z7c();$7c();eHc();tHc();rHc();nHc();iHc();oHc();sHc();aHc();cHc();lHc();uHc();pHc();fHc();dHc();mHc();hHc();gHc();AHc();yHc();bHc();EHc();IHc();vHc();CHc();xHc();SHc();wHc();THc();OHc();PHc();BHc();DHc();RHc();kHc();FHc();NHc();jHc();zHc();QHc();MHc()});var Hkr={};ne(Hkr,{AiChatLocation:()=>oEo,AiChatModel:()=>sEo,ApiReferenceLayout:()=>aEo,ApiSpecErrorResponseApplyTo:()=>cEo,ApiSpecErrorResponseHttpMethod:()=>lEo,ApiSpecType:()=>uEo,Availability:()=>pEo,BodyThemeConfig:()=>fEo,ChangelogLayout:()=>dEo,CheckRuleSeverity:()=>mEo,CodeBlockTheme:()=>hEo,CollapsedStringValue:()=>gEo,ContentAlignment:()=>AEo,EditThisPageLaunch:()=>yEo,FontDisplay:()=>bEo,FontStyle:()=>EEo,FooterNavThemeConfig:()=>IEo,HeaderPosition:()=>vEo,HttpSnippetLanguage:()=>CEo,JsScriptStrategy:()=>xEo,LanguageSwitcherThemeConfig:()=>SEo,LibraryLanguage:()=>wEo,LibraryOrganizeBy:()=>TEo,LibrarySlugStyle:()=>OEo,OgDynamicLogoColor:()=>PEo,PageActionOption:()=>BEo,PageActionsThemeConfig:()=>DEo,PageDescriptionSource:()=>REo,ProductSwitcherThemeConfig:()=>kEo,ProgrammingLanguage:()=>FEo,SearchbarPlacement:()=>NEo,SidebarThemeConfig:()=>jEo,SortByAvailabilityValue:()=>zEo,SwitcherPlacement:()=>QEo,TabsAlignment:()=>MEo,TabsPlacement:()=>LEo,TabsThemeStyle:()=>_Eo,Target:()=>UEo,TitleSource:()=>VEo,TwitterCardSetting:()=>GEo,VersionAvailability:()=>qEo,WebSocketOneofDisplay:()=>WEo});var LHc=h(()=>{"use strict";HEo()});var _Hc=h(()=>{"use strict";LHc();HEo()});var KEo={};ne(KEo,{AiChatLocation:()=>oEo,AiChatModel:()=>sEo,ApiReferenceLayout:()=>aEo,ApiSpecErrorResponseApplyTo:()=>cEo,ApiSpecErrorResponseHttpMethod:()=>lEo,ApiSpecType:()=>uEo,Availability:()=>pEo,BodyThemeConfig:()=>fEo,ChangelogLayout:()=>dEo,CheckRuleSeverity:()=>mEo,CodeBlockTheme:()=>hEo,CollapsedStringValue:()=>gEo,ContentAlignment:()=>AEo,EditThisPageLaunch:()=>yEo,FontDisplay:()=>bEo,FontStyle:()=>EEo,FooterNavThemeConfig:()=>IEo,HeaderPosition:()=>vEo,HttpSnippetLanguage:()=>CEo,JsScriptStrategy:()=>xEo,LanguageSwitcherThemeConfig:()=>SEo,LibraryLanguage:()=>wEo,LibraryOrganizeBy:()=>TEo,LibrarySlugStyle:()=>OEo,OgDynamicLogoColor:()=>PEo,PageActionOption:()=>BEo,PageActionsThemeConfig:()=>DEo,PageDescriptionSource:()=>REo,ProductSwitcherThemeConfig:()=>kEo,ProgrammingLanguage:()=>FEo,SearchbarPlacement:()=>NEo,SidebarThemeConfig:()=>jEo,SortByAvailabilityValue:()=>zEo,SwitcherPlacement:()=>QEo,TabsAlignment:()=>MEo,TabsPlacement:()=>LEo,TabsThemeStyle:()=>_Eo,Target:()=>UEo,TitleSource:()=>VEo,TwitterCardSetting:()=>GEo,VersionAvailability:()=>qEo,WebSocketOneofDisplay:()=>WEo,docs:()=>Hkr});var JEo=h(()=>{"use strict";_Hc()});var UHc,VHc=h(()=>{"use strict";UHc=(e,t,r)=>JSON.stringify(e,t,r)});function sLd({message:e,statusCode:t,body:r}){let n=[];return e!=null&&n.push(e),t!=null&&n.push(`Status code: ${t.toString()}`),r!=null&&n.push(`Body: ${UHc(r,void 0,2)}`),n.join(`
|
|
239
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){o(s);continue}if(e.external){let l=e.external.registry.get(s[0])?.id;if(t!==s[0]&&l){o(s);continue}}if(e.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}if(a.count>1&&e.reused==="ref"){o(s);continue}}}function uve(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=s=>{let a=e.seen.get(s);if(a.ref===null)return;let c=a.def??a.schema,l={...c},u=a.ref;if(a.ref=null,u){n(u);let d=e.seen.get(u),f=d.schema;if(f.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(f)):Object.assign(c,f),Object.assign(c,l),s._zod.parent===u)for(let g in c)g==="$ref"||g==="allOf"||g in l||delete c[g];if(f.$ref&&d.def)for(let g in c)g==="$ref"||g==="allOf"||g in d.def&&JSON.stringify(c[g])===JSON.stringify(d.def[g])&&delete c[g]}let p=s._zod.parent;if(p&&p!==u){n(p);let d=e.seen.get(p);if(d?.schema.$ref&&(c.$ref=d.schema.$ref,d.def))for(let f in c)f==="$ref"||f==="allOf"||f in d.def&&JSON.stringify(c[f])===JSON.stringify(d.def[f])&&delete c[f]}e.override({zodSchema:s,jsonSchema:c,path:a.path??[]})};for(let s of[...e.seen.entries()].reverse())n(s[0]);let i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(s)}Object.assign(i,r.def??r.schema);let o=e.external?.defs??{};for(let s of e.seen.entries()){let a=s[1];a.def&&a.defId&&(o[a.defId]=a.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{let s=JSON.parse(JSON.stringify(i));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ftt(t,"input",e.processors),output:Ftt(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function LF(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return LF(n.element,r);if(n.type==="set")return LF(n.valueType,r);if(n.type==="lazy")return LF(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return LF(n.innerType,r);if(n.type==="intersection")return LF(n.left,r)||LF(n.right,r);if(n.type==="record"||n.type==="map")return LF(n.keyType,r)||LF(n.valueType,r);if(n.type==="pipe")return LF(n.in,r)||LF(n.out,r);if(n.type==="object"){for(let i in n.shape)if(LF(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(LF(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(LF(i,r))return!0;return!!(n.rest&&LF(n.rest,r))}return!1}var HAo,Ftt,i6t=h(()=>{"use strict";t6t();HAo=(e,t={})=>r=>{let n=cve({...r,processors:t});return Wh(e,n),lve(n,e),uve(n,e)},Ftt=(e,t,r={})=>n=>{let{libraryOptions:i,target:o}=n??{},s=cve({...i??{},target:o,io:t,processors:r});return Wh(e,s),lve(s,e),uve(s,e)}});function ikr(e,t){if("_idmap"in e){let n=e,i=cve({...t,processors:tkr}),o={};for(let c of n._idmap.entries()){let[l,u]=c;Wh(u,i)}let s={},a={registry:n,uri:t?.uri,defs:o};i.external=a;for(let c of n._idmap.entries()){let[l,u]=c;lve(i,u),s[l]=uve(i,u)}if(Object.keys(o).length>0){let c=i.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:o}}return{schemas:s}}let r=cve({...t,processors:tkr});return Wh(e,r),lve(r,e),uve(r,e)}var NMd,KAo,JAo,YAo,XAo,ZAo,$Ao,eyo,tyo,ryo,nyo,iyo,oyo,syo,ayo,cyo,lyo,uyo,pyo,fyo,dyo,myo,hyo,gyo,Ayo,yyo,rkr,byo,Eyo,Iyo,vyo,Cyo,xyo,Syo,wyo,Tyo,Oyo,Pyo,nkr,Byo,tkr,o6t=h(()=>{"use strict";i6t();Va();NMd={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},KAo=(e,t,r,n)=>{let i=r;i.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof s=="number"&&(i.maxLength=s),a&&(i.format=NMd[a]??a,i.format===""&&delete i.format,a==="time"&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let u=[...c];u.length===1?i.pattern=u[0].source:u.length>1&&(i.allOf=[...u.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},JAo=(e,t,r,n)=>{let i=r,{minimum:o,maximum:s,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof a=="string"&&a.includes("int")?i.type="integer":i.type="number",typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof o=="number"&&(i.minimum=o,typeof u=="number"&&t.target!=="draft-04"&&(u>=o?delete i.minimum:delete i.exclusiveMinimum)),typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof s=="number"&&(i.maximum=s,typeof l=="number"&&t.target!=="draft-04"&&(l<=s?delete i.maximum:delete i.exclusiveMaximum)),typeof c=="number"&&(i.multipleOf=c)},YAo=(e,t,r,n)=>{r.type="boolean"},XAo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},ZAo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},$Ao=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},eyo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},tyo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},ryo=(e,t,r,n)=>{r.not={}},nyo=(e,t,r,n)=>{},iyo=(e,t,r,n)=>{},oyo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},syo=(e,t,r,n)=>{let i=e._zod.def,o=MLt(i.entries);o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o},ayo=(e,t,r,n)=>{let i=e._zod.def,o=[];for(let s of i.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),o.every(s=>typeof s=="boolean")&&(r.type="boolean"),o.every(s=>s===null)&&(r.type="null"),r.enum=o},cyo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},lyo=(e,t,r,n)=>{let i=r,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=o.source},uyo=(e,t,r,n)=>{let i=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:c}=e._zod.bag;s!==void 0&&(o.minLength=s),a!==void 0&&(o.maxLength=a),c?c.length===1?(o.contentMediaType=c[0],Object.assign(i,o)):(Object.assign(i,o),i.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(i,o)},pyo=(e,t,r,n)=>{r.type="boolean"},fyo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},dyo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},myo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},hyo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},gyo=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Ayo=(e,t,r,n)=>{let i=r,o=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;typeof s=="number"&&(i.minItems=s),typeof a=="number"&&(i.maxItems=a),i.type="array",i.items=Wh(o.element,t,{...n,path:[...n.path,"items"]})},yyo=(e,t,r,n)=>{let i=r,o=e._zod.def;i.type="object",i.properties={};let s=o.shape;for(let l in s)i.properties[l]=Wh(s[l],t,{...n,path:[...n.path,"properties",l]});let a=new Set(Object.keys(s)),c=new Set([...a].filter(l=>{let u=o.shape[l]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(i.required=Array.from(c)),o.catchall?._zod.def.type==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=Wh(o.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},rkr=(e,t,r,n)=>{let i=e._zod.def,o=i.inclusive===!1,s=i.options.map((a,c)=>Wh(a,t,{...n,path:[...n.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=s:r.anyOf=s},byo=(e,t,r,n)=>{let i=e._zod.def,o=Wh(i.left,t,{...n,path:[...n.path,"allOf",0]}),s=Wh(i.right,t,{...n,path:[...n.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];r.allOf=c},Eyo=(e,t,r,n)=>{let i=r,o=e._zod.def;i.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((d,f)=>Wh(d,t,{...n,path:[...n.path,s,f]})),l=o.rest?Wh(o.rest,t,{...n,path:[...n.path,a,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null;t.target==="draft-2020-12"?(i.prefixItems=c,l&&(i.items=l)):t.target==="openapi-3.0"?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:p}=e._zod.bag;typeof u=="number"&&(i.minItems=u),typeof p=="number"&&(i.maxItems=p)},Iyo=(e,t,r,n)=>{let i=r,o=e._zod.def;i.type="object";let s=o.keyType,c=s._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){let u=Wh(o.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(let p of c)i.patternProperties[p.source]=u}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=Wh(o.keyType,t,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=Wh(o.valueType,t,{...n,path:[...n.path,"additionalProperties"]});let l=s._zod.values;if(l){let u=[...l].filter(p=>typeof p=="string"||typeof p=="number");u.length>0&&(i.required=u)}},vyo=(e,t,r,n)=>{let i=e._zod.def,o=Wh(i.innerType,t,n),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=i.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},Cyo=(e,t,r,n)=>{let i=e._zod.def;Wh(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType},xyo=(e,t,r,n)=>{let i=e._zod.def;Wh(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},Syo=(e,t,r,n)=>{let i=e._zod.def;Wh(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},wyo=(e,t,r,n)=>{let i=e._zod.def;Wh(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType;let s;try{s=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},Tyo=(e,t,r,n)=>{let i=e._zod.def,o=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;Wh(o,t,n);let s=t.seen.get(e);s.ref=o},Oyo=(e,t,r,n)=>{let i=e._zod.def;Wh(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType,r.readOnly=!0},Pyo=(e,t,r,n)=>{let i=e._zod.def;Wh(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType},nkr=(e,t,r,n)=>{let i=e._zod.def;Wh(i.innerType,t,n);let o=t.seen.get(e);o.ref=i.innerType},Byo=(e,t,r,n)=>{let i=e._zod.innerType;Wh(i,t,n);let o=t.seen.get(e);o.ref=i},tkr={string:KAo,number:JAo,boolean:YAo,bigint:XAo,symbol:ZAo,null:$Ao,undefined:eyo,void:tyo,never:ryo,any:nyo,unknown:iyo,date:oyo,enum:syo,literal:ayo,nan:cyo,template_literal:lyo,file:uyo,success:pyo,custom:fyo,function:dyo,transform:myo,map:hyo,set:gyo,array:Ayo,object:yyo,union:rkr,intersection:byo,tuple:Eyo,record:Iyo,nullable:vyo,nonoptional:Cyo,default:xyo,prefault:Syo,catch:wyo,pipe:Tyo,readonly:Oyo,promise:Pyo,optional:nkr,lazy:Byo}});var okr,V5c=h(()=>{"use strict";o6t();i6t();okr=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=cve({processors:tkr,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return Wh(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),lve(this.ctx,t);let n=uve(this.ctx,t),{"~standard":i,...o}=n;return o}}});var G5c={};var q5c=h(()=>{"use strict"});var Tfe={};ne(Tfe,{$ZodAny:()=>Cgo,$ZodArray:()=>Ogo,$ZodAsyncError:()=>vH,$ZodBase64:()=>dgo,$ZodBase64URL:()=>mgo,$ZodBigInt:()=>vRr,$ZodBigIntFormat:()=>bgo,$ZodBoolean:()=>YLt,$ZodCIDRv4:()=>ugo,$ZodCIDRv6:()=>pgo,$ZodCUID:()=>Zho,$ZodCUID2:()=>$ho,$ZodCatch:()=>Wgo,$ZodCheck:()=>zA,$ZodCheckBigIntFormat:()=>who,$ZodCheckEndsWith:()=>Qho,$ZodCheckGreaterThan:()=>mRr,$ZodCheckIncludes:()=>jho,$ZodCheckLengthEquals:()=>Rho,$ZodCheckLessThan:()=>dRr,$ZodCheckLowerCase:()=>Fho,$ZodCheckMaxLength:()=>Bho,$ZodCheckMaxSize:()=>Tho,$ZodCheckMimeType:()=>Lho,$ZodCheckMinLength:()=>Dho,$ZodCheckMinSize:()=>Oho,$ZodCheckMultipleOf:()=>xho,$ZodCheckNumberFormat:()=>Sho,$ZodCheckOverwrite:()=>_ho,$ZodCheckProperty:()=>Mho,$ZodCheckRegex:()=>kho,$ZodCheckSizeEquals:()=>Pho,$ZodCheckStartsWith:()=>zho,$ZodCheckStringFormat:()=>btt,$ZodCheckUpperCase:()=>Nho,$ZodCodec:()=>ZLt,$ZodCustom:()=>eAo,$ZodCustomStringFormat:()=>Ago,$ZodDate:()=>Tgo,$ZodDefault:()=>Ugo,$ZodDiscriminatedUnion:()=>Dgo,$ZodE164:()=>hgo,$ZodEmail:()=>Kho,$ZodEmoji:()=>Yho,$ZodEncodeError:()=>tve,$ZodEnum:()=>jgo,$ZodError:()=>GLt,$ZodExactOptional:()=>Lgo,$ZodFile:()=>Qgo,$ZodFunction:()=>Xgo,$ZodGUID:()=>Who,$ZodIPv4:()=>ago,$ZodIPv6:()=>cgo,$ZodISODate:()=>igo,$ZodISODateTime:()=>ngo,$ZodISODuration:()=>sgo,$ZodISOTime:()=>ogo,$ZodIntersection:()=>Rgo,$ZodJWT:()=>ggo,$ZodKSUID:()=>rgo,$ZodLazy:()=>$go,$ZodLiteral:()=>zgo,$ZodMAC:()=>lgo,$ZodMap:()=>Fgo,$ZodNaN:()=>Hgo,$ZodNanoID:()=>Xho,$ZodNever:()=>Sgo,$ZodNonOptional:()=>Ggo,$ZodNull:()=>vgo,$ZodNullable:()=>_go,$ZodNumber:()=>IRr,$ZodNumberFormat:()=>ygo,$ZodObject:()=>XUc,$ZodObjectJIT:()=>Pgo,$ZodOptional:()=>xRr,$ZodPipe:()=>Kgo,$ZodPrefault:()=>Vgo,$ZodPromise:()=>Zgo,$ZodReadonly:()=>Jgo,$ZodRealError:()=>Nz,$ZodRecord:()=>kgo,$ZodRegistry:()=>ORr,$ZodSet:()=>Ngo,$ZodString:()=>A6e,$ZodStringFormat:()=>uA,$ZodSuccess:()=>qgo,$ZodSymbol:()=>Ego,$ZodTemplateLiteral:()=>Ygo,$ZodTransform:()=>Mgo,$ZodTuple:()=>CRr,$ZodType:()=>Jl,$ZodULID:()=>ego,$ZodURL:()=>Jho,$ZodUUID:()=>Hho,$ZodUndefined:()=>Igo,$ZodUnion:()=>XLt,$ZodUnknown:()=>xgo,$ZodVoid:()=>wgo,$ZodXID:()=>tgo,$ZodXor:()=>Bgo,$brand:()=>XDr,$constructor:()=>Cr,$input:()=>aAo,$output:()=>sAo,Doc:()=>JLt,JSONSchema:()=>G5c,JSONSchemaGenerator:()=>okr,NEVER:()=>kmo,TimePrecision:()=>pAo,_any:()=>RAo,_array:()=>MAo,_base64:()=>WRr,_base64url:()=>HRr,_bigint:()=>SAo,_boolean:()=>CAo,_catch:()=>PMd,_check:()=>_5c,_cidrv4:()=>GRr,_cidrv6:()=>qRr,_coercedBigint:()=>wAo,_coercedBoolean:()=>xAo,_coercedDate:()=>zAo,_coercedNumber:()=>AAo,_coercedString:()=>lAo,_cuid:()=>zRr,_cuid2:()=>QRr,_custom:()=>_Ao,_date:()=>jAo,_decode:()=>nRr,_decodeAsync:()=>oRr,_default:()=>wMd,_discriminatedUnion:()=>mMd,_e164:()=>KRr,_email:()=>BRr,_emoji:()=>NRr,_encode:()=>rRr,_encodeAsync:()=>iRr,_endsWith:()=>wtt,_enum:()=>EMd,_file:()=>LAo,_float32:()=>bAo,_float64:()=>EAo,_gt:()=>hee,_gte:()=>MF,_guid:()=>r6t,_includes:()=>xtt,_int:()=>yAo,_int32:()=>IAo,_int64:()=>TAo,_intersection:()=>hMd,_ipv4:()=>URr,_ipv6:()=>VRr,_isoDate:()=>dAo,_isoDateTime:()=>fAo,_isoDuration:()=>hAo,_isoTime:()=>mAo,_jwt:()=>JRr,_ksuid:()=>_Rr,_lazy:()=>kMd,_length:()=>E6e,_literal:()=>vMd,_lowercase:()=>vtt,_lt:()=>mee,_lte:()=>H6,_mac:()=>uAo,_map:()=>yMd,_max:()=>H6,_maxLength:()=>b6e,_maxSize:()=>ave,_mime:()=>Ttt,_min:()=>MF,_minLength:()=>wfe,_minSize:()=>gee,_multipleOf:()=>sve,_nan:()=>QAo,_nanoid:()=>jRr,_nativeEnum:()=>IMd,_negative:()=>XRr,_never:()=>FAo,_nonnegative:()=>$Rr,_nonoptional:()=>TMd,_nonpositive:()=>ZRr,_normalize:()=>Ott,_null:()=>DAo,_nullable:()=>SMd,_number:()=>gAo,_optional:()=>xMd,_overwrite:()=>CH,_parse:()=>htt,_parseAsync:()=>gtt,_pipe:()=>BMd,_positive:()=>YRr,_promise:()=>FMd,_property:()=>ekr,_readonly:()=>DMd,_record:()=>AMd,_refine:()=>UAo,_regex:()=>Itt,_safeDecode:()=>aRr,_safeDecodeAsync:()=>lRr,_safeEncode:()=>sRr,_safeEncodeAsync:()=>cRr,_safeParse:()=>Att,_safeParseAsync:()=>ytt,_set:()=>bMd,_size:()=>y6e,_slugify:()=>Rtt,_startsWith:()=>Stt,_string:()=>cAo,_stringFormat:()=>ktt,_stringbool:()=>WAo,_success:()=>OMd,_superRefine:()=>VAo,_symbol:()=>PAo,_templateLiteral:()=>RMd,_toLowerCase:()=>Btt,_toUpperCase:()=>Dtt,_transform:()=>CMd,_trim:()=>Ptt,_tuple:()=>gMd,_uint32:()=>vAo,_uint64:()=>OAo,_ulid:()=>MRr,_undefined:()=>BAo,_union:()=>fMd,_unknown:()=>kAo,_uppercase:()=>Ctt,_url:()=>n6t,_uuid:()=>DRr,_uuidv4:()=>RRr,_uuidv6:()=>kRr,_uuidv7:()=>FRr,_void:()=>NAo,_xid:()=>LRr,_xor:()=>dMd,clone:()=>QF,config:()=>GI,createStandardJSONSchemaMethod:()=>Ftt,createToJSONSchemaMethod:()=>HAo,decode:()=>zzd,decodeAsync:()=>Mzd,describe:()=>GAo,encode:()=>jzd,encodeAsync:()=>Qzd,extractDefs:()=>lve,finalize:()=>uve,flattenError:()=>qLt,formatError:()=>WLt,globalConfig:()=>zLt,globalRegistry:()=>RP,initializeContext:()=>cve,isValidBase64:()=>fgo,isValidBase64URL:()=>HUc,isValidJWT:()=>KUc,locales:()=>e6t,meta:()=>qAo,parse:()=>eRr,parseAsync:()=>tRr,prettifyError:()=>qmo,process:()=>Wh,regexes:()=>NV,registry:()=>PRr,safeDecode:()=>_zd,safeDecodeAsync:()=>Vzd,safeEncode:()=>Lzd,safeEncodeAsync:()=>Uzd,safeParse:()=>Hmo,safeParseAsync:()=>Kmo,toDotPath:()=>PUc,toJSONSchema:()=>ikr,treeifyError:()=>Gmo,util:()=>vi,version:()=>Vho});var jz=h(()=>{"use strict";ptt();Jmo();Wmo();tAo();hRr();Gho();Va();fRr();oAo();t6t();Uho();U5c();i6t();o6t();V5c();q5c()});var skr={};ne(skr,{endsWith:()=>wtt,gt:()=>hee,gte:()=>MF,includes:()=>xtt,length:()=>E6e,lowercase:()=>vtt,lt:()=>mee,lte:()=>H6,maxLength:()=>b6e,maxSize:()=>ave,mime:()=>Ttt,minLength:()=>wfe,minSize:()=>gee,multipleOf:()=>sve,negative:()=>XRr,nonnegative:()=>$Rr,nonpositive:()=>ZRr,normalize:()=>Ott,overwrite:()=>CH,positive:()=>YRr,property:()=>ekr,regex:()=>Itt,size:()=>y6e,slugify:()=>Rtt,startsWith:()=>Stt,toLowerCase:()=>Btt,toUpperCase:()=>Dtt,trim:()=>Ptt,uppercase:()=>Ctt});var akr=h(()=>{"use strict";jz()});var Ntt={};ne(Ntt,{ZodISODate:()=>lkr,ZodISODateTime:()=>ckr,ZodISODuration:()=>pkr,ZodISOTime:()=>ukr,date:()=>Ryo,datetime:()=>Dyo,duration:()=>Fyo,time:()=>kyo});function Dyo(e){return fAo(ckr,e)}function Ryo(e){return dAo(lkr,e)}function kyo(e){return mAo(ukr,e)}function Fyo(e){return hAo(pkr,e)}var ckr,lkr,ukr,pkr,s6t=h(()=>{"use strict";jz();c6t();ckr=Cr("ZodISODateTime",(e,t)=>{ngo.init(e,t),pA.init(e,t)});lkr=Cr("ZodISODate",(e,t)=>{igo.init(e,t),pA.init(e,t)});ukr=Cr("ZodISOTime",(e,t)=>{ogo.init(e,t),pA.init(e,t)});pkr=Cr("ZodISODuration",(e,t)=>{sgo.init(e,t),pA.init(e,t)})});var W5c,zMd,zz,Nyo=h(()=>{"use strict";jz();jz();Va();W5c=(e,t)=>{GLt.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>WLt(e,r)},flatten:{value:r=>qLt(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,ftt,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,ftt,2)}},isEmpty:{get(){return e.issues.length===0}}})},zMd=Cr("ZodError",W5c),zz=Cr("ZodError",W5c,{Parent:Error})});var jyo,zyo,Qyo,Myo,Lyo,_yo,Uyo,Vyo,Gyo,qyo,Wyo,Hyo,Kyo=h(()=>{"use strict";jz();Nyo();jyo=htt(zz),zyo=gtt(zz),Qyo=Att(zz),Myo=ytt(zz),Lyo=rRr(zz),_yo=nRr(zz),Uyo=iRr(zz),Vyo=oRr(zz),Gyo=sRr(zz),qyo=aRr(zz),Wyo=cRr(zz),Hyo=lRr(zz)});var a6t={};ne(a6t,{ZodAny:()=>rbo,ZodArray:()=>sbo,ZodBase64:()=>Tkr,ZodBase64URL:()=>Okr,ZodBigInt:()=>_tt,ZodBigIntFormat:()=>Dkr,ZodBoolean:()=>Ltt,ZodCIDRv4:()=>Skr,ZodCIDRv6:()=>wkr,ZodCUID:()=>ykr,ZodCUID2:()=>bkr,ZodCatch:()=>Obo,ZodCodec:()=>Mkr,ZodCustom:()=>b6t,ZodCustomStringFormat:()=>Qtt,ZodDate:()=>m6t,ZodDefault:()=>vbo,ZodDiscriminatedUnion:()=>cbo,ZodE164:()=>Pkr,ZodEmail:()=>hkr,ZodEmoji:()=>gkr,ZodEnum:()=>jtt,ZodExactOptional:()=>bbo,ZodFile:()=>Abo,ZodFunction:()=>zbo,ZodGUID:()=>l6t,ZodIPv4:()=>Ckr,ZodIPv6:()=>xkr,ZodIntersection:()=>lbo,ZodJWT:()=>Bkr,ZodKSUID:()=>vkr,ZodLazy:()=>Fbo,ZodLiteral:()=>gbo,ZodMAC:()=>Jyo,ZodMap:()=>mbo,ZodNaN:()=>Bbo,ZodNanoID:()=>Akr,ZodNever:()=>ibo,ZodNonOptional:()=>zkr,ZodNull:()=>ebo,ZodNullable:()=>Ibo,ZodNumber:()=>Mtt,ZodNumberFormat:()=>v6e,ZodObject:()=>g6t,ZodOptional:()=>jkr,ZodPipe:()=>Qkr,ZodPrefault:()=>xbo,ZodPromise:()=>jbo,ZodReadonly:()=>Dbo,ZodRecord:()=>y6t,ZodSet:()=>hbo,ZodString:()=>ztt,ZodStringFormat:()=>pA,ZodSuccess:()=>Tbo,ZodSymbol:()=>Zyo,ZodTemplateLiteral:()=>kbo,ZodTransform:()=>ybo,ZodTuple:()=>pbo,ZodType:()=>cp,ZodULID:()=>Ekr,ZodURL:()=>d6t,ZodUUID:()=>Aee,ZodUndefined:()=>$yo,ZodUnion:()=>A6t,ZodUnknown:()=>nbo,ZodVoid:()=>obo,ZodXID:()=>Ikr,ZodXor:()=>abo,_ZodString:()=>mkr,_default:()=>Cbo,_function:()=>Z8c,any:()=>B8c,array:()=>h6t,base64:()=>d8c,base64url:()=>m8c,bigint:()=>S8c,boolean:()=>Xyo,catch:()=>Pbo,check:()=>$8c,cidrv4:()=>p8c,cidrv6:()=>f8c,codec:()=>J8c,cuid:()=>n8c,cuid2:()=>i8c,custom:()=>eGc,date:()=>R8c,describe:()=>tGc,discriminatedUnion:()=>Q8c,e164:()=>h8c,email:()=>H5c,emoji:()=>t8c,enum:()=>Fkr,exactOptional:()=>Ebo,file:()=>q8c,float32:()=>I8c,float64:()=>v8c,function:()=>Z8c,guid:()=>K5c,hash:()=>E8c,hex:()=>b8c,hostname:()=>y8c,httpUrl:()=>e8c,instanceof:()=>nGc,int:()=>dkr,int32:()=>C8c,int64:()=>w8c,intersection:()=>ubo,ipv4:()=>c8c,ipv6:()=>u8c,json:()=>oGc,jwt:()=>g8c,keyof:()=>k8c,ksuid:()=>a8c,lazy:()=>Nbo,literal:()=>G8c,looseObject:()=>j8c,looseRecord:()=>L8c,mac:()=>l8c,map:()=>_8c,meta:()=>rGc,nan:()=>K8c,nanoid:()=>r8c,nativeEnum:()=>V8c,never:()=>Rkr,nonoptional:()=>wbo,null:()=>tbo,nullable:()=>p6t,nullish:()=>W8c,number:()=>Yyo,object:()=>F8c,optional:()=>u6t,partialRecord:()=>M8c,pipe:()=>f6t,prefault:()=>Sbo,preprocess:()=>sGc,promise:()=>X8c,readonly:()=>Rbo,record:()=>dbo,refine:()=>Qbo,set:()=>U8c,strictObject:()=>N8c,string:()=>fkr,stringFormat:()=>A8c,stringbool:()=>iGc,success:()=>H8c,superRefine:()=>Mbo,symbol:()=>O8c,templateLiteral:()=>Y8c,transform:()=>Nkr,tuple:()=>fbo,uint32:()=>x8c,uint64:()=>T8c,ulid:()=>o8c,undefined:()=>P8c,union:()=>kkr,unknown:()=>I6e,url:()=>$5c,uuid:()=>J5c,uuidv4:()=>Y5c,uuidv6:()=>X5c,uuidv7:()=>Z5c,void:()=>D8c,xid:()=>s8c,xor:()=>z8c});function fkr(e){return cAo(ztt,e)}function H5c(e){return BRr(hkr,e)}function K5c(e){return r6t(l6t,e)}function J5c(e){return DRr(Aee,e)}function Y5c(e){return RRr(Aee,e)}function X5c(e){return kRr(Aee,e)}function Z5c(e){return FRr(Aee,e)}function $5c(e){return n6t(d6t,e)}function e8c(e){return n6t(d6t,{protocol:/^https?$/,hostname:NV.domain,...vi.normalizeParams(e)})}function t8c(e){return NRr(gkr,e)}function r8c(e){return jRr(Akr,e)}function n8c(e){return zRr(ykr,e)}function i8c(e){return QRr(bkr,e)}function o8c(e){return MRr(Ekr,e)}function s8c(e){return LRr(Ikr,e)}function a8c(e){return _Rr(vkr,e)}function c8c(e){return URr(Ckr,e)}function l8c(e){return uAo(Jyo,e)}function u8c(e){return VRr(xkr,e)}function p8c(e){return GRr(Skr,e)}function f8c(e){return qRr(wkr,e)}function d8c(e){return WRr(Tkr,e)}function m8c(e){return HRr(Okr,e)}function h8c(e){return KRr(Pkr,e)}function g8c(e){return JRr(Bkr,e)}function A8c(e,t,r={}){return ktt(Qtt,e,t,r)}function y8c(e){return ktt(Qtt,"hostname",NV.hostname,e)}function b8c(e){return ktt(Qtt,"hex",NV.hex,e)}function E8c(e,t){let r=t?.enc??"hex",n=`${e}_${r}`,i=NV[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return ktt(Qtt,n,i,t)}function Yyo(e){return gAo(Mtt,e)}function dkr(e){return yAo(v6e,e)}function I8c(e){return bAo(v6e,e)}function v8c(e){return EAo(v6e,e)}function C8c(e){return IAo(v6e,e)}function x8c(e){return vAo(v6e,e)}function Xyo(e){return CAo(Ltt,e)}function S8c(e){return SAo(_tt,e)}function w8c(e){return TAo(Dkr,e)}function T8c(e){return OAo(Dkr,e)}function O8c(e){return PAo(Zyo,e)}function P8c(e){return BAo($yo,e)}function tbo(e){return DAo(ebo,e)}function B8c(){return RAo(rbo)}function I6e(){return kAo(nbo)}function Rkr(e){return FAo(ibo,e)}function D8c(e){return NAo(obo,e)}function R8c(e){return jAo(m6t,e)}function h6t(e,t){return MAo(sbo,e,t)}function k8c(e){let t=e._zod.def.shape;return Fkr(Object.keys(t))}function F8c(e,t){let r={type:"object",shape:e??{},...vi.normalizeParams(t)};return new g6t(r)}function N8c(e,t){return new g6t({type:"object",shape:e,catchall:Rkr(),...vi.normalizeParams(t)})}function j8c(e,t){return new g6t({type:"object",shape:e,catchall:I6e(),...vi.normalizeParams(t)})}function kkr(e,t){return new A6t({type:"union",options:e,...vi.normalizeParams(t)})}function z8c(e,t){return new abo({type:"union",options:e,inclusive:!1,...vi.normalizeParams(t)})}function Q8c(e,t,r){return new cbo({type:"union",options:t,discriminator:e,...vi.normalizeParams(r)})}function ubo(e,t){return new lbo({type:"intersection",left:e,right:t})}function fbo(e,t,r){let n=t instanceof Jl,i=n?r:t,o=n?t:null;return new pbo({type:"tuple",items:e,rest:o,...vi.normalizeParams(i)})}function dbo(e,t,r){return new y6t({type:"record",keyType:e,valueType:t,...vi.normalizeParams(r)})}function M8c(e,t,r){let n=QF(e);return n._zod.values=void 0,new y6t({type:"record",keyType:n,valueType:t,...vi.normalizeParams(r)})}function L8c(e,t,r){return new y6t({type:"record",keyType:e,valueType:t,mode:"loose",...vi.normalizeParams(r)})}function _8c(e,t,r){return new mbo({type:"map",keyType:e,valueType:t,...vi.normalizeParams(r)})}function U8c(e,t){return new hbo({type:"set",valueType:e,...vi.normalizeParams(t)})}function Fkr(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new jtt({type:"enum",entries:r,...vi.normalizeParams(t)})}function V8c(e,t){return new jtt({type:"enum",entries:e,...vi.normalizeParams(t)})}function G8c(e,t){return new gbo({type:"literal",values:Array.isArray(e)?e:[e],...vi.normalizeParams(t)})}function q8c(e){return LAo(Abo,e)}function Nkr(e){return new ybo({type:"transform",transform:e})}function u6t(e){return new jkr({type:"optional",innerType:e})}function Ebo(e){return new bbo({type:"optional",innerType:e})}function p6t(e){return new Ibo({type:"nullable",innerType:e})}function W8c(e){return u6t(p6t(e))}function Cbo(e,t){return new vbo({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():vi.shallowClone(t)}})}function Sbo(e,t){return new xbo({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():vi.shallowClone(t)}})}function wbo(e,t){return new zkr({type:"nonoptional",innerType:e,...vi.normalizeParams(t)})}function H8c(e){return new Tbo({type:"success",innerType:e})}function Pbo(e,t){return new Obo({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function K8c(e){return QAo(Bbo,e)}function f6t(e,t){return new Qkr({type:"pipe",in:e,out:t})}function J8c(e,t,r){return new Mkr({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function Rbo(e){return new Dbo({type:"readonly",innerType:e})}function Y8c(e,t){return new kbo({type:"template_literal",parts:e,...vi.normalizeParams(t)})}function Nbo(e){return new Fbo({type:"lazy",getter:e})}function X8c(e){return new jbo({type:"promise",innerType:e})}function Z8c(e){return new zbo({type:"function",input:Array.isArray(e?.input)?fbo(e?.input):e?.input??h6t(I6e()),output:e?.output??I6e()})}function $8c(e){let t=new zA({check:"custom"});return t._zod.check=e,t}function eGc(e,t){return _Ao(b6t,e??(()=>!0),t)}function Qbo(e,t={}){return UAo(b6t,e,t)}function Mbo(e){return VAo(e)}function nGc(e,t={}){let r=new b6t({type:"custom",check:"custom",fn:n=>n instanceof e,abort:!0,...vi.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=n=>{n.value instanceof e||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}function oGc(e){let t=Nbo(()=>kkr([fkr(e),Yyo(),Xyo(),tbo(),h6t(t),dbo(fkr(),t)]));return t}function sGc(e,t){return f6t(Nkr(e),t)}var cp,mkr,ztt,pA,hkr,l6t,Aee,d6t,gkr,Akr,ykr,bkr,Ekr,Ikr,vkr,Ckr,Jyo,xkr,Skr,wkr,Tkr,Okr,Pkr,Bkr,Qtt,Mtt,v6e,Ltt,_tt,Dkr,Zyo,$yo,ebo,rbo,nbo,ibo,obo,m6t,sbo,g6t,A6t,abo,cbo,lbo,pbo,y6t,mbo,hbo,jtt,gbo,Abo,ybo,jkr,bbo,Ibo,vbo,xbo,zkr,Tbo,Obo,Bbo,Qkr,Mkr,Dbo,kbo,Fbo,jbo,zbo,b6t,tGc,rGc,iGc,c6t=h(()=>{"use strict";jz();jz();o6t();i6t();akr();s6t();Kyo();cp=Cr("ZodType",(e,t)=>(Jl.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Ftt(e,"input"),output:Ftt(e,"output")}}),e.toJSONSchema=HAo(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(vi.mergeDefs(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(r,n)=>QF(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>jyo(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Qyo(e,r,n),e.parseAsync=async(r,n)=>zyo(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Myo(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>Lyo(e,r,n),e.decode=(r,n)=>_yo(e,r,n),e.encodeAsync=async(r,n)=>Uyo(e,r,n),e.decodeAsync=async(r,n)=>Vyo(e,r,n),e.safeEncode=(r,n)=>Gyo(e,r,n),e.safeDecode=(r,n)=>qyo(e,r,n),e.safeEncodeAsync=async(r,n)=>Wyo(e,r,n),e.safeDecodeAsync=async(r,n)=>Hyo(e,r,n),e.refine=(r,n)=>e.check(Qbo(r,n)),e.superRefine=r=>e.check(Mbo(r)),e.overwrite=r=>e.check(CH(r)),e.optional=()=>u6t(e),e.exactOptional=()=>Ebo(e),e.nullable=()=>p6t(e),e.nullish=()=>u6t(p6t(e)),e.nonoptional=r=>wbo(e,r),e.array=()=>h6t(e),e.or=r=>kkr([e,r]),e.and=r=>ubo(e,r),e.transform=r=>f6t(e,Nkr(r)),e.default=r=>Cbo(e,r),e.prefault=r=>Sbo(e,r),e.catch=r=>Pbo(e,r),e.pipe=r=>f6t(e,r),e.readonly=()=>Rbo(e),e.describe=r=>{let n=e.clone();return RP.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return RP.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return RP.get(e);let n=e.clone();return RP.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),mkr=Cr("_ZodString",(e,t)=>{A6e.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(n,i,o)=>KAo(e,n,i,o);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(Itt(...n)),e.includes=(...n)=>e.check(xtt(...n)),e.startsWith=(...n)=>e.check(Stt(...n)),e.endsWith=(...n)=>e.check(wtt(...n)),e.min=(...n)=>e.check(wfe(...n)),e.max=(...n)=>e.check(b6e(...n)),e.length=(...n)=>e.check(E6e(...n)),e.nonempty=(...n)=>e.check(wfe(1,...n)),e.lowercase=n=>e.check(vtt(n)),e.uppercase=n=>e.check(Ctt(n)),e.trim=()=>e.check(Ptt()),e.normalize=(...n)=>e.check(Ott(...n)),e.toLowerCase=()=>e.check(Btt()),e.toUpperCase=()=>e.check(Dtt()),e.slugify=()=>e.check(Rtt())}),ztt=Cr("ZodString",(e,t)=>{A6e.init(e,t),mkr.init(e,t),e.email=r=>e.check(BRr(hkr,r)),e.url=r=>e.check(n6t(d6t,r)),e.jwt=r=>e.check(JRr(Bkr,r)),e.emoji=r=>e.check(NRr(gkr,r)),e.guid=r=>e.check(r6t(l6t,r)),e.uuid=r=>e.check(DRr(Aee,r)),e.uuidv4=r=>e.check(RRr(Aee,r)),e.uuidv6=r=>e.check(kRr(Aee,r)),e.uuidv7=r=>e.check(FRr(Aee,r)),e.nanoid=r=>e.check(jRr(Akr,r)),e.guid=r=>e.check(r6t(l6t,r)),e.cuid=r=>e.check(zRr(ykr,r)),e.cuid2=r=>e.check(QRr(bkr,r)),e.ulid=r=>e.check(MRr(Ekr,r)),e.base64=r=>e.check(WRr(Tkr,r)),e.base64url=r=>e.check(HRr(Okr,r)),e.xid=r=>e.check(LRr(Ikr,r)),e.ksuid=r=>e.check(_Rr(vkr,r)),e.ipv4=r=>e.check(URr(Ckr,r)),e.ipv6=r=>e.check(VRr(xkr,r)),e.cidrv4=r=>e.check(GRr(Skr,r)),e.cidrv6=r=>e.check(qRr(wkr,r)),e.e164=r=>e.check(KRr(Pkr,r)),e.datetime=r=>e.check(Dyo(r)),e.date=r=>e.check(Ryo(r)),e.time=r=>e.check(kyo(r)),e.duration=r=>e.check(Fyo(r))});pA=Cr("ZodStringFormat",(e,t)=>{uA.init(e,t),mkr.init(e,t)}),hkr=Cr("ZodEmail",(e,t)=>{Kho.init(e,t),pA.init(e,t)});l6t=Cr("ZodGUID",(e,t)=>{Who.init(e,t),pA.init(e,t)});Aee=Cr("ZodUUID",(e,t)=>{Hho.init(e,t),pA.init(e,t)});d6t=Cr("ZodURL",(e,t)=>{Jho.init(e,t),pA.init(e,t)});gkr=Cr("ZodEmoji",(e,t)=>{Yho.init(e,t),pA.init(e,t)});Akr=Cr("ZodNanoID",(e,t)=>{Xho.init(e,t),pA.init(e,t)});ykr=Cr("ZodCUID",(e,t)=>{Zho.init(e,t),pA.init(e,t)});bkr=Cr("ZodCUID2",(e,t)=>{$ho.init(e,t),pA.init(e,t)});Ekr=Cr("ZodULID",(e,t)=>{ego.init(e,t),pA.init(e,t)});Ikr=Cr("ZodXID",(e,t)=>{tgo.init(e,t),pA.init(e,t)});vkr=Cr("ZodKSUID",(e,t)=>{rgo.init(e,t),pA.init(e,t)});Ckr=Cr("ZodIPv4",(e,t)=>{ago.init(e,t),pA.init(e,t)});Jyo=Cr("ZodMAC",(e,t)=>{lgo.init(e,t),pA.init(e,t)});xkr=Cr("ZodIPv6",(e,t)=>{cgo.init(e,t),pA.init(e,t)});Skr=Cr("ZodCIDRv4",(e,t)=>{ugo.init(e,t),pA.init(e,t)});wkr=Cr("ZodCIDRv6",(e,t)=>{pgo.init(e,t),pA.init(e,t)});Tkr=Cr("ZodBase64",(e,t)=>{dgo.init(e,t),pA.init(e,t)});Okr=Cr("ZodBase64URL",(e,t)=>{mgo.init(e,t),pA.init(e,t)});Pkr=Cr("ZodE164",(e,t)=>{hgo.init(e,t),pA.init(e,t)});Bkr=Cr("ZodJWT",(e,t)=>{ggo.init(e,t),pA.init(e,t)});Qtt=Cr("ZodCustomStringFormat",(e,t)=>{Ago.init(e,t),pA.init(e,t)});Mtt=Cr("ZodNumber",(e,t)=>{IRr.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(n,i,o)=>JAo(e,n,i,o),e.gt=(n,i)=>e.check(hee(n,i)),e.gte=(n,i)=>e.check(MF(n,i)),e.min=(n,i)=>e.check(MF(n,i)),e.lt=(n,i)=>e.check(mee(n,i)),e.lte=(n,i)=>e.check(H6(n,i)),e.max=(n,i)=>e.check(H6(n,i)),e.int=n=>e.check(dkr(n)),e.safe=n=>e.check(dkr(n)),e.positive=n=>e.check(hee(0,n)),e.nonnegative=n=>e.check(MF(0,n)),e.negative=n=>e.check(mee(0,n)),e.nonpositive=n=>e.check(H6(0,n)),e.multipleOf=(n,i)=>e.check(sve(n,i)),e.step=(n,i)=>e.check(sve(n,i)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});v6e=Cr("ZodNumberFormat",(e,t)=>{ygo.init(e,t),Mtt.init(e,t)});Ltt=Cr("ZodBoolean",(e,t)=>{YLt.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>YAo(e,r,n,i)});_tt=Cr("ZodBigInt",(e,t)=>{vRr.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(n,i,o)=>XAo(e,n,i,o),e.gte=(n,i)=>e.check(MF(n,i)),e.min=(n,i)=>e.check(MF(n,i)),e.gt=(n,i)=>e.check(hee(n,i)),e.gte=(n,i)=>e.check(MF(n,i)),e.min=(n,i)=>e.check(MF(n,i)),e.lt=(n,i)=>e.check(mee(n,i)),e.lte=(n,i)=>e.check(H6(n,i)),e.max=(n,i)=>e.check(H6(n,i)),e.positive=n=>e.check(hee(BigInt(0),n)),e.negative=n=>e.check(mee(BigInt(0),n)),e.nonpositive=n=>e.check(H6(BigInt(0),n)),e.nonnegative=n=>e.check(MF(BigInt(0),n)),e.multipleOf=(n,i)=>e.check(sve(n,i));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});Dkr=Cr("ZodBigIntFormat",(e,t)=>{bgo.init(e,t),_tt.init(e,t)});Zyo=Cr("ZodSymbol",(e,t)=>{Ego.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>ZAo(e,r,n,i)});$yo=Cr("ZodUndefined",(e,t)=>{Igo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>eyo(e,r,n,i)});ebo=Cr("ZodNull",(e,t)=>{vgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>$Ao(e,r,n,i)});rbo=Cr("ZodAny",(e,t)=>{Cgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>nyo(e,r,n,i)});nbo=Cr("ZodUnknown",(e,t)=>{xgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>iyo(e,r,n,i)});ibo=Cr("ZodNever",(e,t)=>{Sgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>ryo(e,r,n,i)});obo=Cr("ZodVoid",(e,t)=>{wgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>tyo(e,r,n,i)});m6t=Cr("ZodDate",(e,t)=>{Tgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(n,i,o)=>oyo(e,n,i,o),e.min=(n,i)=>e.check(MF(n,i)),e.max=(n,i)=>e.check(H6(n,i));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});sbo=Cr("ZodArray",(e,t)=>{Ogo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Ayo(e,r,n,i),e.element=t.element,e.min=(r,n)=>e.check(wfe(r,n)),e.nonempty=r=>e.check(wfe(1,r)),e.max=(r,n)=>e.check(b6e(r,n)),e.length=(r,n)=>e.check(E6e(r,n)),e.unwrap=()=>e.element});g6t=Cr("ZodObject",(e,t)=>{Pgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>yyo(e,r,n,i),vi.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Fkr(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:I6e()}),e.loose=()=>e.clone({...e._zod.def,catchall:I6e()}),e.strict=()=>e.clone({...e._zod.def,catchall:Rkr()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>vi.extend(e,r),e.safeExtend=r=>vi.safeExtend(e,r),e.merge=r=>vi.merge(e,r),e.pick=r=>vi.pick(e,r),e.omit=r=>vi.omit(e,r),e.partial=(...r)=>vi.partial(jkr,e,r[0]),e.required=(...r)=>vi.required(zkr,e,r[0])});A6t=Cr("ZodUnion",(e,t)=>{XLt.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>rkr(e,r,n,i),e.options=t.options});abo=Cr("ZodXor",(e,t)=>{A6t.init(e,t),Bgo.init(e,t),e._zod.processJSONSchema=(r,n,i)=>rkr(e,r,n,i),e.options=t.options});cbo=Cr("ZodDiscriminatedUnion",(e,t)=>{A6t.init(e,t),Dgo.init(e,t)});lbo=Cr("ZodIntersection",(e,t)=>{Rgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>byo(e,r,n,i)});pbo=Cr("ZodTuple",(e,t)=>{CRr.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Eyo(e,r,n,i),e.rest=r=>e.clone({...e._zod.def,rest:r})});y6t=Cr("ZodRecord",(e,t)=>{kgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Iyo(e,r,n,i),e.keyType=t.keyType,e.valueType=t.valueType});mbo=Cr("ZodMap",(e,t)=>{Fgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>hyo(e,r,n,i),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(gee(...r)),e.nonempty=r=>e.check(gee(1,r)),e.max=(...r)=>e.check(ave(...r)),e.size=(...r)=>e.check(y6e(...r))});hbo=Cr("ZodSet",(e,t)=>{Ngo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>gyo(e,r,n,i),e.min=(...r)=>e.check(gee(...r)),e.nonempty=r=>e.check(gee(1,r)),e.max=(...r)=>e.check(ave(...r)),e.size=(...r)=>e.check(y6e(...r))});jtt=Cr("ZodEnum",(e,t)=>{jgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(n,i,o)=>syo(e,n,i,o),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,i)=>{let o={};for(let s of n)if(r.has(s))o[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new jtt({...t,checks:[],...vi.normalizeParams(i),entries:o})},e.exclude=(n,i)=>{let o={...t.entries};for(let s of n)if(r.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new jtt({...t,checks:[],...vi.normalizeParams(i),entries:o})}});gbo=Cr("ZodLiteral",(e,t)=>{zgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>ayo(e,r,n,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});Abo=Cr("ZodFile",(e,t)=>{Qgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>uyo(e,r,n,i),e.min=(r,n)=>e.check(gee(r,n)),e.max=(r,n)=>e.check(ave(r,n)),e.mime=(r,n)=>e.check(Ttt(Array.isArray(r)?r:[r],n))});ybo=Cr("ZodTransform",(e,t)=>{Mgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>myo(e,r,n,i),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new tve(e.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(vi.issue(o,r.value,t));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(vi.issue(s))}};let i=t.transform(r.value,r);return i instanceof Promise?i.then(o=>(r.value=o,r)):(r.value=i,r)}});jkr=Cr("ZodOptional",(e,t)=>{xRr.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>nkr(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});bbo=Cr("ZodExactOptional",(e,t)=>{Lgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>nkr(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});Ibo=Cr("ZodNullable",(e,t)=>{_go.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>vyo(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});vbo=Cr("ZodDefault",(e,t)=>{Ugo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>xyo(e,r,n,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});xbo=Cr("ZodPrefault",(e,t)=>{Vgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Syo(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});zkr=Cr("ZodNonOptional",(e,t)=>{Ggo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Cyo(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});Tbo=Cr("ZodSuccess",(e,t)=>{qgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>pyo(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});Obo=Cr("ZodCatch",(e,t)=>{Wgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>wyo(e,r,n,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});Bbo=Cr("ZodNaN",(e,t)=>{Hgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>cyo(e,r,n,i)});Qkr=Cr("ZodPipe",(e,t)=>{Kgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Tyo(e,r,n,i),e.in=t.in,e.out=t.out});Mkr=Cr("ZodCodec",(e,t)=>{Qkr.init(e,t),ZLt.init(e,t)});Dbo=Cr("ZodReadonly",(e,t)=>{Jgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Oyo(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});kbo=Cr("ZodTemplateLiteral",(e,t)=>{Ygo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>lyo(e,r,n,i)});Fbo=Cr("ZodLazy",(e,t)=>{$go.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Byo(e,r,n,i),e.unwrap=()=>e._zod.def.getter()});jbo=Cr("ZodPromise",(e,t)=>{Zgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>Pyo(e,r,n,i),e.unwrap=()=>e._zod.def.innerType});zbo=Cr("ZodFunction",(e,t)=>{Xgo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>dyo(e,r,n,i)});b6t=Cr("ZodCustom",(e,t)=>{eAo.init(e,t),cp.init(e,t),e._zod.processJSONSchema=(r,n,i)=>fyo(e,r,n,i)});tGc=GAo,rGc=qAo;iGc=(...e)=>WAo({Codec:Mkr,Boolean:Ltt,String:ztt},...e)});function LMd(e){GI({customError:e})}function _Md(){return GI().customError}var MMd,Lbo,aGc=h(()=>{"use strict";jz();jz();MMd={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};Lbo||(Lbo={})});function VMd(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function GMd(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let n=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let i=r[1];if(!i||!t.defs[i])throw new Error(`Reference not found: ${e}`);return t.defs[i]}throw new Error(`Reference not found: ${e}`)}function cGc(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return ko.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let i=e.$ref;if(t.refs.has(i))return t.refs.get(i);if(t.processing.has(i))return ko.lazy(()=>{if(!t.refs.has(i))throw new Error(`Circular reference not resolved: ${i}`);return t.refs.get(i)});t.processing.add(i);let o=GMd(i,t),s=BD(o,t);return t.refs.set(i,s),t.processing.delete(i),s}if(e.enum!==void 0){let i=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&i.length===1&&i[0]===null)return ko.null();if(i.length===0)return ko.never();if(i.length===1)return ko.literal(i[0]);if(i.every(s=>typeof s=="string"))return ko.enum(i);let o=i.map(s=>ko.literal(s));return o.length<2?o[0]:ko.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return ko.literal(e.const);let r=e.type;if(Array.isArray(r)){let i=r.map(o=>{let s={...e,type:o};return cGc(s,t)});return i.length===0?ko.never():i.length===1?i[0]:ko.union(i)}if(!r)return ko.any();let n;switch(r){case"string":{let i=ko.string();if(e.format){let o=e.format;o==="email"?i=i.check(ko.email()):o==="uri"||o==="uri-reference"?i=i.check(ko.url()):o==="uuid"||o==="guid"?i=i.check(ko.uuid()):o==="date-time"?i=i.check(ko.iso.datetime()):o==="date"?i=i.check(ko.iso.date()):o==="time"?i=i.check(ko.iso.time()):o==="duration"?i=i.check(ko.iso.duration()):o==="ipv4"?i=i.check(ko.ipv4()):o==="ipv6"?i=i.check(ko.ipv6()):o==="mac"?i=i.check(ko.mac()):o==="cidr"?i=i.check(ko.cidrv4()):o==="cidr-v6"?i=i.check(ko.cidrv6()):o==="base64"?i=i.check(ko.base64()):o==="base64url"?i=i.check(ko.base64url()):o==="e164"?i=i.check(ko.e164()):o==="jwt"?i=i.check(ko.jwt()):o==="emoji"?i=i.check(ko.emoji()):o==="nanoid"?i=i.check(ko.nanoid()):o==="cuid"?i=i.check(ko.cuid()):o==="cuid2"?i=i.check(ko.cuid2()):o==="ulid"?i=i.check(ko.ulid()):o==="xid"?i=i.check(ko.xid()):o==="ksuid"&&(i=i.check(ko.ksuid()))}typeof e.minLength=="number"&&(i=i.min(e.minLength)),typeof e.maxLength=="number"&&(i=i.max(e.maxLength)),e.pattern&&(i=i.regex(new RegExp(e.pattern))),n=i;break}case"number":case"integer":{let i=r==="integer"?ko.number().int():ko.number();typeof e.minimum=="number"&&(i=i.min(e.minimum)),typeof e.maximum=="number"&&(i=i.max(e.maximum)),typeof e.exclusiveMinimum=="number"?i=i.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(i=i.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?i=i.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(i=i.lt(e.maximum)),typeof e.multipleOf=="number"&&(i=i.multipleOf(e.multipleOf)),n=i;break}case"boolean":{n=ko.boolean();break}case"null":{n=ko.null();break}case"object":{let i={},o=e.properties||{},s=new Set(e.required||[]);for(let[c,l]of Object.entries(o)){let u=BD(l,t);i[c]=s.has(c)?u:u.optional()}if(e.propertyNames){let c=BD(e.propertyNames,t),l=e.additionalProperties&&typeof e.additionalProperties=="object"?BD(e.additionalProperties,t):ko.any();if(Object.keys(i).length===0){n=ko.record(c,l);break}let u=ko.object(i).passthrough(),p=ko.looseRecord(c,l);n=ko.intersection(u,p);break}if(e.patternProperties){let c=e.patternProperties,l=Object.keys(c),u=[];for(let d of l){let f=BD(c[d],t),m=ko.string().regex(new RegExp(d));u.push(ko.looseRecord(m,f))}let p=[];if(Object.keys(i).length>0&&p.push(ko.object(i).passthrough()),p.push(...u),p.length===0)n=ko.object({}).passthrough();else if(p.length===1)n=p[0];else{let d=ko.intersection(p[0],p[1]);for(let f=2;f<p.length;f++)d=ko.intersection(d,p[f]);n=d}break}let a=ko.object(i);e.additionalProperties===!1?n=a.strict():typeof e.additionalProperties=="object"?n=a.catchall(BD(e.additionalProperties,t)):n=a.passthrough();break}case"array":{let i=e.prefixItems,o=e.items;if(i&&Array.isArray(i)){let s=i.map(c=>BD(c,t)),a=o&&typeof o=="object"&&!Array.isArray(o)?BD(o,t):void 0;a?n=ko.tuple(s).rest(a):n=ko.tuple(s),typeof e.minItems=="number"&&(n=n.check(ko.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(ko.maxLength(e.maxItems)))}else if(Array.isArray(o)){let s=o.map(c=>BD(c,t)),a=e.additionalItems&&typeof e.additionalItems=="object"?BD(e.additionalItems,t):void 0;a?n=ko.tuple(s).rest(a):n=ko.tuple(s),typeof e.minItems=="number"&&(n=n.check(ko.minLength(e.minItems))),typeof e.maxItems=="number"&&(n=n.check(ko.maxLength(e.maxItems)))}else if(o!==void 0){let s=BD(o,t),a=ko.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),n=a}else n=ko.array(ko.any());break}default:throw new Error(`Unsupported type: ${r}`)}return e.description&&(n=n.describe(e.description)),e.default!==void 0&&(n=n.default(e.default)),n}function BD(e,t){if(typeof e=="boolean")return e?ko.any():ko.never();let r=cGc(e,t),n=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(l=>BD(l,t)),c=ko.union(a);r=n?ko.intersection(r,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(l=>BD(l,t)),c=ko.xor(a);r=n?ko.intersection(r,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=n?r:ko.any();else{let a=n?r:BD(e.allOf[0],t),c=n?0:1;for(let l=c;l<e.allOf.length;l++)a=ko.intersection(a,BD(e.allOf[l],t));r=a}e.nullable===!0&&t.version==="openapi-3.0"&&(r=ko.nullable(r)),e.readOnly===!0&&(r=ko.readonly(r));let i={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of o)a in e&&(i[a]=e[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in e&&(i[a]=e[a]);for(let a of Object.keys(e))UMd.has(a)||(i[a]=e[a]);return Object.keys(i).length>0&&t.registry.add(r,i),r}function lGc(e,t){if(typeof e=="boolean")return e?ko.any():ko.never();let r=VMd(e,t?.defaultTarget),n=e.$defs||e.definitions||{},i={version:r,defs:n,refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??RP};return BD(e,i)}var ko,UMd,uGc=h(()=>{"use strict";t6t();akr();s6t();c6t();ko={...a6t,...skr,iso:Ntt},UMd=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"])});var _bo={};ne(_bo,{bigint:()=>KMd,boolean:()=>HMd,date:()=>JMd,number:()=>WMd,string:()=>qMd});function qMd(e){return lAo(ztt,e)}function WMd(e){return AAo(Mtt,e)}function HMd(e){return xAo(Ltt,e)}function KMd(e){return wAo(_tt,e)}function JMd(e){return zAo(m6t,e)}var pGc=h(()=>{"use strict";jz();c6t()});var T={};ne(T,{$brand:()=>XDr,$input:()=>aAo,$output:()=>sAo,NEVER:()=>kmo,TimePrecision:()=>pAo,ZodAny:()=>rbo,ZodArray:()=>sbo,ZodBase64:()=>Tkr,ZodBase64URL:()=>Okr,ZodBigInt:()=>_tt,ZodBigIntFormat:()=>Dkr,ZodBoolean:()=>Ltt,ZodCIDRv4:()=>Skr,ZodCIDRv6:()=>wkr,ZodCUID:()=>ykr,ZodCUID2:()=>bkr,ZodCatch:()=>Obo,ZodCodec:()=>Mkr,ZodCustom:()=>b6t,ZodCustomStringFormat:()=>Qtt,ZodDate:()=>m6t,ZodDefault:()=>vbo,ZodDiscriminatedUnion:()=>cbo,ZodE164:()=>Pkr,ZodEmail:()=>hkr,ZodEmoji:()=>gkr,ZodEnum:()=>jtt,ZodError:()=>zMd,ZodExactOptional:()=>bbo,ZodFile:()=>Abo,ZodFirstPartyTypeKind:()=>Lbo,ZodFunction:()=>zbo,ZodGUID:()=>l6t,ZodIPv4:()=>Ckr,ZodIPv6:()=>xkr,ZodISODate:()=>lkr,ZodISODateTime:()=>ckr,ZodISODuration:()=>pkr,ZodISOTime:()=>ukr,ZodIntersection:()=>lbo,ZodIssueCode:()=>MMd,ZodJWT:()=>Bkr,ZodKSUID:()=>vkr,ZodLazy:()=>Fbo,ZodLiteral:()=>gbo,ZodMAC:()=>Jyo,ZodMap:()=>mbo,ZodNaN:()=>Bbo,ZodNanoID:()=>Akr,ZodNever:()=>ibo,ZodNonOptional:()=>zkr,ZodNull:()=>ebo,ZodNullable:()=>Ibo,ZodNumber:()=>Mtt,ZodNumberFormat:()=>v6e,ZodObject:()=>g6t,ZodOptional:()=>jkr,ZodPipe:()=>Qkr,ZodPrefault:()=>xbo,ZodPromise:()=>jbo,ZodReadonly:()=>Dbo,ZodRealError:()=>zz,ZodRecord:()=>y6t,ZodSet:()=>hbo,ZodString:()=>ztt,ZodStringFormat:()=>pA,ZodSuccess:()=>Tbo,ZodSymbol:()=>Zyo,ZodTemplateLiteral:()=>kbo,ZodTransform:()=>ybo,ZodTuple:()=>pbo,ZodType:()=>cp,ZodULID:()=>Ekr,ZodURL:()=>d6t,ZodUUID:()=>Aee,ZodUndefined:()=>$yo,ZodUnion:()=>A6t,ZodUnknown:()=>nbo,ZodVoid:()=>obo,ZodXID:()=>Ikr,ZodXor:()=>abo,_ZodString:()=>mkr,_default:()=>Cbo,_function:()=>Z8c,any:()=>B8c,array:()=>h6t,base64:()=>d8c,base64url:()=>m8c,bigint:()=>S8c,boolean:()=>Xyo,catch:()=>Pbo,check:()=>$8c,cidrv4:()=>p8c,cidrv6:()=>f8c,clone:()=>QF,codec:()=>J8c,coerce:()=>_bo,config:()=>GI,core:()=>Tfe,cuid:()=>n8c,cuid2:()=>i8c,custom:()=>eGc,date:()=>R8c,decode:()=>_yo,decodeAsync:()=>Vyo,describe:()=>tGc,discriminatedUnion:()=>Q8c,e164:()=>h8c,email:()=>H5c,emoji:()=>t8c,encode:()=>Lyo,encodeAsync:()=>Uyo,endsWith:()=>wtt,enum:()=>Fkr,exactOptional:()=>Ebo,file:()=>q8c,flattenError:()=>qLt,float32:()=>I8c,float64:()=>v8c,formatError:()=>WLt,fromJSONSchema:()=>lGc,function:()=>Z8c,getErrorMap:()=>_Md,globalRegistry:()=>RP,gt:()=>hee,gte:()=>MF,guid:()=>K5c,hash:()=>E8c,hex:()=>b8c,hostname:()=>y8c,httpUrl:()=>e8c,includes:()=>xtt,instanceof:()=>nGc,int:()=>dkr,int32:()=>C8c,int64:()=>w8c,intersection:()=>ubo,ipv4:()=>c8c,ipv6:()=>u8c,iso:()=>Ntt,json:()=>oGc,jwt:()=>g8c,keyof:()=>k8c,ksuid:()=>a8c,lazy:()=>Nbo,length:()=>E6e,literal:()=>G8c,locales:()=>e6t,looseObject:()=>j8c,looseRecord:()=>L8c,lowercase:()=>vtt,lt:()=>mee,lte:()=>H6,mac:()=>l8c,map:()=>_8c,maxLength:()=>b6e,maxSize:()=>ave,meta:()=>rGc,mime:()=>Ttt,minLength:()=>wfe,minSize:()=>gee,multipleOf:()=>sve,nan:()=>K8c,nanoid:()=>r8c,nativeEnum:()=>V8c,negative:()=>XRr,never:()=>Rkr,nonnegative:()=>$Rr,nonoptional:()=>wbo,nonpositive:()=>ZRr,normalize:()=>Ott,null:()=>tbo,nullable:()=>p6t,nullish:()=>W8c,number:()=>Yyo,object:()=>F8c,optional:()=>u6t,overwrite:()=>CH,parse:()=>jyo,parseAsync:()=>zyo,partialRecord:()=>M8c,pipe:()=>f6t,positive:()=>YRr,prefault:()=>Sbo,preprocess:()=>sGc,prettifyError:()=>qmo,promise:()=>X8c,property:()=>ekr,readonly:()=>Rbo,record:()=>dbo,refine:()=>Qbo,regex:()=>Itt,regexes:()=>NV,registry:()=>PRr,safeDecode:()=>qyo,safeDecodeAsync:()=>Hyo,safeEncode:()=>Gyo,safeEncodeAsync:()=>Wyo,safeParse:()=>Qyo,safeParseAsync:()=>Myo,set:()=>U8c,setErrorMap:()=>LMd,size:()=>y6e,slugify:()=>Rtt,startsWith:()=>Stt,strictObject:()=>N8c,string:()=>fkr,stringFormat:()=>A8c,stringbool:()=>iGc,success:()=>H8c,superRefine:()=>Mbo,symbol:()=>O8c,templateLiteral:()=>Y8c,toJSONSchema:()=>ikr,toLowerCase:()=>Btt,toUpperCase:()=>Dtt,transform:()=>Nkr,treeifyError:()=>Gmo,trim:()=>Ptt,tuple:()=>fbo,uint32:()=>x8c,uint64:()=>T8c,ulid:()=>o8c,undefined:()=>P8c,union:()=>kkr,unknown:()=>I6e,uppercase:()=>Ctt,url:()=>$5c,util:()=>vi,uuid:()=>J5c,uuidv4:()=>Y5c,uuidv6:()=>X5c,uuidv7:()=>Z5c,void:()=>D8c,xid:()=>s8c,xor:()=>z8c});var Ubo=h(()=>{"use strict";jz();c6t();akr();Nyo();Kyo();aGc();jz();rAo();jz();o6t();uGc();oAo();s6t();s6t();pGc();GI(SRr())});var is=h(()=>{"use strict";Ubo();Ubo()});var fGc=h(()=>{"use strict"});var iEo={};ne(iEo,{AIChatConfig:()=>Wbo,AIChatDatasource:()=>n9c,AIChatLocation:()=>hGc,AIChatModel:()=>gGc,AIChatWebsiteDatasource:()=>r9c,AbsoluteProductPath:()=>Iqc,AgentsConfig:()=>s9c,AiExamplesConfig:()=>t9c,AnalyticsConfig:()=>e9c,AnnouncementConfig:()=>Gkr,ApiReferenceConfiguration:()=>lqc,ApiReferenceEndpointConfiguration:()=>Z9c,ApiReferenceLayout:()=>OGc,ApiReferenceLayoutItem:()=>x6t,ApiReferenceOperationConfiguration:()=>$9c,ApiReferencePackageConfiguration:()=>rqc,ApiReferencePackageConfigurationWithOptions:()=>tqc,ApiReferenceSectionConfiguration:()=>eqc,ApiSpecConfiguration:()=>cqc,ApiSpecErrorResponseEnsure:()=>oqc,ApiSpecErrorResponseHttpMethod:()=>iqc,ApiSpecErrorResponses:()=>sqc,ApiSpecImportSettings:()=>aqc,ApiSpecType:()=>nqc,Audience:()=>I6t,AudienceId:()=>Vbo,Availability:()=>Pfe,BackgroundImageConfiguration:()=>GGc,BackgroundImageThemedConfig:()=>VGc,BlogConfiguration:()=>J9c,BodyThemeConfig:()=>NGc,BreadcrumbsConfig:()=>p9c,ChangelogConfiguration:()=>K9c,ChangelogFolderRelativePath:()=>E6t,ChangelogLayout:()=>TGc,CheckConfig:()=>Q9c,CheckRuleSeverity:()=>Ofe,CheckRulesConfig:()=>z9c,CodeBlockTheme:()=>Gbo,CodeBlocksThemeConfig:()=>DGc,CollapsedStringValue:()=>WGc,CollapsedValue:()=>v6t,ColorConfig:()=>Ix,ColorThemedConfig:()=>LGc,ColorsConfiguration:()=>h9c,ContentAlignment:()=>SGc,CssConfig:()=>qGc,CustomDomain:()=>_Gc,CustomPageAction:()=>g9c,DocsConfiguration:()=>tLd,DocsInstance:()=>I9c,DocsSettingsConfig:()=>m9c,DocsTypographyConfig:()=>l9c,EditThisPageConfig:()=>E9c,EditThisPageLaunch:()=>AGc,EmbeddingConfig:()=>o9c,ExperimentalConfig:()=>U9c,ExternalProduct:()=>yqc,ExternalSitemapConfigSchema:()=>L9c,ExternalSitemapSchema:()=>_9c,FeatureFlag:()=>qbo,FeatureFlagConfiguration:()=>HGc,FolderConfiguration:()=>X9c,FontConfig:()=>Lkr,FontConfigPath:()=>c9c,FontConfigVariant:()=>a9c,FontDisplay:()=>IGc,FontStyle:()=>Ybo,FontWeight:()=>Zbo,FooterLinksConfig:()=>B9c,FooterNavThemeConfig:()=>kGc,FullStoryAnalyticsConfig:()=>JGc,GTMConfig:()=>ZGc,GitLibraryInputSchema:()=>V9c,GithubEditThisPageConfig:()=>b9c,GoogleAnalytics4Config:()=>$Gc,HeaderPosition:()=>wGc,HttpSnippetLanguage:()=>QGc,HttpSnippetsConfig:()=>UGc,IntegrationsConfig:()=>M9c,IntercomConfig:()=>YGc,InternalProduct:()=>Aqc,JsConfig:()=>F9c,JsConfigOptions:()=>Hbo,JsFileConfig:()=>R9c,JsFileConfigSettings:()=>D9c,JsRemoteConfig:()=>k9c,JsScriptStrategy:()=>Xbo,Language:()=>Ukr,LanguageSwitcherThemeConfig:()=>BGc,LayoutConfig:()=>f9c,LibraryConfiguration:()=>H9c,LibraryInputConfiguration:()=>q9c,LibraryLanguage:()=>EGc,LibraryName:()=>Kbo,LibraryOutputConfiguration:()=>W9c,LibraryReferenceConfiguration:()=>Y9c,LinkConfiguration:()=>eEo,LogoConfiguration:()=>v9c,MetadataConfig:()=>N9c,NavbarDropdownConfig:()=>O9c,NavbarGithubConfig:()=>T9c,NavbarGithubConfigWithOptions:()=>w9c,NavbarLink:()=>P9c,NavbarLinkConfig:()=>C6e,NavigationConfig:()=>qkr,NavigationItem:()=>S6t,PageActionOption:()=>mGc,PageActionOptions:()=>A9c,PageActionsConfig:()=>y9c,PageActionsThemeConfig:()=>zGc,PageConfiguration:()=>Gtt,PageDescriptionSource:()=>i9c,PathLibraryInputSchema:()=>G9c,PlaygroundButtonSettings:()=>S9c,PlaygroundSettings:()=>C6t,PostHogConfig:()=>XGc,ProductConfig:()=>bqc,ProductConfigBase:()=>nEo,ProductFileConfig:()=>eLd,ProductPath:()=>$Md,ProductSwitcherThemeConfig:()=>PGc,ProgrammingLanguage:()=>dGc,RedirectConfig:()=>tEo,RedirectsConfiguration:()=>j9c,RedirectsFile:()=>XMd,RelativeProductPath:()=>Eqc,Role:()=>$bo,RoleId:()=>_kr,SearchSettingsConfig:()=>d9c,SearchbarPlacement:()=>vGc,SectionConfiguration:()=>uqc,SegmentConfig:()=>KGc,SidebarThemeConfig:()=>jGc,SiteSwitcherThemeConfig:()=>RGc,SnippetLanguageConfiguration:()=>xH,SnippetsConfiguration:()=>x9c,SortByAvailabilityValue:()=>yGc,SwitcherPlacement:()=>xGc,TabConfig:()=>Wkr,TabId:()=>Utt,TabVariant:()=>fqc,TabbedNavigationConfig:()=>gqc,TabbedNavigationItem:()=>hqc,TabbedNavigationItemWithLayout:()=>dqc,TabbedNavigationItemWithVariants:()=>mqc,TabsPlacement:()=>CGc,TabsThemeConfig:()=>FGc,Target:()=>Vtt,ThemeConfig:()=>u9c,TitleSource:()=>Jbo,TranslationConfig:()=>Cqc,TranslationConfigObject:()=>vqc,TwitterCardSetting:()=>MGc,UntabbedNavigationConfig:()=>pqc,VersionAvailability:()=>bGc,VersionConfig:()=>rEo,VersionFileConfig:()=>ZMd,VersionedSnippetLanguageConfiguration:()=>C9c,WithFeatureFlags:()=>FP,WithPermissions:()=>kP,WithViewers:()=>Vkr,normalizeTranslationConfig:()=>xqc});function xqc(e){return typeof e=="string"?{lang:e}:e}var Utt,E6t,Vbo,_kr,Kbo,dGc,Ukr,mGc,hGc,gGc,AGc,Pfe,yGc,bGc,Jbo,EGc,Ybo,IGc,vGc,CGc,xGc,SGc,wGc,TGc,OGc,PGc,BGc,Gbo,DGc,RGc,kGc,FGc,NGc,jGc,zGc,QGc,Vtt,MGc,Xbo,Zbo,LGc,Ix,I6t,$bo,_Gc,UGc,VGc,GGc,qGc,WGc,v6t,kP,qbo,HGc,FP,Vkr,KGc,JGc,YGc,XGc,ZGc,$Gc,e9c,t9c,r9c,n9c,i9c,o9c,s9c,Wbo,a9c,c9c,Lkr,l9c,u9c,p9c,f9c,d9c,m9c,h9c,g9c,A9c,y9c,b9c,E9c,I9c,v9c,eEo,C9c,xH,x9c,S9c,C6t,Gkr,C6e,w9c,T9c,O9c,P9c,B9c,D9c,R9c,k9c,Hbo,F9c,N9c,tEo,j9c,XMd,Ofe,z9c,Q9c,M9c,L9c,_9c,U9c,V9c,G9c,q9c,W9c,H9c,Gtt,K9c,J9c,Y9c,X9c,Z9c,$9c,x6t,eqc,tqc,rqc,nqc,iqc,oqc,sqc,aqc,cqc,lqc,S6t,uqc,pqc,fqc,dqc,mqc,hqc,gqc,qkr,Wkr,rEo,ZMd,nEo,Aqc,yqc,bqc,Eqc,Iqc,$Md,eLd,vqc,Cqc,tLd,Sqc=h(()=>{"use strict";is();Utt=T.string(),E6t=T.string(),Vbo=T.string(),_kr=T.string(),Kbo=T.string(),dGc=T.enum(["typescript","javascript","python","java","go","ruby","csharp","php","swift","rust","nodets","nodejs","dotnet","curl","jvm","ts","js"]),Ukr=T.string().regex(/^[a-zA-Z]{2,8}(-[a-zA-Z0-9]{1,8})*$/,"Language must be a valid BCP 47 language tag (e.g. 'en', 'ja', 'ja-JP', 'pt-BR', 'zh-Hans-CN')"),mGc=T.enum(["copy-page","view-as-markdown","ask-ai","chatgpt","claude","cursor","vscode"]),hGc=T.enum(["docs","slack","discord"]),gGc=T.enum(["claude-3.7","claude-4","command-a"]),AGc=T.enum(["github","dashboard"]),Pfe=T.enum(["stable","generally-available","in-development","pre-release","deprecated","beta","alpha","preview","legacy"]),yGc=T.enum(["unset","stable","generally-available","in-development","pre-release","deprecated","beta","alpha","preview","legacy"]),bGc=T.enum(["deprecated","ga","stable","beta"]),Jbo=T.enum(["frontmatter","filename"]),EGc=T.enum(["python","cpp"]),Ybo=T.enum(["normal","italic"]),IGc=T.enum(["auto","block","swap","fallback","optional"]),vGc=T.enum(["header","header-tabs","sidebar"]),CGc=T.enum(["header","sidebar"]),xGc=T.enum(["header","sidebar"]),SGc=T.enum(["center","left"]),wGc=T.enum(["fixed","static"]),TGc=T.enum(["timeline","classic"]),OGc=T.enum(["indented","cards"]),PGc=T.enum(["default","toggle","tabs"]),BGc=T.enum(["default","minimal"]),Gbo=T.enum(["github-dark","github-dark-default","github-dark-dimmed","github-dark-high-contrast","github-light","github-light-default","github-light-high-contrast","material-theme-darker","min-dark","min-light"]),DGc=T.object({light:Gbo.optional(),dark:Gbo.optional()}),RGc=T.object({enabled:T.boolean().optional(),order:T.array(T.string()).optional(),hide:T.array(T.string()).optional(),labels:T.record(T.string(),T.string()).optional(),"show-products":T.boolean().optional()}),kGc=T.enum(["default","minimal"]),FGc=T.enum(["default","bubble"]),NGc=T.enum(["default","canvas"]),jGc=T.enum(["default","minimal"]),zGc=T.enum(["default","toolbar"]),QGc=T.enum(["curl","csharp","go","java","javascript","php","python","ruby","swift","typescript"]),Vtt=T.enum(["_blank","_self","_parent","_top"]),MGc=T.enum(["summary","summary_large_image","app","player"]),Xbo=T.enum(["beforeInteractive","afterInteractive","lazyOnload"]),Zbo=T.union([T.string(),T.number().int()]),LGc=T.object({dark:T.string().optional(),light:T.string().optional()}),Ix=T.union([T.string(),LGc]),I6t=T.union([Vbo,T.array(Vbo)]),$bo=T.union([_kr,T.array(_kr)]),_Gc=T.union([T.string(),T.array(T.string())]),UGc=T.union([T.boolean(),T.array(QGc)]),VGc=T.object({dark:T.string().optional(),light:T.string().optional()}),GGc=T.union([T.string(),VGc]),qGc=T.union([T.string(),T.array(T.string())]),WGc=T.enum(["open-by-default"]),v6t=T.union([T.boolean(),WGc]),kP=T.object({viewers:$bo.optional(),orphaned:T.boolean().optional()}),qbo=T.object({flag:T.string(),"fallback-value":T.unknown().optional(),match:T.unknown().optional()}),HGc=T.union([T.string(),qbo,T.array(qbo)]),FP=T.object({"feature-flag":HGc.optional()}),Vkr=T.object({viewers:$bo.optional()}),KGc=T.object({"write-key":T.string()}),JGc=T.object({"org-id":T.string()}),YGc=T.object({"app-id":T.string(),"api-base":T.string().optional()}),XGc=T.object({"api-key":T.string(),endpoint:T.string().optional()}),ZGc=T.object({"container-id":T.string()}),$Gc=T.object({"measurement-id":T.string()}),e9c=T.object({segment:KGc.optional(),fullstory:JGc.optional(),intercom:YGc.optional(),posthog:XGc.optional(),gtm:ZGc.optional(),ga4:$Gc.optional()}),t9c=T.object({enabled:T.boolean().optional(),style:T.string().optional()}),r9c=T.object({url:T.string(),title:T.string().optional()}),n9c=r9c,i9c=T.enum(["description","subtitle"]),o9c=T.object({"allowed-origins":T.array(T.string())}),s9c=T.object({"page-directive":T.string().optional(),"page-description-source":i9c.optional(),"llms-txt":T.string().optional(),"llms-full-txt":T.string().optional()}),Wbo=T.object({model:gGc.optional(),"system-prompt":T.string().optional(),location:T.array(hGc).optional(),datasources:T.array(n9c).optional(),"mask-pii":T.boolean().optional(),disclaimer:T.string().optional(),"button-text":T.string().optional()}),a9c=T.object({path:T.string(),weight:Zbo.optional(),style:Ybo.optional()}),c9c=T.union([T.string(),a9c]),Lkr=T.object({name:T.string().optional(),path:T.string().optional(),weight:Zbo.optional(),style:Ybo.optional(),paths:T.array(c9c).optional(),display:IGc.optional(),fallback:T.array(T.string()).optional(),"font-variation-settings":T.string().optional()}),l9c=T.object({headingsFont:Lkr.optional(),bodyFont:Lkr.optional(),codeFont:Lkr.optional()}),u9c=T.object({sidebar:jGc.optional(),body:NGc.optional(),tabs:FGc.optional(),"page-actions":zGc.optional(),"footer-nav":kGc.optional(),"language-switcher":BGc.optional(),"product-switcher":PGc.optional(),"site-switcher":RGc.optional(),"code-blocks":DGc.optional()}),p9c=T.object({"current-page":T.boolean().optional()}),f9c=T.object({"page-width":T.string().optional(),"content-width":T.string().optional(),"sidebar-width":T.string().optional(),"header-height":T.string().optional(),"searchbar-placement":vGc.optional(),"tabs-placement":CGc.optional(),"switcher-placement":xGc.optional(),"content-alignment":SGc.optional(),"header-position":wGc.optional(),"disable-header":T.boolean().optional(),"hide-nav-links":T.boolean().optional(),"hide-feedback":T.boolean().optional(),"mobile-toc":T.boolean().optional(),"changelog-layout":TGc.optional(),"api-reference-layout":OGc.optional(),"api-reference-expand-properties":T.boolean().optional(),"show-nav-availability-badges":T.boolean().optional(),"hide-webhook-method-badges":T.boolean().optional(),breadcrumbs:p9c.optional()}),d9c=T.object({"prioritize-current-product":T.boolean().optional(),"default-filter-by-current-product":T.boolean().optional()}),m9c=T.object({"search-text":T.string().optional(),"disable-search":T.boolean().optional(),"dark-mode-code":T.boolean().optional(),"default-search-filters":T.boolean().optional(),search:d9c.optional(),"http-snippets":UGc.optional(),"hide-404-page":T.boolean().optional(),"use-javascript-as-typescript":T.boolean().optional(),"disable-explorer-proxy":T.boolean().optional(),"disable-analytics":T.boolean().optional(),"require-analytics-consent":T.boolean().optional(),language:Ukr.optional(),"folder-title-source":Jbo.optional(),"substitute-env-vars":T.boolean().optional(),"websocket-oneof-display":T.enum(["flat","grouped"]).optional(),embedding:o9c.optional()}),h9c=T.object({"accent-primary":Ix.optional(),accentPrimary:Ix.optional(),background:Ix.optional(),border:Ix.optional(),"sidebar-background":Ix.optional(),"header-background":Ix.optional(),"card-background":Ix.optional(),"accent-1":Ix.optional(),"accent-2":Ix.optional(),"accent-3":Ix.optional(),"accent-4":Ix.optional(),"accent-5":Ix.optional(),"accent-6":Ix.optional(),"accent-7":Ix.optional(),"accent-8":Ix.optional(),"accent-9":Ix.optional(),"accent-10":Ix.optional(),"accent-11":Ix.optional(),"accent-12":Ix.optional()}),g9c=T.object({title:T.string(),subtitle:T.string().optional(),url:T.string(),icon:T.string().optional(),default:T.boolean().optional()}),A9c=T.object({"copy-page":T.boolean().optional(),"view-as-markdown":T.boolean().optional(),"ask-ai":T.boolean().optional(),chatgpt:T.boolean().optional(),claude:T.boolean().optional(),cursor:T.boolean().optional(),mcp:T.boolean().optional(),vscode:T.boolean().optional(),custom:T.array(g9c).optional()}),y9c=T.object({default:mGc.optional(),options:A9c.optional()}),b9c=T.object({host:T.string().optional(),owner:T.string(),repo:T.string(),branch:T.string().optional()}),E9c=T.object({github:b9c.optional(),launch:AGc.optional()}),I9c=T.object({url:T.string(),"custom-domain":_Gc.optional(),"edit-this-page":E9c.optional(),audiences:I6t.optional(),"multi-source":T.boolean().optional()}),v9c=T.object({dark:T.string().optional(),light:T.string().optional(),height:T.number().optional(),href:T.string().optional(),"right-text":T.string().optional()}),eEo=T.object({link:T.string(),href:T.string(),icon:T.string().optional(),target:Vtt.optional()}),C9c=T.object({version:T.string(),package:T.string()}),xH=T.union([T.string(),C9c]),x9c=T.object({python:xH.optional(),typescript:xH.optional(),go:xH.optional(),java:xH.optional(),ruby:xH.optional(),csharp:xH.optional(),php:xH.optional(),swift:xH.optional(),cli:xH.optional(),rust:xH.optional()}),S9c=T.object({href:T.string().optional()}),C6t=T.object({hidden:T.boolean().optional(),environments:T.array(T.string()).optional(),button:S9c.optional(),oauth:T.boolean().optional(),"limit-websocket-messages-per-connection":T.number().int().optional(),"send-optional-defaults":T.boolean().optional()}),Gkr=T.object({message:T.string()}),C6e=Vkr.merge(T.object({href:T.string().optional(),target:Vtt.optional(),url:T.string().optional(),text:T.string().optional(),icon:T.string().optional(),rightIcon:T.string().optional(),rounded:T.boolean().optional()})),w9c=Vkr.merge(T.object({url:T.string(),target:Vtt.optional()})),T9c=T.union([T.string(),w9c]),O9c=Vkr.merge(T.object({links:T.array(C6e),text:T.string().optional(),icon:T.string().optional(),rightIcon:T.string().optional(),rounded:T.boolean().optional()})),P9c=T.union([C6e.merge(T.object({type:T.literal("filled")})),C6e.merge(T.object({type:T.literal("outlined")})),C6e.merge(T.object({type:T.literal("minimal")})),T.object({type:T.literal("github"),value:T9c}),O9c.merge(T.object({type:T.literal("dropdown")})),C6e.merge(T.object({type:T.literal("primary")})),C6e.merge(T.object({type:T.literal("secondary")}))]),B9c=T.object({github:T.string().optional(),twitter:T.string().optional(),x:T.string().optional(),linkedin:T.string().optional(),youtube:T.string().optional(),instagram:T.string().optional(),facebook:T.string().optional(),discord:T.string().optional(),slack:T.string().optional(),hackernews:T.string().optional(),medium:T.string().optional(),website:T.string().optional()}),D9c=T.object({path:T.string(),strategy:Xbo.optional()}),R9c=T.union([T.string(),D9c]),k9c=T.object({url:T.string(),strategy:Xbo.optional(),"disable-sri":T.boolean().optional()}),Hbo=T.union([k9c,R9c]),F9c=T.union([Hbo,T.array(Hbo)]),N9c=T.object({"og:site_name":T.string().optional(),"og:title":T.string().optional(),"og:description":T.string().optional(),"og:url":T.string().optional(),"og:image":T.string().optional(),"og:image:width":T.number().optional(),"og:image:height":T.number().optional(),"og:locale":T.string().optional(),"og:logo":T.string().optional(),"twitter:title":T.string().optional(),"twitter:description":T.string().optional(),"twitter:handle":T.string().optional(),"twitter:image":T.string().optional(),"twitter:site":T.string().optional(),"twitter:url":T.string().optional(),"twitter:card":MGc.optional(),"og:dynamic":T.boolean().optional(),"og:dynamic:background-image":T.string().optional(),"og:dynamic:text-color":T.string().optional(),"og:dynamic:background-color":T.string().optional(),"og:dynamic:logo-color":T.enum(["dark","light"]).optional(),"og:dynamic:show-logo":T.boolean().optional(),"og:dynamic:show-section":T.boolean().optional(),"og:dynamic:show-description":T.boolean().optional(),"og:dynamic:show-url":T.boolean().optional(),"og:dynamic:show-gradient":T.boolean().optional(),"canonical-host":T.string().optional()}),tEo=T.object({source:T.string(),destination:T.string(),permanent:T.boolean().optional()}),j9c=T.union([T.array(tEo),T.string(),T.array(T.string())]),XMd=T.object({redirects:T.array(tEo.strict())}).strict(),Ofe=T.enum(["warn","error"]),z9c=T.object({"example-validation":Ofe.optional(),"broken-links":Ofe.optional(),"no-non-component-refs":Ofe.optional(),"valid-local-references":Ofe.optional(),"no-circular-redirects":Ofe.optional(),"valid-docs-endpoints":Ofe.optional(),"missing-redirects":Ofe.optional(),"valid-changelog-slug":Ofe.optional()}),Q9c=T.object({rules:z9c.optional()}),M9c=T.object({intercom:T.string().optional(),context7:T.string().optional()}),L9c=T.object({url:T.string(),locale:T.string().optional()}),_9c=T.union([T.string(),L9c]),U9c=T.object({"mdx-components":T.array(T.string()).optional(),"disable-stream-toggle":T.boolean().optional(),"openapi-parser-v2":T.boolean().optional(),"openapi-parser-v3":T.boolean().optional(),"dynamic-snippets":T.boolean().optional(),"ai-examples":T.boolean().optional(),"ai-example-style-instructions":T.string().optional(),"exclude-apis":T.boolean().optional(),"basepath-aware":T.boolean().optional(),"robots-txt-on-instance-url":T.boolean().optional(),"external-sitemaps":T.array(_9c).optional()}),V9c=T.object({git:T.string(),subpath:T.string().optional(),ref:T.string().optional()}),G9c=T.object({path:T.string()}),q9c=T.union([V9c,G9c]),W9c=T.object({path:T.string()}),H9c=T.object({input:q9c,output:W9c,lang:EGc}),Gtt=kP.merge(FP).merge(T.object({page:T.string(),path:T.string(),slug:T.string().optional(),icon:T.string().optional(),hidden:T.boolean().optional(),noindex:T.boolean().optional(),availability:Pfe.optional()})),K9c=kP.merge(FP).merge(T.object({changelog:E6t,title:T.string().optional(),slug:T.string().optional(),icon:T.string().optional(),hidden:T.boolean().optional()})),J9c=kP.merge(FP).merge(T.object({blog:E6t,title:T.string().optional(),slug:T.string().optional(),icon:T.string().optional(),hidden:T.boolean().optional()})),Y9c=kP.merge(FP).merge(T.object({library:Kbo,title:T.string().optional(),slug:T.string().optional()})),X9c=kP.merge(FP).merge(T.object({folder:T.string(),title:T.string().optional(),"title-source":Jbo.optional(),slug:T.string().optional(),icon:T.string().optional(),hidden:T.boolean().optional(),"skip-slug":T.boolean().optional(),collapsed:v6t.optional(),collapsible:T.boolean().optional(),"collapsed-by-default":T.boolean().optional(),availability:Pfe.optional()})),Z9c=kP.merge(FP).merge(T.object({endpoint:T.string(),title:T.string().optional(),slug:T.string().optional(),icon:T.string().optional(),hidden:T.boolean().optional(),availability:Pfe.optional(),playground:C6t.optional()})),$9c=kP.merge(FP).merge(T.object({operation:T.string(),title:T.string().optional(),slug:T.string().optional(),hidden:T.boolean().optional(),availability:Pfe.optional()})),x6t=T.lazy(()=>T.union([T.string(),T.record(T.string(),rqc),eqc,Z9c,$9c,Gtt,eEo])),eqc=kP.merge(FP).merge(T.object({section:T.string(),"referenced-packages":T.array(T.string()).optional(),summary:T.string().optional(),contents:T.array(x6t).optional(),slug:T.string().optional(),icon:T.string().optional(),hidden:T.boolean().optional(),"skip-slug":T.boolean().optional(),collapsed:v6t.optional(),collapsible:T.boolean().optional(),"collapsed-by-default":T.boolean().optional(),availability:Pfe.optional(),playground:C6t.optional()})),tqc=kP.merge(FP).merge(T.object({title:T.string().optional(),summary:T.string().optional(),contents:T.array(x6t).optional(),availability:Pfe.optional(),slug:T.string().optional(),icon:T.string().optional(),hidden:T.boolean().optional(),"skip-slug":T.boolean().optional(),playground:C6t.optional()})),rqc=T.lazy(()=>T.union([T.array(x6t),tqc])),nqc=T.enum(["openapi","asyncapi","graphql"]),iqc=T.enum(["get","post","put","patch","delete","head","options","trace"]),oqc=T.object({"status-code":T.number().int().min(400).max(599),methods:T.array(iqc).optional()}),sqc=T.object({schema:T.union([T.string(),T.record(T.string(),T.unknown())]),name:T.string().optional(),"apply-to":T.enum(["all","untyped"]).optional(),ensure:T.array(oqc).optional()}),aqc=T.object({"type-dates-as-strings":T.boolean().optional(),"use-bytes-for-binary-response":T.boolean().optional(),"respect-parameter-content":T.boolean().optional(),"respect-operation-id-word-boundaries":T.boolean().optional(),"infer-forward-compatible":T.boolean().optional(),"preserve-one-of-in-all-of":T.boolean().optional(),"any-of-sibling-properties-as-object":T.boolean().optional(),"error-responses":sqc.optional()}),cqc=T.object({type:nqc,path:T.string(),namespace:T.string().optional(),overlays:T.string().optional(),overrides:T.array(T.string()).optional(),settings:aqc.optional()}),lqc=kP.merge(FP).merge(T.object({api:T.string(),"api-name":T.string().optional(),specs:T.array(cqc).optional(),openrpc:T.string().optional(),audiences:I6t.optional(),"display-errors":T.boolean().optional(),"tag-description-pages":T.boolean().optional(),snippets:x9c.optional(),postman:T.string().optional(),summary:T.string().optional(),layout:T.array(x6t).optional(),collapsed:v6t.optional(),icon:T.string().optional(),slug:T.string().optional(),hidden:T.boolean().optional(),availability:Pfe.optional(),"skip-slug":T.boolean().optional(),alphabetized:T.boolean().optional(),"sort-by-availability":T.array(yGc).optional(),flattened:T.boolean().optional(),paginated:T.boolean().optional(),playground:C6t.optional()})),S6t=T.lazy(()=>T.union([Gtt,uqc,lqc,Y9c,eEo,K9c,J9c,X9c])),uqc=kP.merge(FP).merge(T.object({section:T.string(),path:T.string().optional(),contents:T.array(S6t),collapsed:v6t.optional(),collapsible:T.boolean().optional(),"collapsed-by-default":T.boolean().optional(),slug:T.string().optional(),icon:T.string().optional(),hidden:T.boolean().optional(),"skip-slug":T.boolean().optional(),availability:Pfe.optional()})),pqc=T.array(S6t),fqc=kP.merge(FP).merge(T.object({title:T.string(),subtitle:T.string().optional(),icon:T.string().optional(),layout:T.array(S6t),slug:T.string().optional(),"skip-slug":T.boolean().optional(),hidden:T.boolean().optional(),default:T.boolean().optional()})),dqc=T.object({tab:Utt,layout:T.array(S6t).optional()}),mqc=T.object({tab:Utt,variants:T.array(fqc)}),hqc=T.union([dqc,mqc]),gqc=T.array(hqc),qkr=T.union([gqc,pqc]),Wkr=kP.merge(FP).merge(T.object({"display-name":T.string(),icon:T.string().optional(),slug:T.string().optional(),"skip-slug":T.boolean().optional(),hidden:T.boolean().optional(),href:T.string().optional(),target:Vtt.optional(),changelog:E6t.optional(),blog:E6t.optional()})),rEo=kP.merge(FP).merge(T.object({"display-name":T.string(),path:T.string().optional(),ref:T.string().optional(),slug:T.string().optional(),availability:bGc.optional(),audiences:I6t.optional(),hidden:T.boolean().optional(),announcement:Gkr.optional()})),ZMd=T.object({tabs:T.record(Utt,Wkr).optional(),"landing-page":Gtt.optional(),navigation:qkr}),nEo=kP.merge(FP).merge(T.object({"display-name":T.string(),subtitle:T.string().optional(),icon:T.string().optional(),image:T.string().optional(),versions:T.array(rEo).optional(),audiences:I6t.optional()})),Aqc=nEo.merge(T.object({path:T.string(),slug:T.string().optional(),announcement:Gkr.optional()})),yqc=nEo.merge(T.object({href:T.string(),target:Vtt.optional()})),bqc=T.union([Aqc,yqc]),Eqc=kP.merge(FP).merge(T.object({"display-name":T.string(),path:T.string(),slug:T.string().optional()})),Iqc=T.object({href:T.string()}),$Md=T.union([Eqc,Iqc]),eLd=T.object({tabs:T.record(Utt,Wkr).optional(),"landing-page":Gtt.optional(),navigation:qkr}),vqc=T.object({lang:Ukr,default:T.boolean().optional()}),Cqc=T.union([Ukr,vqc]);tLd=T.object({instances:T.array(I9c),title:T.string().optional(),libraries:T.record(Kbo,H9c).optional(),analytics:e9c.optional(),announcement:Gkr.optional(),roles:T.array(_kr).optional(),tabs:T.record(Utt,Wkr).optional(),versions:T.array(rEo).optional(),products:T.array(bqc).optional(),"landing-page":Gtt.optional(),navigation:qkr.optional(),"navbar-links":T.array(P9c).optional(),"footer-links":B9c.optional(),"page-actions":y9c.optional(),experimental:U9c.optional(),"default-language":dGc.optional(),languages:T.array(T.string()).optional(),translations:T.array(Cqc).optional().superRefine((e,t)=>{if(e==null)return;let n=e.map(xqc).filter(i=>i.default===!0).length;n>1&&t.addIssue({code:T.ZodIssueCode.custom,message:`Only one translation entry can be marked as default, but ${n} were found`})}),"ai-chat":Wbo.optional(),"ai-search":Wbo.optional(),"ai-examples":t9c.optional(),agents:s9c.optional(),metadata:N9c.optional(),redirects:j9c.optional(),check:Q9c.optional(),logo:v9c.optional(),favicon:T.string().optional(),"background-image":GGc.optional(),colors:h9c.optional(),typography:l9c.optional(),layout:f9c.optional(),settings:m9c.optional(),theme:u9c.optional(),"global-theme":T.string().optional(),integrations:M9c.optional(),css:qGc.optional(),js:F9c.optional(),header:T.string().optional(),footer:T.string().optional()})});function iLd(e){if("changelog"in e)return e.changelog;if("blog"in e)return e.blog}function oLd(e){return e.changelog??e.blog}var rLd,nLd,wqc=h(()=>{"use strict";rLd="Changelog",nLd="Blog"});var Tqc=h(()=>{"use strict"});var Oqc=h(()=>{"use strict"});var Pqc=h(()=>{"use strict"});var Bqc=h(()=>{"use strict"});var Dqc=h(()=>{"use strict"});var oEo,Rqc=h(()=>{"use strict";oEo={Docs:"docs",Slack:"slack",Discord:"discord"}});var sEo,kqc=h(()=>{"use strict";sEo={Claude37:"claude-3.7",Claude4:"claude-4",CommandA:"command-a"}});var Fqc=h(()=>{"use strict"});var Nqc=h(()=>{"use strict"});var jqc=h(()=>{"use strict"});var zqc=h(()=>{"use strict"});var Qqc=h(()=>{"use strict"});var Mqc=h(()=>{"use strict"});var aEo,Lqc=h(()=>{"use strict";aEo={Indented:"indented",Cards:"cards"}});var _qc=h(()=>{"use strict"});var Uqc=h(()=>{"use strict"});var Vqc=h(()=>{"use strict"});var Gqc=h(()=>{"use strict"});var qqc=h(()=>{"use strict"});var Wqc=h(()=>{"use strict"});var cEo,Hqc=h(()=>{"use strict";cEo={All:"all",Untyped:"untyped"}});var Kqc=h(()=>{"use strict"});var lEo,Jqc=h(()=>{"use strict";lEo={Get:"get",Post:"post",Put:"put",Patch:"patch",Delete:"delete",Head:"head",Options:"options",Trace:"trace"}});var Yqc=h(()=>{"use strict"});var Xqc=h(()=>{"use strict"});var Zqc=h(()=>{"use strict"});var uEo,$qc=h(()=>{"use strict";uEo={Openapi:"openapi",Asyncapi:"asyncapi",Graphql:"graphql"}});var eWc=h(()=>{"use strict"});var tWc=h(()=>{"use strict"});var pEo,rWc=h(()=>{"use strict";pEo={Stable:"stable",GenerallyAvailable:"generally-available",InDevelopment:"in-development",PreRelease:"pre-release",Deprecated:"deprecated",Beta:"beta",Alpha:"alpha",Preview:"preview",Legacy:"legacy"}});var nWc=h(()=>{"use strict"});var iWc=h(()=>{"use strict"});var oWc=h(()=>{"use strict"});var fEo,sWc=h(()=>{"use strict";fEo={Default:"default",Canvas:"canvas"}});var aWc=h(()=>{"use strict"});var cWc=h(()=>{"use strict"});var lWc=h(()=>{"use strict"});var dEo,uWc=h(()=>{"use strict";dEo={Timeline:"timeline",Classic:"classic"}});var pWc=h(()=>{"use strict"});var mEo,fWc=h(()=>{"use strict";mEo={Warn:"warn",Error:"error"}});var dWc=h(()=>{"use strict"});var mWc=h(()=>{"use strict"});var hEo,hWc=h(()=>{"use strict";hEo={GithubDark:"github-dark",GithubDarkDefault:"github-dark-default",GithubDarkDimmed:"github-dark-dimmed",GithubDarkHighContrast:"github-dark-high-contrast",GithubLight:"github-light",GithubLightDefault:"github-light-default",GithubLightHighContrast:"github-light-high-contrast",MaterialThemeDarker:"material-theme-darker",MinDark:"min-dark",MinLight:"min-light"}});var gEo,gWc=h(()=>{"use strict";gEo={OpenByDefault:"open-by-default"}});var AWc=h(()=>{"use strict"});var yWc=h(()=>{"use strict"});var bWc=h(()=>{"use strict"});var EWc=h(()=>{"use strict"});var AEo,IWc=h(()=>{"use strict";AEo={Center:"center",Left:"left"}});var vWc=h(()=>{"use strict"});var CWc=h(()=>{"use strict"});var xWc=h(()=>{"use strict"});var SWc=h(()=>{"use strict"});var wWc=h(()=>{"use strict"});var TWc=h(()=>{"use strict"});var OWc=h(()=>{"use strict"});var PWc=h(()=>{"use strict"});var yEo,BWc=h(()=>{"use strict";yEo={Github:"github",Dashboard:"dashboard"}});var DWc=h(()=>{"use strict"});var RWc=h(()=>{"use strict"});var kWc=h(()=>{"use strict"});var FWc=h(()=>{"use strict"});var NWc=h(()=>{"use strict"});var jWc=h(()=>{"use strict"});var zWc=h(()=>{"use strict"});var QWc=h(()=>{"use strict"});var MWc=h(()=>{"use strict"});var LWc=h(()=>{"use strict"});var _Wc=h(()=>{"use strict"});var bEo,UWc=h(()=>{"use strict";bEo={Auto:"auto",Block:"block",Swap:"swap",Fallback:"fallback",Optional:"optional"}});var EEo,VWc=h(()=>{"use strict";EEo={Normal:"normal",Italic:"italic"}});var GWc=h(()=>{"use strict"});var qWc=h(()=>{"use strict"});var IEo,WWc=h(()=>{"use strict";IEo={Default:"default",Minimal:"minimal"}});var HWc=h(()=>{"use strict"});var KWc=h(()=>{"use strict"});var JWc=h(()=>{"use strict"});var YWc=h(()=>{"use strict"});var XWc=h(()=>{"use strict"});var vEo,ZWc=h(()=>{"use strict";vEo={Fixed:"fixed",Static:"static"}});var CEo,$Wc=h(()=>{"use strict";CEo={Curl:"curl",Csharp:"csharp",Go:"go",Java:"java",Javascript:"javascript",Php:"php",Python:"python",Ruby:"ruby",Swift:"swift",Typescript:"typescript"}});var e7c=h(()=>{"use strict"});var t7c=h(()=>{"use strict"});var r7c=h(()=>{"use strict"});var n7c=h(()=>{"use strict"});var i7c=h(()=>{"use strict"});var o7c=h(()=>{"use strict"});var s7c=h(()=>{"use strict"});var a7c=h(()=>{"use strict"});var c7c=h(()=>{"use strict"});var xEo,l7c=h(()=>{"use strict";xEo={BeforeInteractive:"beforeInteractive",AfterInteractive:"afterInteractive",LazyOnload:"lazyOnload"}});var u7c=h(()=>{"use strict"});var SEo,p7c=h(()=>{"use strict";SEo={Default:"default",Minimal:"minimal"}});var f7c=h(()=>{"use strict"});var d7c=h(()=>{"use strict"});var m7c=h(()=>{"use strict"});var h7c=h(()=>{"use strict"});var wEo,g7c=h(()=>{"use strict";wEo={Python:"python",Cpp:"cpp"}});var A7c=h(()=>{"use strict"});var TEo,y7c=h(()=>{"use strict";TEo={Kind:"kind",Header:"header"}});var b7c=h(()=>{"use strict"});var E7c=h(()=>{"use strict"});var OEo,I7c=h(()=>{"use strict";OEo={Compact:"compact",Hyphenated:"hyphenated"}});var v7c=h(()=>{"use strict"});var C7c=h(()=>{"use strict"});var x7c=h(()=>{"use strict"});var S7c=h(()=>{"use strict"});var w7c=h(()=>{"use strict"});var T7c=h(()=>{"use strict"});var O7c=h(()=>{"use strict"});var P7c=h(()=>{"use strict"});var B7c=h(()=>{"use strict"});var D7c=h(()=>{"use strict"});var PEo,R7c=h(()=>{"use strict";PEo={Dark:"dark",Light:"light"}});var BEo,k7c=h(()=>{"use strict";BEo={CopyPage:"copy-page",ViewAsMarkdown:"view-as-markdown",AskAi:"ask-ai",Chatgpt:"chatgpt",Claude:"claude",Cursor:"cursor",ClaudeCode:"claude-code",Vscode:"vscode"}});var F7c=h(()=>{"use strict"});var N7c=h(()=>{"use strict"});var DEo,j7c=h(()=>{"use strict";DEo={Default:"default",Toolbar:"toolbar"}});var z7c=h(()=>{"use strict"});var REo,Q7c=h(()=>{"use strict";REo={Description:"description",Subtitle:"subtitle"}});var M7c=h(()=>{"use strict"});var L7c=h(()=>{"use strict"});var _7c=h(()=>{"use strict"});var U7c=h(()=>{"use strict"});var V7c=h(()=>{"use strict"});var G7c=h(()=>{"use strict"});var q7c=h(()=>{"use strict"});var W7c=h(()=>{"use strict"});var kEo,H7c=h(()=>{"use strict";kEo={Default:"default",Toggle:"toggle",Tabs:"tabs"}});var FEo,K7c=h(()=>{"use strict";FEo={Typescript:"typescript",Javascript:"javascript",Python:"python",Java:"java",Go:"go",Ruby:"ruby",Csharp:"csharp",Php:"php",Swift:"swift",Rust:"rust",Nodets:"nodets",Nodejs:"nodejs",Dotnet:"dotnet",Curl:"curl",Jvm:"jvm",Ts:"ts",Js:"js"}});var J7c=h(()=>{"use strict"});var Y7c=h(()=>{"use strict"});var X7c=h(()=>{"use strict"});var Z7c=h(()=>{"use strict"});var $7c=h(()=>{"use strict"});var NEo,eHc=h(()=>{"use strict";NEo={Header:"header",HeaderTabs:"header-tabs",Sidebar:"sidebar"}});var tHc=h(()=>{"use strict"});var rHc=h(()=>{"use strict"});var nHc=h(()=>{"use strict"});var jEo,iHc=h(()=>{"use strict";jEo={Default:"default",Minimal:"minimal"}});var oHc=h(()=>{"use strict"});var sHc=h(()=>{"use strict"});var aHc=h(()=>{"use strict"});var cHc=h(()=>{"use strict"});var lHc=h(()=>{"use strict"});var uHc=h(()=>{"use strict"});var zEo,pHc=h(()=>{"use strict";zEo={Unset:"unset",Stable:"stable",GenerallyAvailable:"generally-available",InDevelopment:"in-development",PreRelease:"pre-release",Deprecated:"deprecated",Beta:"beta",Alpha:"alpha",Preview:"preview",Legacy:"legacy"}});var QEo,fHc=h(()=>{"use strict";QEo={Header:"header",Sidebar:"sidebar"}});var dHc=h(()=>{"use strict"});var mHc=h(()=>{"use strict"});var hHc=h(()=>{"use strict"});var gHc=h(()=>{"use strict"});var AHc=h(()=>{"use strict"});var yHc=h(()=>{"use strict"});var MEo,bHc=h(()=>{"use strict";MEo={Left:"left",Center:"center"}});var LEo,EHc=h(()=>{"use strict";LEo={Header:"header",Sidebar:"sidebar"}});var IHc=h(()=>{"use strict"});var vHc=h(()=>{"use strict"});var _Eo,CHc=h(()=>{"use strict";_Eo={Default:"default",Bubble:"bubble"}});var xHc=h(()=>{"use strict"});var UEo,SHc=h(()=>{"use strict";UEo={Blank:"_blank",Self:"_self",Parent:"_parent",Top:"_top"}});var wHc=h(()=>{"use strict"});var VEo,THc=h(()=>{"use strict";VEo={Frontmatter:"frontmatter",Filename:"filename"}});var OHc=h(()=>{"use strict"});var PHc=h(()=>{"use strict"});var GEo,BHc=h(()=>{"use strict";GEo={Summary:"summary",SummaryLargeImage:"summary_large_image",App:"app",Player:"player"}});var DHc=h(()=>{"use strict"});var qEo,RHc=h(()=>{"use strict";qEo={Deprecated:"deprecated",Legacy:"legacy",Ga:"ga",Stable:"stable",Beta:"beta",Alpha:"alpha",Preview:"preview"}});var kHc=h(()=>{"use strict"});var FHc=h(()=>{"use strict"});var NHc=h(()=>{"use strict"});var WEo,jHc=h(()=>{"use strict";WEo={Flat:"flat",Grouped:"grouped"}});var zHc=h(()=>{"use strict"});var QHc=h(()=>{"use strict"});var MHc=h(()=>{"use strict"});var HEo=h(()=>{"use strict";Oqc();Pqc();Bqc();Dqc();Rqc();kqc();Fqc();Nqc();jqc();zqc();Qqc();Mqc();Lqc();_qc();Uqc();Vqc();Gqc();qqc();Wqc();Hqc();Kqc();Jqc();Yqc();Xqc();Zqc();$qc();eWc();tWc();rWc();nWc();iWc();oWc();sWc();aWc();cWc();lWc();uWc();pWc();fWc();dWc();mWc();hWc();gWc();AWc();yWc();bWc();EWc();IWc();vWc();CWc();xWc();SWc();wWc();TWc();OWc();PWc();BWc();DWc();RWc();kWc();FWc();NWc();jWc();zWc();QWc();MWc();LWc();_Wc();UWc();VWc();GWc();qWc();WWc();HWc();KWc();JWc();YWc();XWc();ZWc();$Wc();e7c();t7c();r7c();n7c();i7c();o7c();s7c();a7c();c7c();l7c();u7c();p7c();f7c();d7c();m7c();h7c();g7c();A7c();y7c();b7c();E7c();I7c();v7c();C7c();x7c();S7c();w7c();T7c();O7c();P7c();B7c();D7c();R7c();k7c();F7c();N7c();j7c();z7c();Q7c();M7c();L7c();_7c();U7c();V7c();G7c();q7c();W7c();H7c();K7c();J7c();Y7c();X7c();Z7c();$7c();eHc();tHc();rHc();nHc();iHc();oHc();sHc();aHc();cHc();lHc();uHc();pHc();fHc();dHc();mHc();hHc();gHc();AHc();yHc();bHc();EHc();IHc();vHc();CHc();xHc();SHc();wHc();THc();OHc();PHc();BHc();DHc();RHc();kHc();FHc();NHc();jHc();zHc();QHc();MHc()});var Hkr={};ne(Hkr,{AiChatLocation:()=>oEo,AiChatModel:()=>sEo,ApiReferenceLayout:()=>aEo,ApiSpecErrorResponseApplyTo:()=>cEo,ApiSpecErrorResponseHttpMethod:()=>lEo,ApiSpecType:()=>uEo,Availability:()=>pEo,BodyThemeConfig:()=>fEo,ChangelogLayout:()=>dEo,CheckRuleSeverity:()=>mEo,CodeBlockTheme:()=>hEo,CollapsedStringValue:()=>gEo,ContentAlignment:()=>AEo,EditThisPageLaunch:()=>yEo,FontDisplay:()=>bEo,FontStyle:()=>EEo,FooterNavThemeConfig:()=>IEo,HeaderPosition:()=>vEo,HttpSnippetLanguage:()=>CEo,JsScriptStrategy:()=>xEo,LanguageSwitcherThemeConfig:()=>SEo,LibraryLanguage:()=>wEo,LibraryOrganizeBy:()=>TEo,LibrarySlugStyle:()=>OEo,OgDynamicLogoColor:()=>PEo,PageActionOption:()=>BEo,PageActionsThemeConfig:()=>DEo,PageDescriptionSource:()=>REo,ProductSwitcherThemeConfig:()=>kEo,ProgrammingLanguage:()=>FEo,SearchbarPlacement:()=>NEo,SidebarThemeConfig:()=>jEo,SortByAvailabilityValue:()=>zEo,SwitcherPlacement:()=>QEo,TabsAlignment:()=>MEo,TabsPlacement:()=>LEo,TabsThemeStyle:()=>_Eo,Target:()=>UEo,TitleSource:()=>VEo,TwitterCardSetting:()=>GEo,VersionAvailability:()=>qEo,WebSocketOneofDisplay:()=>WEo});var LHc=h(()=>{"use strict";HEo()});var _Hc=h(()=>{"use strict";LHc();HEo()});var KEo={};ne(KEo,{AiChatLocation:()=>oEo,AiChatModel:()=>sEo,ApiReferenceLayout:()=>aEo,ApiSpecErrorResponseApplyTo:()=>cEo,ApiSpecErrorResponseHttpMethod:()=>lEo,ApiSpecType:()=>uEo,Availability:()=>pEo,BodyThemeConfig:()=>fEo,ChangelogLayout:()=>dEo,CheckRuleSeverity:()=>mEo,CodeBlockTheme:()=>hEo,CollapsedStringValue:()=>gEo,ContentAlignment:()=>AEo,EditThisPageLaunch:()=>yEo,FontDisplay:()=>bEo,FontStyle:()=>EEo,FooterNavThemeConfig:()=>IEo,HeaderPosition:()=>vEo,HttpSnippetLanguage:()=>CEo,JsScriptStrategy:()=>xEo,LanguageSwitcherThemeConfig:()=>SEo,LibraryLanguage:()=>wEo,LibraryOrganizeBy:()=>TEo,LibrarySlugStyle:()=>OEo,OgDynamicLogoColor:()=>PEo,PageActionOption:()=>BEo,PageActionsThemeConfig:()=>DEo,PageDescriptionSource:()=>REo,ProductSwitcherThemeConfig:()=>kEo,ProgrammingLanguage:()=>FEo,SearchbarPlacement:()=>NEo,SidebarThemeConfig:()=>jEo,SortByAvailabilityValue:()=>zEo,SwitcherPlacement:()=>QEo,TabsAlignment:()=>MEo,TabsPlacement:()=>LEo,TabsThemeStyle:()=>_Eo,Target:()=>UEo,TitleSource:()=>VEo,TwitterCardSetting:()=>GEo,VersionAvailability:()=>qEo,WebSocketOneofDisplay:()=>WEo,docs:()=>Hkr});var JEo=h(()=>{"use strict";_Hc()});var UHc,VHc=h(()=>{"use strict";UHc=(e,t,r)=>JSON.stringify(e,t,r)});function sLd({message:e,statusCode:t,body:r}){let n=[];return e!=null&&n.push(e),t!=null&&n.push(`Status code: ${t.toString()}`),r!=null&&n.push(`Body: ${UHc(r,void 0,2)}`),n.join(`
|
|
240
240
|
`)}var x6e,GHc=h(()=>{"use strict";VHc();x6e=class extends Error{statusCode;body;rawResponse;cause;constructor({message:t,statusCode:r,body:n,rawResponse:i,cause:o}){super(sLd({message:t,statusCode:r,body:n})),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="FernDocsConfigError",this.statusCode=r,this.body=n,this.rawResponse=i,o!=null&&(this.cause=o)}get requestId(){let t=this.rawResponse?.headers;if(t==null)return;let r=t.get("X-Request-Id");if(r!=null)return r;let n;return t.forEach((i,o)=>{n===void 0&&/request[-_]?id$/i.test(o)&&(n=i)}),n}}});var w6t,qHc=h(()=>{"use strict";YEo();w6t=class extends x6e{constructor(t,r){super({message:t,cause:r?.cause}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="FernDocsConfigTimeoutError"}}});var YEo=h(()=>{"use strict";GHc();qHc()});var SH,WHc,T6t,XEo,YE0,ZEo=h(()=>{"use strict";SH={Debug:"debug",Info:"info",Warn:"warn",Error:"error"},WHc={[SH.Debug]:1,[SH.Info]:2,[SH.Warn]:3,[SH.Error]:4},T6t=class{debug(t,...r){console.debug(t,...r)}info(t,...r){console.info(t,...r)}warn(t,...r){console.warn(t,...r)}error(t,...r){console.error(t,...r)}},XEo=class{level;logger;silent;constructor(t){this.level=WHc[t.level],this.logger=t.logger,this.silent=t.silent}shouldLog(t){return!this.silent&&this.level<=WHc[t]}isDebug(){return this.shouldLog(SH.Debug)}debug(t,...r){this.isDebug()&&this.logger.debug(t,...r)}isInfo(){return this.shouldLog(SH.Info)}info(t,...r){this.isInfo()&&this.logger.info(t,...r)}isWarn(){return this.shouldLog(SH.Warn)}warn(t,...r){this.isWarn()&&this.logger.warn(t,...r)}isError(){return this.shouldLog(SH.Error)}error(t,...r){this.isError()&&this.logger.error(t,...r)}},YE0=new XEo({level:SH.Info,logger:new T6t,silent:!0})});var $Eo,HHc=h(()=>{"use strict";ZEo();(function(e){e.LogLevel=SH,e.ConsoleLogger=T6t})($Eo||($Eo={}))});var KHc=h(()=>{"use strict";HHc()});var JHc=h(()=>{"use strict";KHc()});var YHc=h(()=>{"use strict"});var XHc=h(()=>{"use strict";ZEo()});var ZHc=h(()=>{"use strict"});var fl,XS=h(()=>{"use strict";fl={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",NEVER:"never",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",NULLABLE:"nullable",OPTIONAL:"optional",OPTIONAL_NULLABLE:"optionalNullable"}});function lm(e,t){return`Expected ${t}. Received ${uLd(e)}.`}function uLd(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}var _F=h(()=>{"use strict"});function ZS(e){return{...e,json:$Hc(e.json),parse:$Hc(e.parse)}}function $Hc(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(o=>" - "+(o.path.length>0?`${o.path.join(".")}: ${o.message}`:o.message))].join(`
|
|
241
|
-
`)),{ok:!0,value:t}):n}}var yee=h(()=>{"use strict"});function Kkr(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var e0o=h(()=>{"use strict"});var qtt,t0o=h(()=>{"use strict";e0o();qtt=class e extends Error{errors;constructor(t){super(t.map(Kkr).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype),this.name="JsonError"}}});var Wtt,r0o=h(()=>{"use strict";e0o();Wtt=class e extends Error{errors;constructor(t){super(t.map(Kkr).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype),this.name="ParseError"}}});function um(e){return{nullable:()=>pLd(e),optional:()=>n0o(e),optionalNullable:()=>fLd(e),transform:t=>i0o(e,t),parseOrThrow:(t,r)=>{let n=e.parse(t,r);if(n.ok)return n.value;throw new Wtt(n.errors)},jsonOrThrow:(t,r)=>{let n=e.json(t,r);if(n.ok)return n.value;throw new qtt(n.errors)}}}function pLd(e){let t={parse:(r,n)=>r==null?{ok:!0,value:null}:e.parse(r,n),json:(r,n)=>r==null?{ok:!0,value:null}:e.json(r,n),getType:()=>fl.NULLABLE};return{...t,...um(t)}}function n0o(e){let t={parse:(r,n)=>r==null?{ok:!0,value:void 0}:e.parse(r,n),json:(r,n)=>n?.omitUndefined&&r===void 0?{ok:!0,value:void 0}:r==null?{ok:!0,value:null}:e.json(r,n),getType:()=>fl.OPTIONAL};return{...t,...um(t)}}function fLd(e){let t={parse:(r,n)=>r===void 0?{ok:!0,value:void 0}:r===null?{ok:!0,value:null}:e.parse(r,n),json:(r,n)=>r===void 0?{ok:!0,value:void 0}:r===null?{ok:!0,value:null}:e.json(r,n),getType:()=>fl.OPTIONAL_NULLABLE};return{...t,...um(t)}}function i0o(e,t){let r={parse:(n,i)=>{let o=e.parse(n,i);return o.ok?{ok:!0,value:t.transform(o.value)}:o},json:(n,i)=>{let o=t.untransform(n);return e.json(o,i)},getType:()=>e.getType()};return{...r,...um(r)}}var eKc=h(()=>{"use strict";XS();t0o();r0o()});var Qz=h(()=>{"use strict";eKc();t0o();r0o()});function tKc(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t=="bigint"?{ok:!0,value:t}:typeof t=="number"?{ok:!0,value:BigInt(t)}:{ok:!1,errors:[{path:r,message:lm(t,"bigint | number")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="bigint"?{ok:!1,errors:[{path:r,message:lm(t,"bigint")}]}:{ok:!0,value:t},getType:()=>fl.BIGINT};return{...ZS(e),...um(e)}}var rKc=h(()=>{"use strict";XS();_F();yee();Qz()});var nKc=h(()=>{"use strict";rKc()});function iKc(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:lm(t,"string")}]}:dLd.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:lm(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:lm(t,"Date object")}]},getType:()=>fl.DATE};return{...ZS(e),...um(e)}}var dLd,oKc=h(()=>{"use strict";XS();_F();yee();Qz();dLd=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/});var sKc=h(()=>{"use strict";oKc()});function N1(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return{...ZS(r),...um(r)}}}var bee=h(()=>{"use strict";Qz();yee()});function O6t(e){let t=new Set(e);return N1(fl.ENUM,(n,{allowUnrecognizedEnumValues:i,breadcrumbsPrefix:o=[]}={})=>typeof n!="string"?{ok:!1,errors:[{path:o,message:lm(n,"string")}]}:!t.has(n)&&!i?{ok:!1,errors:[{path:o,message:lm(n,"enum")}]}:{ok:!0,value:n})()}function aKc(e){return O6t(e).transform({transform:t=>t,untransform:t=>t})}var cKc=h(()=>{"use strict";XS();bee();_F()});var o0o=h(()=>{"use strict";cKc()});function lKc(e){let t=s0o(e);return{...t,...um(t)}}function s0o(e){return{parse:(t,r)=>Htt(e).parse(t,r),json:(t,r)=>Htt(e).json(t,r),getType:()=>Htt(e).getType()}}function Htt(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}var a0o=h(()=>{"use strict";Qz()});function c0o(e){return Object.entries(e)}var uKc=h(()=>{"use strict"});function P6t(e,t){let r=new Set(t);return Object.entries(e).reduce((n,[i,o])=>(r.has(i)&&(n[i]=o),n),{})}var l0o=h(()=>{"use strict"});function Bfe(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return t===null?!0:Object.getPrototypeOf(t)===null}var B6t=h(()=>{"use strict"});function D6t(e){return Object.keys(e)}var u0o=h(()=>{"use strict"});function pKc(e,t){let r=[],n=[];for(let i of e)t(i)?r.push(i):n.push(i);return[r,n]}var fKc=h(()=>{"use strict"});function wH(e){return{withParsedProperties:t=>p0o(e,t)}}function p0o(e,t){let r={parse:(n,i)=>{let o=e.parse(n,i);if(!o.ok)return o;let s={};for(let a in t)if(mLd.call(t,a)){let c=t[a];s[a]=typeof c=="function"?c(o.value):c}return{ok:!0,value:{...o.value,...s}}},json:(n,i)=>{if(!Bfe(n))return{ok:!1,errors:[{path:i?.breadcrumbsPrefix??[],message:lm(n,"object")}]};let o=new Set(Object.keys(t)),s=P6t(n,Object.keys(n).filter(a=>!o.has(a)));return e.json(s,i)},getType:()=>e.getType()};return{...r,...um(r),...wH(r)}}var mLd,dKc=h(()=>{"use strict";l0o();_F();B6t();Qz();mLd=Object.prototype.hasOwnProperty});var R6t=h(()=>{"use strict";dKc()});function mKc(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function Dfe(e){return e.isProperty}var f0o=h(()=>{"use strict"});function Jkr(e){let t;function r(){if(t==null){t={};for(let[d,f]of c0o(e)){let m=Dfe(f)?f.rawKey:d,g=Dfe(f)?f.valueSchema:f;t[m]={rawKey:m,parsedKey:d,valueSchema:g}}}return t}let n,i,o,s;function a(){if(n==null){n=[],i=[];for(let[d,f]of c0o(e)){let m=Dfe(f)?f.rawKey:d,g=Dfe(f)?f.valueSchema:f;gLd(g)&&(n.push(m),i.push(d))}o=new Set(n),s=new Set(i)}return n}function c(){return i==null&&a(),i}function l(){return o==null&&a(),o}function u(){return s==null&&a(),s}let p={_getRawProperties:()=>Object.entries(e).map(([d,f])=>Dfe(f)?f.rawKey:d),_getParsedProperties:()=>D6t(e),parse:(d,f)=>{let m=f?.breadcrumbsPrefix??[];return hKc({value:d,requiredKeys:a(),requiredKeysSet:l(),getProperty:g=>{let A=r()[g];if(A!=null)return{transformedKey:A.parsedKey,transform:y=>{let I=[...m,g];return A.valueSchema.parse(y,{...f,breadcrumbsPrefix:I})}}},unrecognizedObjectKeys:f?.unrecognizedObjectKeys,skipValidation:f?.skipValidation,breadcrumbsPrefix:m,omitUndefined:f?.omitUndefined})},json:(d,f)=>{let m=f?.breadcrumbsPrefix??[];return hKc({value:d,requiredKeys:c(),requiredKeysSet:u(),getProperty:g=>{let A=e[g];if(A!=null)return Dfe(A)?{transformedKey:A.rawKey,transform:y=>{let I=[...m,g];return A.valueSchema.json(y,{...f,breadcrumbsPrefix:I})}}:{transformedKey:g,transform:y=>{let I=[...m,g];return A.json(y,{...f,breadcrumbsPrefix:I})}}},unrecognizedObjectKeys:f?.unrecognizedObjectKeys,skipValidation:f?.skipValidation,breadcrumbsPrefix:m,omitUndefined:f?.omitUndefined})},getType:()=>fl.OBJECT};return{...ZS(p),...um(p),...wH(p),...S6e(p)}}function hKc({value:e,requiredKeys:t,requiredKeysSet:r,getProperty:n,unrecognizedObjectKeys:i="fail",skipValidation:o=!1,breadcrumbsPrefix:s=[]}){if(!Bfe(e))return{ok:!1,errors:[{path:s,message:lm(e,"object")}]};let a=t.length,c=[],l={};for(let u in e){if(!hLd.call(e,u))continue;let p=e[u],d=n(u);if(d!=null){a>0&&r.has(u)&&a--;let f=d.transform(p);if(f.ok)l[d.transformedKey]=f.value;else{l[u]=p;for(let m of f.errors)c.push(m)}}else switch(i){case"fail":c.push({path:[...s,u],message:`Unexpected key "${u}"`});break;case"strip":break;case"passthrough":l[u]=p;break}}if(a>0)for(let u of t)u in e||c.push({path:s,message:`Missing required key "${u}"`});return c.length===0||o?{ok:!0,value:l}:{ok:!1,errors:c}}function S6e(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(n,i)=>gKc({extensionKeys:t._getRawProperties(),value:n,transformBase:o=>e.parse(o,i),transformExtension:o=>t.parse(o,i),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>gKc({extensionKeys:t._getParsedProperties(),value:n,transformBase:o=>e.json(o,i),transformExtension:o=>t.json(o,i),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>fl.OBJECT};return{...r,...um(r),...wH(r),...S6e(r)}},passthrough:()=>{let t=new Set(e._getRawProperties()),r=new Set(e._getParsedProperties()),n={_getParsedProperties:()=>e._getParsedProperties(),_getRawProperties:()=>e._getRawProperties(),parse:(i,o)=>{let s=e.parse(i,{...o,unrecognizedObjectKeys:"passthrough"});if(!s.ok)return s;let a={};if(typeof i=="object"&&i!=null)for(let[c,l]of Object.entries(i))t.has(c)||(a[c]=l);return{ok:!0,value:{...a,...s.value}}},json:(i,o)=>{let s=e.json(i,{...o,unrecognizedObjectKeys:"passthrough"});if(!s.ok)return s;let a={};if(typeof i=="object"&&i!=null)for(let[c,l]of Object.entries(i))r.has(c)||(a[c]=l);return{ok:!0,value:{...a,...s.value}}},getType:()=>fl.OBJECT};return{...n,...um(n),...wH(n),...S6e(n)}}}}function gKc({extensionKeys:e,value:t,transformBase:r,transformExtension:n,breadcrumbsPrefix:i=[]}){if(!Bfe(t))return{ok:!1,errors:[{path:i,message:lm(t,"object")}]};let o=new Set(e),[s,a]=pKc(D6t(t),u=>o.has(u)),c=r(P6t(t,a)),l=n(P6t(t,s));return c.ok&&l.ok?{ok:!0,value:{...c.value,...l.value}}:{ok:!1,errors:[...c.ok?[]:c.errors,...l.ok?[]:l.errors]}}function gLd(e){return!ALd(e)}function ALd(e){switch(e.getType()){case fl.ANY:case fl.UNKNOWN:case fl.OPTIONAL:case fl.OPTIONAL_NULLABLE:return!0;default:return!1}}var hLd,d0o=h(()=>{"use strict";XS();uKc();l0o();_F();B6t();u0o();yee();fKc();R6t();Qz();f0o();hLd=Object.prototype.hasOwnProperty});function AKc(e){return Jkr(e)}var yKc=h(()=>{"use strict";d0o()});var m0o=h(()=>{"use strict";d0o();yKc();f0o()});function bKc(e){let t={...s0o(e),_getRawProperties:()=>Htt(e)._getRawProperties(),_getParsedProperties:()=>Htt(e)._getParsedProperties()};return{...t,...um(t),...wH(t),...S6e(t)}}var EKc=h(()=>{"use strict";m0o();R6t();Qz();a0o()});var IKc=h(()=>{"use strict";a0o();EKc()});function Ykr(e){let t={parse:(r,n)=>vKc(r,(i,o)=>e.parse(i,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`[${o}]`]})),json:(r,n)=>vKc(r,(i,o)=>e.json(i,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`[${o}]`]})),getType:()=>fl.LIST};return{...ZS(t),...um(t)}}function vKc(e,t){if(!Array.isArray(e))return{ok:!1,errors:[{message:lm(e,"list"),path:[]}]};let r=[],n=[];for(let i=0;i<e.length;i++){let o=t(e[i],i);if(o.ok)r.push(o.value);else for(let s of o.errors)n.push(s)}return n.length===0?{ok:!0,value:r}:{ok:!1,errors:n}}var CKc=h(()=>{"use strict";XS();_F();yee();Qz()});var h0o=h(()=>{"use strict";CKc()});function xKc(e){return N1(fl.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:lm(r,`${e.toString()}`)}]})()}var SKc=h(()=>{"use strict";XS();bee();_F()});function wKc(e){return N1(fl.STRING_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:lm(r,`"${e}"`)}]})()}var TKc=h(()=>{"use strict";XS();bee();_F()});var OKc=h(()=>{"use strict";SKc();TKc()});var PKc,BKc=h(()=>{"use strict";XS();bee();PKc=N1(fl.ANY,e=>({ok:!0,value:e}))});var DKc,RKc=h(()=>{"use strict";XS();bee();_F();DKc=N1(fl.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:lm(e,"boolean")}]})});var kKc,FKc=h(()=>{"use strict";XS();bee();kKc=N1(fl.NEVER,(e,{breadcrumbsPrefix:t=[]}={})=>({ok:!1,errors:[{path:t,message:"Expected never"}]}))});var NKc,jKc=h(()=>{"use strict";XS();bee();_F();NKc=N1(fl.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:lm(e,"number")}]})});var zKc,QKc=h(()=>{"use strict";XS();bee();_F();zKc=N1(fl.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:lm(e,"string")}]})});var MKc,LKc=h(()=>{"use strict";XS();bee();MKc=N1(fl.UNKNOWN,e=>({ok:!0,value:e}))});var _Kc=h(()=>{"use strict";BKc();RKc();FKc();jKc();QKc();LKc()});function UKc(e,t){let r={parse:(n,i)=>Xkr({value:n,isKeyNumeric:e.getType()===fl.NUMBER,transformKey:o=>e.parse(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o} (key)`]}),transformValue:(o,s)=>t.parse(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>Xkr({value:n,isKeyNumeric:e.getType()===fl.NUMBER,transformKey:o=>e.json(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o} (key)`]}),transformValue:(o,s)=>t.json(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>fl.RECORD};return{...ZS(r),...um(r)}}function VKc(e,t){let r={parse:(n,i)=>Xkr({value:n,isKeyNumeric:e.getType()===fl.NUMBER,transformKey:o=>e.parse(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o} (key)`]}),transformValue:(o,s)=>t.parse(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>Xkr({value:n,isKeyNumeric:e.getType()===fl.NUMBER,transformKey:o=>e.json(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o} (key)`]}),transformValue:(o,s)=>t.json(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>fl.RECORD};return{...ZS(r),...um(r)}}function Xkr({value:e,isKeyNumeric:t,transformKey:r,transformValue:n,breadcrumbsPrefix:i=[]}){if(!Bfe(e))return{ok:!1,errors:[{path:i,message:lm(e,"object")}]};let o={},s=[];for(let a in e){if(!yLd.call(e,a))continue;let c=e[a];if(c===void 0)continue;let l=a;if(t){let d=a.length>0?Number(a):NaN;Number.isNaN(d)||(l=d)}let u=r(l),p=n(c,l);if(u.ok&&p.ok)o[u.value]=p.value;else{if(!u.ok)for(let d of u.errors)s.push(d);if(!p.ok)for(let d of p.errors)s.push(d)}}return s.length===0?{ok:!0,value:o}:{ok:!1,errors:s}}var yLd,GKc=h(()=>{"use strict";XS();_F();B6t();yee();Qz();yLd=Object.prototype.hasOwnProperty});var qKc=h(()=>{"use strict";GKc()});function WKc(e){let t=Ykr(e),r={parse:(n,i)=>{let o=t.parse(n,i);return o.ok?{ok:!0,value:new Set(o.value)}:o},json:(n,i)=>n instanceof Set?t.json([...n],i):{ok:!1,errors:[{path:i?.breadcrumbsPrefix??[],message:lm(n,"Set")}]},getType:()=>fl.SET};return{...ZS(r),...um(r)}}var HKc=h(()=>{"use strict";XS();_F();yee();h0o();Qz()});var KKc=h(()=>{"use strict";HKc()});function YKc(e){let t={parse:(r,n)=>JKc((i,o)=>i.parse(r,o),e,n),json:(r,n)=>JKc((i,o)=>i.json(r,o),e,n),getType:()=>fl.UNDISCRIMINATED_UNION};return{...ZS(t),...um(t)}}function JKc(e,t,r){let n=[];for(let[i,o]of t.entries()){let s=e(o,{...r,skipValidation:!1});if(s.ok)return s;for(let a of s.errors)n.push({path:a.path,message:`[Variant ${i}] ${a.message}`})}return{ok:!1,errors:n}}var XKc=h(()=>{"use strict";XS();yee();Qz()});var ZKc=h(()=>{"use strict";XKc()});function $Kc(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}var eJc=h(()=>{"use strict"});function rJc(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,n=typeof e=="string"?e:e.parsedDiscriminant,i=O6t(D6t(t)),o={parse:(s,a)=>tJc({value:s,discriminant:r,transformedDiscriminant:n,transformDiscriminantValue:c=>i.parse(c,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...a?.breadcrumbsPrefix??[],r]}),getAdditionalPropertiesSchema:c=>t[c],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(c,l)=>l.parse(c,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),json:(s,a)=>tJc({value:s,discriminant:n,transformedDiscriminant:r,transformDiscriminantValue:c=>i.json(c,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...a?.breadcrumbsPrefix??[],n]}),getAdditionalPropertiesSchema:c=>t[c],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(c,l)=>l.json(c,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),getType:()=>fl.UNION};return{...ZS(o),...um(o),...wH(o)}}function tJc({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:n,getAdditionalPropertiesSchema:i,allowUnrecognizedUnionMembers:o=!1,transformAdditionalProperties:s,breadcrumbsPrefix:a=[]}){if(!Bfe(e))return{ok:!1,errors:[{path:a,message:lm(e,"object")}]};let c=e[t],l={};for(let f in e)bLd.call(e,f)&&f!==t&&(l[f]=e[f]);if(c==null)return{ok:!1,errors:[{path:a,message:`Missing discriminant ("${t}")`}]};let u=n(c);if(!u.ok)return{ok:!1,errors:u.errors};let p=i(u.value);if(p==null)return o?{ok:!0,value:{[r]:u.value,...l}}:{ok:!1,errors:[{path:[...a,t],message:"Unexpected discriminant value"}]};let d=s(l,p);return d.ok?{ok:!0,value:{[r]:c,...d.value}}:d}var bLd,nJc=h(()=>{"use strict";XS();_F();B6t();u0o();yee();o0o();R6t();Qz();bLd=Object.prototype.hasOwnProperty});var iJc=h(()=>{"use strict";eJc();nJc()});var oJc=h(()=>{"use strict";nKc();sKc();o0o();IKc();h0o();OKc();m0o();R6t();_Kc();qKc();Qz();KKc();ZKc();iJc()});var re={};ne(re,{JsonError:()=>qtt,ParseError:()=>Wtt,any:()=>PKc,bigint:()=>tKc,boolean:()=>DKc,booleanLiteral:()=>xKc,date:()=>iKc,discriminant:()=>$Kc,enum_:()=>O6t,forwardCompatibleEnum_:()=>aKc,getObjectLikeUtils:()=>wH,getObjectUtils:()=>S6e,getSchemaUtils:()=>um,isProperty:()=>Dfe,lazy:()=>lKc,lazyObject:()=>bKc,list:()=>Ykr,never:()=>kKc,number:()=>NKc,object:()=>Jkr,objectWithoutOptionalProperties:()=>AKc,optional:()=>n0o,partialRecord:()=>VKc,property:()=>mKc,record:()=>UKc,set:()=>WKc,string:()=>zKc,stringLiteral:()=>wKc,transform:()=>i0o,undiscriminatedUnion:()=>YKc,union:()=>rJc,unknown:()=>MKc,withParsedProperties:()=>p0o});var sJc=h(()=>{"use strict";oJc()});var aJc=h(()=>{"use strict"});var Sr=h(()=>{"use strict";YHc();XHc();ZHc();sJc();aJc()});var Zkr,g0o=h(()=>{"use strict";Sr();Zkr=re.object({href:re.string()})});var $kr,A0o=h(()=>{"use strict";Sr();$kr=re.enum_(["description","subtitle"])});var eFr,y0o=h(()=>{"use strict";Sr();A0o();eFr=re.object({pageDirective:re.property("page-directive",re.string().optional()),pageDescriptionSource:re.property("page-description-source",$kr.optional()),llmsTxt:re.property("llms-txt",re.string().optional()),llmsFullTxt:re.property("llms-full-txt",re.string().optional()),robotsTxt:re.property("robots-txt",re.string().optional())})});var tFr,b0o=h(()=>{"use strict";Sr();tFr=re.object({url:re.string(),title:re.string().optional()})});var rFr,E0o=h(()=>{"use strict";Sr();b0o();rFr=re.undiscriminatedUnion([tFr])});var nFr,I0o=h(()=>{"use strict";Sr();nFr=re.enum_(["docs","slack","discord"])});var iFr,v0o=h(()=>{"use strict";Sr();iFr=re.enum_(["claude-3.7","claude-4","command-a"])});var k6t,C0o=h(()=>{"use strict";Sr();E0o();I0o();v0o();k6t=re.object({model:iFr.optional(),systemPrompt:re.property("system-prompt",re.string().optional()),location:re.list(nFr).optional(),datasources:re.list(rFr).optional(),maskPii:re.property("mask-pii",re.boolean().optional()),disclaimer:re.string().optional()})});var oFr,x0o=h(()=>{"use strict";Sr();oFr=re.object({enabled:re.boolean().optional(),style:re.string().optional()})});var sFr,S0o=h(()=>{"use strict";Sr();sFr=re.object({orgId:re.property("org-id",re.string())})});var aFr,w0o=h(()=>{"use strict";Sr();aFr=re.object({measurementId:re.property("measurement-id",re.string())})});var cFr,T0o=h(()=>{"use strict";Sr();cFr=re.object({containerId:re.property("container-id",re.string())})});var lFr,O0o=h(()=>{"use strict";Sr();lFr=re.object({appId:re.property("app-id",re.string()),apiBase:re.property("api-base",re.string().optional())})});var uFr,P0o=h(()=>{"use strict";Sr();uFr=re.object({apiKey:re.property("api-key",re.string()),endpoint:re.string().optional()})});var pFr,B0o=h(()=>{"use strict";Sr();pFr=re.object({writeKey:re.property("write-key",re.string())})});var fFr,D0o=h(()=>{"use strict";Sr();S0o();w0o();T0o();O0o();P0o();B0o();fFr=re.object({segment:pFr.optional(),fullstory:sFr.optional(),intercom:lFr.optional(),posthog:uFr.optional(),gtm:cFr.optional(),ga4:aFr.optional()})});var pve,F6t=h(()=>{"use strict";Sr();pve=re.object({message:re.string()})});var dFr,R0o=h(()=>{"use strict";Sr();dFr=re.enum_(["all","untyped"])});var mFr,k0o=h(()=>{"use strict";Sr();mFr=re.enum_(["get","post","put","patch","delete","head","options","trace"])});var hFr,F0o=h(()=>{"use strict";Sr();k0o();hFr=re.object({statusCode:re.property("status-code",re.number()),methods:re.list(mFr).optional()})});var gFr,N0o=h(()=>{"use strict";Sr();gFr=re.undiscriminatedUnion([re.string(),re.record(re.string(),re.unknown())])});var AFr,j0o=h(()=>{"use strict";Sr();R0o();F0o();N0o();AFr=re.object({schema:gFr,name:re.string().optional(),applyTo:re.property("apply-to",dFr.optional()),ensure:re.list(hFr).optional()})});var yFr,z0o=h(()=>{"use strict";Sr();j0o();yFr=re.object({typeDatesAsStrings:re.property("type-dates-as-strings",re.boolean().optional()),useBytesForBinaryResponse:re.property("use-bytes-for-binary-response",re.boolean().optional()),respectParameterContent:re.property("respect-parameter-content",re.boolean().optional()),respectOperationIdWordBoundaries:re.property("respect-operation-id-word-boundaries",re.boolean().optional()),inferForwardCompatible:re.property("infer-forward-compatible",re.boolean().optional()),preserveOneOfInAllOf:re.property("preserve-one-of-in-all-of",re.boolean().optional()),anyOfSiblingPropertiesAsObject:re.property("any-of-sibling-properties-as-object",re.boolean().optional()),errorResponses:re.property("error-responses",AFr.optional())})});var bFr,Q0o=h(()=>{"use strict";Sr();bFr=re.enum_(["openapi","asyncapi","graphql"])});var EFr,M0o=h(()=>{"use strict";Sr();z0o();Q0o();EFr=re.object({type:bFr,path:re.string(),namespace:re.string().optional(),overlays:re.string().optional(),overrides:re.list(re.string()).optional(),settings:yFr.optional()})});var N6t,L0o=h(()=>{"use strict";Sr();N6t=re.string()});var Eee,Ktt=h(()=>{"use strict";Sr();L0o();Eee=re.undiscriminatedUnion([N6t,re.list(N6t)])});var j1,Iee=h(()=>{"use strict";Sr();j1=re.enum_(["stable","generally-available","in-development","pre-release","deprecated","beta","alpha","preview","legacy"])});var IFr,_0o=h(()=>{"use strict";Sr();IFr=re.enum_(["open-by-default"])});var vee,Jtt=h(()=>{"use strict";Sr();_0o();vee=re.undiscriminatedUnion([re.boolean(),IFr])});var vFr,U0o=h(()=>{"use strict";Sr();vFr=re.object({href:re.string().optional()})});var Cee,Ytt=h(()=>{"use strict";Sr();U0o();Cee=re.object({hidden:re.boolean().optional(),environments:re.list(re.string()).optional(),button:vFr.optional(),oauth:re.boolean().optional(),limitWebsocketMessagesPerConnection:re.property("limit-websocket-messages-per-connection",re.number().optional()),sendOptionalDefaults:re.property("send-optional-defaults",re.boolean().optional())})});var CFr,V0o=h(()=>{"use strict";Sr();CFr=re.object({version:re.string(),package:re.string()})});var K6,G0o=h(()=>{"use strict";Sr();V0o();K6=re.undiscriminatedUnion([re.string(),CFr])});var xFr,q0o=h(()=>{"use strict";Sr();G0o();xFr=re.object({python:K6.optional(),typescript:K6.optional(),go:K6.optional(),java:K6.optional(),ruby:K6.optional(),csharp:K6.optional(),php:K6.optional(),swift:K6.optional(),rust:K6.optional(),cli:K6.optional()})});var SFr,W0o=h(()=>{"use strict";Sr();SFr=re.enum_(["unset","stable","generally-available","in-development","pre-release","deprecated","beta","alpha","preview","legacy"])});var j6t,H0o=h(()=>{"use strict";Sr();j6t=re.object({flag:re.string(),fallbackValue:re.property("fallback-value",re.unknown().optional()),match:re.unknown().optional()})});var wFr,K0o=h(()=>{"use strict";Sr();H0o();wFr=re.undiscriminatedUnion([re.string(),j6t,re.list(j6t)])});var Bd,z1=h(()=>{"use strict";Sr();K0o();Bd=re.object({featureFlag:re.property("feature-flag",wFr.optional())})});var w6e,TFr=h(()=>{"use strict";Sr();w6e=re.string()});var Xtt,OFr=h(()=>{"use strict";Sr();TFr();Xtt=re.undiscriminatedUnion([w6e,re.list(w6e)])});var Dd,Q1=h(()=>{"use strict";Sr();OFr();Dd=re.object({viewers:Xtt.optional(),orphaned:re.boolean().optional()})});var PFr,J0o=h(()=>{"use strict";Sr();J6();M0o();Ktt();Iee();Jtt();Ytt();q0o();W0o();z1();Q1();PFr=re.object({api:re.string(),apiName:re.property("api-name",re.string().optional()),specs:re.list(EFr).optional(),openrpc:re.string().optional(),audiences:Eee.optional(),displayErrors:re.property("display-errors",re.boolean().optional()),tagDescriptionPages:re.property("tag-description-pages",re.boolean().optional()),snippets:xFr.optional(),postman:re.string().optional(),summary:re.string().optional(),layout:re.list(re.lazy(()=>xee)).optional(),collapsed:vee.optional(),icon:re.string().optional(),slug:re.string().optional(),hidden:re.boolean().optional(),availability:j1.optional(),skipSlug:re.property("skip-slug",re.boolean().optional()),alphabetized:re.boolean().optional(),sortByAvailability:re.property("sort-by-availability",re.list(SFr).optional()),flattened:re.boolean().optional(),paginated:re.boolean().optional(),playground:Cee.optional()}).extend(Dd).extend(Bd)});var BFr,Y0o=h(()=>{"use strict";Sr();Iee();Ytt();z1();Q1();BFr=re.object({endpoint:re.string(),title:re.string().optional(),slug:re.string().optional(),icon:re.string().optional(),hidden:re.boolean().optional(),availability:j1.optional(),playground:Cee.optional()}).extend(Dd).extend(Bd)});var DFr,X0o=h(()=>{"use strict";Sr();DFr=re.enum_(["indented","cards"])});var RFr,Z0o=h(()=>{"use strict";Sr();Iee();z1();Q1();RFr=re.object({operation:re.string(),title:re.string().optional(),slug:re.string().optional(),hidden:re.boolean().optional(),availability:j1.optional()}).extend(Dd).extend(Bd)});var jV,T6e=h(()=>{"use strict";Sr();jV=re.enum_(["_blank","_self","_parent","_top"])});var Ztt,kFr=h(()=>{"use strict";Sr();T6e();Ztt=re.object({link:re.string(),href:re.string(),icon:re.string().optional(),target:jV.optional()})});var zV,O6e=h(()=>{"use strict";Sr();Iee();z1();Q1();zV=re.object({page:re.string(),path:re.string(),slug:re.string().optional(),icon:re.string().optional(),hidden:re.boolean().optional(),noindex:re.boolean().optional(),availability:j1.optional()}).extend(Dd).extend(Bd)});var xee,cJc=h(()=>{"use strict";Sr();J6();Y0o();Z0o();kFr();O6e();xee=re.undiscriminatedUnion([re.string(),re.record(re.string(),re.lazy(()=>FFr)),re.lazyObject(()=>NFr),BFr,RFr,zV,Ztt])});var FFr,lJc=h(()=>{"use strict";Sr();J6();FFr=re.undiscriminatedUnion([re.list(re.lazy(()=>xee)),re.lazyObject(()=>jFr)])});var jFr,uJc=h(()=>{"use strict";Sr();J6();Iee();Ytt();z1();Q1();jFr=re.object({title:re.string().optional(),summary:re.string().optional(),contents:re.list(re.lazy(()=>xee)).optional(),availability:j1.optional(),slug:re.string().optional(),icon:re.string().optional(),hidden:re.boolean().optional(),skipSlug:re.property("skip-slug",re.boolean().optional()),playground:Cee.optional()}).extend(Dd).extend(Bd)});var NFr,pJc=h(()=>{"use strict";Sr();J6();Iee();Jtt();Ytt();z1();Q1();NFr=re.object({section:re.string(),referencedPackages:re.property("referenced-packages",re.list(re.string()).optional()),summary:re.string().optional(),contents:re.list(re.lazy(()=>xee)).optional(),slug:re.string().optional(),icon:re.string().optional(),hidden:re.boolean().optional(),skipSlug:re.property("skip-slug",re.boolean().optional()),collapsed:vee.optional(),collapsible:re.boolean().optional(),collapsedByDefault:re.property("collapsed-by-default",re.boolean().optional()),availability:j1.optional(),playground:Cee.optional()}).extend(Dd).extend(Bd)});var zFr,$0o=h(()=>{"use strict";Sr();zFr=re.object({dark:re.string().optional(),light:re.string().optional()})});var QFr,eIo=h(()=>{"use strict";Sr();$0o();QFr=re.undiscriminatedUnion([re.string(),zFr])});var Rfe,z6t=h(()=>{"use strict";Sr();Rfe=re.string()});var MFr,tIo=h(()=>{"use strict";Sr();z6t();z1();Q1();MFr=re.object({blog:Rfe,title:re.string().optional(),slug:re.string().optional(),icon:re.string().optional(),hidden:re.boolean().optional()}).extend(Dd).extend(Bd)});var LFr,rIo=h(()=>{"use strict";Sr();LFr=re.enum_(["default","canvas"])});var _Fr,nIo=h(()=>{"use strict";Sr();_Fr=re.object({currentPage:re.property("current-page",re.boolean().optional())})});var $tt,UFr=h(()=>{"use strict";Sr();z6t();z1();Q1();$tt=re.object({changelog:Rfe,title:re.string().optional(),slug:re.string().optional(),icon:re.string().optional(),hidden:re.boolean().optional()}).extend(Dd).extend(Bd)});var VFr,iIo=h(()=>{"use strict";Sr();VFr=re.enum_(["timeline","classic"])});var TH,oIo=h(()=>{"use strict";Sr();TH=re.enum_(["warn","error"])});var GFr,sIo=h(()=>{"use strict";Sr();oIo();GFr=re.object({exampleValidation:re.property("example-validation",TH.optional()),brokenLinks:re.property("broken-links",TH.optional()),noNonComponentRefs:re.property("no-non-component-refs",TH.optional()),validLocalReferences:re.property("valid-local-references",TH.optional()),noCircularRedirects:re.property("no-circular-redirects",TH.optional()),validDocsEndpoints:re.property("valid-docs-endpoints",TH.optional()),missingRedirects:re.property("missing-redirects",TH.optional()),validChangelogSlug:re.property("valid-changelog-slug",TH.optional())})});var qFr,aIo=h(()=>{"use strict";Sr();sIo();qFr=re.object({rules:GFr.optional()})});var Q6t,cIo=h(()=>{"use strict";Sr();Q6t=re.enum_(["github-dark","github-dark-default","github-dark-dimmed","github-dark-high-contrast","github-light","github-light-default","github-light-high-contrast","material-theme-darker","min-dark","min-light"])});var WFr,lIo=h(()=>{"use strict";Sr();cIo();WFr=re.object({light:Q6t.optional(),dark:Q6t.optional()})});var HFr,uIo=h(()=>{"use strict";Sr();HFr=re.object({dark:re.string().optional(),light:re.string().optional()})});var qI,pIo=h(()=>{"use strict";Sr();uIo();qI=re.undiscriminatedUnion([re.string(),HFr])});var KFr,fIo=h(()=>{"use strict";Sr();pIo();KFr=re.object({accentPrimary:re.property("accent-primary",qI.optional()),accentPrimaryDeprecated:re.property("accentPrimary",qI.optional()),background:qI.optional(),border:qI.optional(),sidebarBackground:re.property("sidebar-background",qI.optional()),headerBackground:re.property("header-background",qI.optional()),cardBackground:re.property("card-background",qI.optional()),accent1:re.property("accent-1",qI.optional()),accent2:re.property("accent-2",qI.optional()),accent3:re.property("accent-3",qI.optional()),accent4:re.property("accent-4",qI.optional()),accent5:re.property("accent-5",qI.optional()),accent6:re.property("accent-6",qI.optional()),accent7:re.property("accent-7",qI.optional()),accent8:re.property("accent-8",qI.optional()),accent9:re.property("accent-9",qI.optional()),accent10:re.property("accent-10",qI.optional()),accent11:re.property("accent-11",qI.optional()),accent12:re.property("accent-12",qI.optional())})});var JFr,dIo=h(()=>{"use strict";Sr();JFr=re.enum_(["center","left"])});var YFr,mIo=h(()=>{"use strict";Sr();YFr=re.undiscriminatedUnion([re.string(),re.list(re.string())])});var XFr,hIo=h(()=>{"use strict";Sr();XFr=re.undiscriminatedUnion([re.string(),re.list(re.string())])});var ZFr,gIo=h(()=>{"use strict";Sr();ZFr=re.object({title:re.string(),subtitle:re.string().optional(),url:re.string(),icon:re.string().optional(),default:re.boolean().optional()})});var $Fr,AIo=h(()=>{"use strict";Sr();$Fr=re.enum_(["github","dashboard"])});var e2r,yIo=h(()=>{"use strict";Sr();e2r=re.object({host:re.string().optional(),owner:re.string(),repo:re.string(),branch:re.string().optional()})});var t2r,bIo=h(()=>{"use strict";Sr();AIo();yIo();t2r=re.object({github:e2r.optional(),launch:$Fr.optional()})});var r2r,EIo=h(()=>{"use strict";Sr();Ktt();hIo();bIo();r2r=re.object({url:re.string(),customDomain:re.property("custom-domain",XFr.optional()),editThisPage:re.property("edit-this-page",t2r.optional()),audiences:Eee.optional(),multiSource:re.property("multi-source",re.boolean().optional())})});var n2r,IIo=h(()=>{"use strict";Sr();n2r=re.object({allowedOrigins:re.property("allowed-origins",re.list(re.string()))})});var i2r,vIo=h(()=>{"use strict";Sr();i2r=re.enum_(["curl","csharp","go","java","javascript","php","python","ruby","swift","typescript"])});var o2r,CIo=h(()=>{"use strict";Sr();vIo();o2r=re.undiscriminatedUnion([re.boolean(),re.list(i2r)])});var fve,M6t=h(()=>{"use strict";Sr();fve=re.string()});var s2r,xIo=h(()=>{"use strict";Sr();s2r=re.object({prioritizeCurrentProduct:re.property("prioritize-current-product",re.boolean().optional()),defaultFilterByCurrentProduct:re.property("default-filter-by-current-product",re.boolean().optional())})});var ert,a2r=h(()=>{"use strict";Sr();ert=re.enum_(["frontmatter","filename"])});var c2r,SIo=h(()=>{"use strict";Sr();c2r=re.enum_(["flat","grouped"])});var l2r,wIo=h(()=>{"use strict";Sr();IIo();CIo();M6t();xIo();a2r();SIo();l2r=re.object({searchText:re.property("search-text",re.string().optional()),disableSearch:re.property("disable-search",re.boolean().optional()),darkModeCode:re.property("dark-mode-code",re.boolean().optional()),defaultSearchFilters:re.property("default-search-filters",re.boolean().optional()),search:s2r.optional(),httpSnippets:re.property("http-snippets",o2r.optional()),hide404Page:re.property("hide-404-page",re.boolean().optional()),useJavascriptAsTypescript:re.property("use-javascript-as-typescript",re.boolean().optional()),disableExplorerProxy:re.property("disable-explorer-proxy",re.boolean().optional()),disableEnvironmentEditing:re.property("disable-environment-editing",re.boolean().optional()),disableAnalytics:re.property("disable-analytics",re.boolean().optional()),language:fve.optional(),folderTitleSource:re.property("folder-title-source",ert.optional()),substituteEnvVars:re.property("substitute-env-vars",re.boolean().optional()),websocketOneofDisplay:re.property("websocket-oneof-display",c2r.optional()),embedding:n2r.optional(),showHeadersInExamples:re.property("show-headers-in-examples",re.boolean().optional()),requireAnalyticsConsent:re.property("require-analytics-consent",re.boolean().optional())})});var trt,u2r=h(()=>{"use strict";Sr();trt=re.enum_(["normal","italic"])});var rrt,p2r=h(()=>{"use strict";Sr();rrt=re.undiscriminatedUnion([re.string(),re.number()])});var f2r,TIo=h(()=>{"use strict";Sr();u2r();p2r();f2r=re.object({path:re.string(),weight:rrt.optional(),style:trt.optional()})});var d2r,OIo=h(()=>{"use strict";Sr();TIo();d2r=re.undiscriminatedUnion([re.string(),f2r])});var m2r,PIo=h(()=>{"use strict";Sr();m2r=re.enum_(["auto","block","swap","fallback","optional"])});var nrt,BIo=h(()=>{"use strict";Sr();OIo();PIo();u2r();p2r();nrt=re.object({name:re.string().optional(),path:re.string().optional(),weight:rrt.optional(),style:trt.optional(),paths:re.list(d2r).optional(),display:m2r.optional(),fallback:re.list(re.string()).optional(),fontVariationSettings:re.property("font-variation-settings",re.string().optional())})});var h2r,DIo=h(()=>{"use strict";Sr();BIo();h2r=re.object({headingsFont:nrt.optional(),bodyFont:nrt.optional(),codeFont:nrt.optional()})});var g2r,RIo=h(()=>{"use strict";Sr();g2r=re.object({url:re.string(),locale:re.string().optional()})});var A2r,kIo=h(()=>{"use strict";Sr();RIo();A2r=re.undiscriminatedUnion([re.string(),g2r])});var y2r,FIo=h(()=>{"use strict";Sr();kIo();y2r=re.object({mdxComponents:re.property("mdx-components",re.list(re.string()).optional()),disableStreamToggle:re.property("disable-stream-toggle",re.boolean().optional()),openapiParserV2:re.property("openapi-parser-v2",re.boolean().optional()),openapiParserV3:re.property("openapi-parser-v3",re.boolean().optional()),dynamicSnippets:re.property("dynamic-snippets",re.boolean().optional()),aiExamples:re.property("ai-examples",re.boolean().optional()),aiExampleStyleInstructions:re.property("ai-example-style-instructions",re.string().optional()),excludeApis:re.property("exclude-apis",re.boolean().optional()),basepathAware:re.property("basepath-aware",re.boolean().optional()),robotsTxtOnInstanceUrl:re.property("robots-txt-on-instance-url",re.boolean().optional()),externalSitemaps:re.property("external-sitemaps",re.list(A2r).optional())})});var b2r,NIo=h(()=>{"use strict";Sr();b2r=re.object({github:re.string().optional(),twitter:re.string().optional(),x:re.string().optional(),linkedin:re.string().optional(),youtube:re.string().optional(),instagram:re.string().optional(),facebook:re.string().optional(),discord:re.string().optional(),slack:re.string().optional(),hackernews:re.string().optional(),medium:re.string().optional(),website:re.string().optional()})});var E2r,jIo=h(()=>{"use strict";Sr();E2r=re.object({intercom:re.string().optional(),context7:re.string().optional()})});var irt,I2r=h(()=>{"use strict";Sr();irt=re.enum_(["beforeInteractive","afterInteractive","lazyOnload"])});var v2r,zIo=h(()=>{"use strict";Sr();I2r();v2r=re.object({path:re.string(),strategy:irt.optional()})});var C2r,QIo=h(()=>{"use strict";Sr();zIo();C2r=re.undiscriminatedUnion([re.string(),v2r])});var x2r,MIo=h(()=>{"use strict";Sr();I2r();x2r=re.object({url:re.string(),strategy:irt.optional(),disableSri:re.property("disable-sri",re.boolean().optional())})});var L6t,LIo=h(()=>{"use strict";Sr();QIo();MIo();L6t=re.undiscriminatedUnion([x2r,C2r])});var S2r,_Io=h(()=>{"use strict";Sr();LIo();S2r=re.undiscriminatedUnion([L6t,re.list(L6t)])});var w2r,UIo=h(()=>{"use strict";Sr();w2r=re.enum_(["fixed","static"])});var T2r,VIo=h(()=>{"use strict";Sr();T2r=re.enum_(["header","header-tabs","sidebar"])});var O2r,GIo=h(()=>{"use strict";Sr();O2r=re.enum_(["header","sidebar"])});var ort,P2r=h(()=>{"use strict";Sr();ort=re.enum_(["header","sidebar"])});var B2r,qIo=h(()=>{"use strict";Sr();X0o();nIo();iIo();dIo();UIo();VIo();GIo();P2r();B2r=re.object({pageWidth:re.property("page-width",re.string().optional()),contentWidth:re.property("content-width",re.string().optional()),sidebarWidth:re.property("sidebar-width",re.string().optional()),headerHeight:re.property("header-height",re.string().optional()),searchbarPlacement:re.property("searchbar-placement",T2r.optional()),tabsPlacement:re.property("tabs-placement",ort.optional()),switcherPlacement:re.property("switcher-placement",O2r.optional()),contentAlignment:re.property("content-alignment",JFr.optional()),headerPosition:re.property("header-position",w2r.optional()),disableHeader:re.property("disable-header",re.boolean().optional()),hideNavLinks:re.property("hide-nav-links",re.boolean().optional()),hideFeedback:re.property("hide-feedback",re.boolean().optional()),mobileToc:re.property("mobile-toc",re.boolean().optional()),changelogLayout:re.property("changelog-layout",VFr.optional()),apiReferenceLayout:re.property("api-reference-layout",DFr.optional()),apiReferenceExpandProperties:re.property("api-reference-expand-properties",re.boolean().optional()),showNavAvailabilityBadges:re.property("show-nav-availability-badges",re.boolean().optional()),hideWebhookMethodBadges:re.property("hide-webhook-method-badges",re.boolean().optional()),breadcrumbs:_Fr.optional()})});var D2r,WIo=h(()=>{"use strict";Sr();D2r=re.enum_(["kind","header"])});var R2r,HIo=h(()=>{"use strict";Sr();R2r=re.enum_(["compact","hyphenated"])});var k2r,KIo=h(()=>{"use strict";Sr();WIo();HIo();k2r=re.object({doxyfile:re.string().optional(),includeUndocumentedMacros:re.property("include-undocumented-macros",re.boolean().optional()),slugStyle:re.property("slug-style",R2r.optional()),organizeBy:re.property("organize-by",D2r.optional()),include:re.list(re.string()).optional(),exclude:re.list(re.string()).optional(),excludeSymbols:re.property("exclude-symbols",re.list(re.string()).optional())})});var F2r,JIo=h(()=>{"use strict";Sr();F2r=re.object({git:re.string(),subpath:re.string().optional(),ref:re.string().optional()})});var N2r,YIo=h(()=>{"use strict";Sr();N2r=re.object({path:re.string()})});var j2r,XIo=h(()=>{"use strict";Sr();JIo();YIo();j2r=re.undiscriminatedUnion([F2r,N2r])});var z2r,ZIo=h(()=>{"use strict";Sr();z2r=re.enum_(["python","cpp"])});var Q2r,$Io=h(()=>{"use strict";Sr();Q2r=re.object({path:re.string()})});var M2r,evo=h(()=>{"use strict";Sr();KIo();XIo();ZIo();$Io();M2r=re.object({input:j2r,output:Q2r,lang:z2r,config:k2r.optional()})});var srt,L2r=h(()=>{"use strict";Sr();srt=re.string()});var _2r,tvo=h(()=>{"use strict";Sr();_2r=re.object({dark:re.string().optional(),light:re.string().optional(),height:re.number().optional(),href:re.string().optional(),rightText:re.property("right-text",re.string().optional())})});var U2r,rvo=h(()=>{"use strict";Sr();U2r=re.enum_(["dark","light"])});var V2r,nvo=h(()=>{"use strict";Sr();V2r=re.enum_(["summary","summary_large_image","app","player"])});var G2r,ivo=h(()=>{"use strict";Sr();rvo();nvo();G2r=re.object({ogSiteName:re.property("og:site_name",re.string().optional()),ogTitle:re.property("og:title",re.string().optional()),ogDescription:re.property("og:description",re.string().optional()),ogUrl:re.property("og:url",re.string().optional()),ogImage:re.property("og:image",re.string().optional()),ogImageWidth:re.property("og:image:width",re.number().optional()),ogImageHeight:re.property("og:image:height",re.number().optional()),ogLocale:re.property("og:locale",re.string().optional()),ogLogo:re.property("og:logo",re.string().optional()),twitterTitle:re.property("twitter:title",re.string().optional()),twitterDescription:re.property("twitter:description",re.string().optional()),twitterHandle:re.property("twitter:handle",re.string().optional()),twitterImage:re.property("twitter:image",re.string().optional()),twitterSite:re.property("twitter:site",re.string().optional()),twitterUrl:re.property("twitter:url",re.string().optional()),twitterCard:re.property("twitter:card",V2r.optional()),ogDynamic:re.property("og:dynamic",re.boolean().optional()),ogDynamicBackgroundImage:re.property("og:dynamic:background-image",re.string().optional()),ogDynamicTextColor:re.property("og:dynamic:text-color",re.string().optional()),ogDynamicBackgroundColor:re.property("og:dynamic:background-color",re.string().optional()),ogDynamicLogoColor:re.property("og:dynamic:logo-color",U2r.optional()),ogDynamicShowLogo:re.property("og:dynamic:show-logo",re.boolean().optional()),ogDynamicShowSection:re.property("og:dynamic:show-section",re.boolean().optional()),ogDynamicShowDescription:re.property("og:dynamic:show-description",re.boolean().optional()),ogDynamicShowUrl:re.property("og:dynamic:show-url",re.boolean().optional()),ogDynamicShowGradient:re.property("og:dynamic:show-gradient",re.boolean().optional()),canonicalHost:re.property("canonical-host",re.string().optional())})});var dve,_6t=h(()=>{"use strict";Sr();OFr();dve=re.object({viewers:Xtt.optional()})});var See,q2r=h(()=>{"use strict";Sr();T6e();_6t();See=re.object({href:re.string().optional(),target:jV.optional(),url:re.string().optional(),text:re.string().optional(),icon:re.string().optional(),rightIcon:re.string().optional(),rounded:re.boolean().optional()}).extend(dve)});var W2r,ovo=h(()=>{"use strict";Sr();q2r();_6t();W2r=re.object({links:re.list(See),text:re.string().optional(),icon:re.string().optional(),rightIcon:re.string().optional(),rounded:re.boolean().optional()}).extend(dve)});var H2r,svo=h(()=>{"use strict";Sr();T6e();_6t();H2r=re.object({url:re.string(),target:jV.optional()}).extend(dve)});var K2r,avo=h(()=>{"use strict";Sr();svo();K2r=re.undiscriminatedUnion([re.string(),H2r])});var J2r,cvo=h(()=>{"use strict";Sr();ovo();avo();q2r();J2r=re.union("type",{filled:See,outlined:See,minimal:See,github:re.object({value:K2r}),dropdown:W2r,primary:See,secondary:See}).transform({transform:e=>e,untransform:e=>e})});var QV,P6e=h(()=>{"use strict";Sr();QV=re.string()});var Y2r,lvo=h(()=>{"use strict";Sr();J6();P6e();Y2r=re.object({tab:QV,layout:re.list(re.lazy(()=>wee)).optional()})});var X2r,uvo=h(()=>{"use strict";Sr();J6();z1();Q1();X2r=re.object({title:re.string(),subtitle:re.string().optional(),icon:re.string().optional(),layout:re.list(re.lazy(()=>wee)),slug:re.string().optional(),skipSlug:re.property("skip-slug",re.boolean().optional()),hidden:re.boolean().optional(),default:re.boolean().optional()}).extend(Dd).extend(Bd)});var Z2r,pvo=h(()=>{"use strict";Sr();P6e();uvo();Z2r=re.object({tab:QV,variants:re.list(X2r)})});var $2r,fvo=h(()=>{"use strict";Sr();lvo();pvo();$2r=re.undiscriminatedUnion([Y2r,Z2r])});var eNr,dvo=h(()=>{"use strict";Sr();fvo();eNr=re.list($2r)});var tNr,mvo=h(()=>{"use strict";Sr();J6();tNr=re.list(re.lazy(()=>wee))});var mve,U6t=h(()=>{"use strict";Sr();dvo();mvo();mve=re.undiscriminatedUnion([eNr,tNr])});var rNr,hvo=h(()=>{"use strict";Sr();rNr=re.enum_(["copy-page","view-as-markdown","ask-ai","chatgpt","claude","cursor","claude-code","vscode"])});var nNr,gvo=h(()=>{"use strict";Sr();nNr=re.object({name:re.string(),description:re.string().optional(),url:re.string().optional()})});var iNr,Avo=h(()=>{"use strict";Sr();iNr=re.undiscriminatedUnion([re.string(),re.list(re.string())])});var oNr,yvo=h(()=>{"use strict";Sr();gvo();Avo();oNr=re.object({title:re.string().optional(),description:re.string().optional(),learnMoreUrl:re.property("learn-more-url",re.string().optional()),repository:re.string().optional(),installCommand:re.property("install-command",iNr.optional()),skills:re.list(nNr).optional()})});var sNr,bvo=h(()=>{"use strict";Sr();gIo();yvo();sNr=re.object({copyPage:re.property("copy-page",re.boolean().optional()),viewAsMarkdown:re.property("view-as-markdown",re.boolean().optional()),askAi:re.property("ask-ai",re.boolean().optional()),chatgpt:re.boolean().optional(),claude:re.boolean().optional(),claudeCode:re.property("claude-code",re.boolean().optional()),cursor:re.boolean().optional(),mcp:re.boolean().optional(),vscode:re.boolean().optional(),custom:re.list(ZFr).optional(),skills:oNr.optional()})});var aNr,Evo=h(()=>{"use strict";Sr();hvo();bvo();aNr=re.object({default:rNr.optional(),options:sNr.optional()})});var cNr,Ivo=h(()=>{"use strict";Sr();cNr=re.enum_(["deprecated","legacy","ga","stable","beta","alpha","preview"])});var art,lNr=h(()=>{"use strict";Sr();F6t();Ktt();Ivo();z1();Q1();art=re.object({displayName:re.property("display-name",re.string()),path:re.string().optional(),ref:re.string().optional(),slug:re.string().optional(),availability:cNr.optional(),audiences:Eee.optional(),hidden:re.boolean().optional(),default:re.boolean().optional(),announcement:pve.optional()}).extend(Dd).extend(Bd)});var crt,uNr=h(()=>{"use strict";Sr();Ktt();lNr();z1();Q1();crt=re.object({displayName:re.property("display-name",re.string()),subtitle:re.string().optional(),icon:re.string().optional(),image:re.string().optional(),versions:re.list(art).optional(),audiences:Eee.optional()}).extend(Dd).extend(Bd)});var pNr,vvo=h(()=>{"use strict";Sr();uNr();T6e();pNr=re.object({href:re.string(),target:jV.optional()}).extend(crt)});var fNr,Cvo=h(()=>{"use strict";Sr();F6t();uNr();fNr=re.object({path:re.string(),slug:re.string().optional(),announcement:pve.optional()}).extend(crt)});var dNr,xvo=h(()=>{"use strict";Sr();vvo();Cvo();dNr=re.undiscriminatedUnion([fNr,pNr])});var mNr,Svo=h(()=>{"use strict";Sr();mNr=re.enum_(["typescript","javascript","python","java","go","ruby","csharp","php","swift","rust","nodets","nodejs","dotnet","curl","jvm","ts","js"])});var hNr,wvo=h(()=>{"use strict";Sr();hNr=re.object({source:re.string(),destination:re.string(),permanent:re.boolean().optional()})});var gNr,Tvo=h(()=>{"use strict";Sr();wvo();gNr=re.undiscriminatedUnion([re.list(hNr),re.string(),re.list(re.string())])});var hve,V6t=h(()=>{"use strict";Sr();z6t();T6e();z1();Q1();hve=re.object({displayName:re.property("display-name",re.string()),icon:re.string().optional(),slug:re.string().optional(),skipSlug:re.property("skip-slug",re.boolean().optional()),hidden:re.boolean().optional(),href:re.string().optional(),target:jV.optional(),changelog:Rfe.optional(),blog:Rfe.optional()}).extend(Dd).extend(Bd)});var ANr,Ovo=h(()=>{"use strict";Sr();ANr=re.enum_(["default","minimal"])});var yNr,Pvo=h(()=>{"use strict";Sr();yNr=re.enum_(["default","minimal"])});var bNr,Bvo=h(()=>{"use strict";Sr();bNr=re.enum_(["default","toolbar"])});var ENr,Dvo=h(()=>{"use strict";Sr();ENr=re.enum_(["default","toggle","tabs"])});var INr,Rvo=h(()=>{"use strict";Sr();INr=re.enum_(["default","minimal"])});var vNr,kvo=h(()=>{"use strict";Sr();vNr=re.object({enabled:re.boolean().optional(),order:re.list(re.string()).optional(),hide:re.list(re.string()).optional(),labels:re.record(re.string(),re.string()).optional(),showProducts:re.property("show-products",re.boolean().optional())})});var CNr,Fvo=h(()=>{"use strict";Sr();CNr=re.enum_(["left","center"])});var lrt,xNr=h(()=>{"use strict";Sr();lrt=re.enum_(["default","bubble"])});var SNr,Nvo=h(()=>{"use strict";Sr();Fvo();P2r();xNr();SNr=re.object({style:lrt.optional(),alignment:CNr.optional(),placement:ort.optional()})});var wNr,jvo=h(()=>{"use strict";Sr();Nvo();xNr();wNr=re.undiscriminatedUnion([lrt,SNr])});var TNr,zvo=h(()=>{"use strict";Sr();rIo();lIo();Ovo();Pvo();Bvo();Dvo();Rvo();kvo();jvo();TNr=re.object({sidebar:INr.optional(),body:LFr.optional(),tabs:wNr.optional(),pageActions:re.property("page-actions",bNr.optional()),footerNav:re.property("footer-nav",ANr.optional()),languageSwitcher:re.property("language-switcher",yNr.optional()),productSwitcher:re.property("product-switcher",ENr.optional()),siteSwitcher:re.property("site-switcher",vNr.optional()),codeBlocks:re.property("code-blocks",WFr.optional())})});var ONr,Qvo=h(()=>{"use strict";Sr();M6t();ONr=re.object({lang:fve,default:re.boolean().optional()})});var PNr,Mvo=h(()=>{"use strict";Sr();M6t();Qvo();PNr=re.undiscriminatedUnion([fve,ONr])});var fJc,dJc=h(()=>{"use strict";Sr();y0o();C0o();x0o();D0o();F6t();eIo();UFr();aIo();fIo();mIo();EIo();wIo();DIo();FIo();NIo();jIo();_Io();qIo();evo();L2r();tvo();ivo();cvo();U6t();Evo();O6e();xvo();Svo();Tvo();TFr();V6t();P6e();zvo();Mvo();lNr();fJc=re.object({instances:re.list(r2r),title:re.string().optional(),libraries:re.record(srt,M2r).optional(),analytics:fFr.optional(),announcement:pve.optional(),roles:re.list(w6e).optional(),tabs:re.record(QV,hve).optional(),versions:re.list(art).optional(),products:re.list(dNr).optional(),changelog:$tt.optional(),landingPage:re.property("landing-page",zV.optional()),navigation:mve.optional(),navbarLinks:re.property("navbar-links",re.list(J2r).optional()),footerLinks:re.property("footer-links",b2r.optional()),pageActions:re.property("page-actions",aNr.optional()),globalTheme:re.property("global-theme",re.string().optional()),experimental:y2r.optional(),defaultLanguage:re.property("default-language",mNr.optional()),languages:re.list(re.string()).optional(),translations:re.list(PNr).optional(),aiChat:re.property("ai-chat",k6t.optional()),aiSearch:re.property("ai-search",k6t.optional()),aiExamples:re.property("ai-examples",oFr.optional()),agents:eFr.optional(),metadata:G2r.optional(),redirects:gNr.optional(),check:qFr.optional(),logo:_2r.optional(),favicon:re.string().optional(),backgroundImage:re.property("background-image",QFr.optional()),colors:KFr.optional(),typography:h2r.optional(),layout:B2r.optional(),settings:l2r.optional(),theme:TNr.optional(),integrations:E2r.optional(),css:YFr.optional(),js:S2r.optional(),header:re.string().optional(),footer:re.string().optional()})});var BNr,Lvo=h(()=>{"use strict";Sr();Iee();Jtt();a2r();z1();Q1();BNr=re.object({folder:re.string(),title:re.string().optional(),titleSource:re.property("title-source",ert.optional()),slug:re.string().optional(),icon:re.string().optional(),hidden:re.boolean().optional(),skipSlug:re.property("skip-slug",re.boolean().optional()),collapsed:vee.optional(),collapsible:re.boolean().optional(),collapsedByDefault:re.property("collapsed-by-default",re.boolean().optional()),availability:j1.optional()}).extend(Dd).extend(Bd)});var DNr,_vo=h(()=>{"use strict";Sr();L2r();z1();Q1();DNr=re.object({library:srt,title:re.string().optional(),slug:re.string().optional()}).extend(Dd).extend(Bd)});var wee,mJc=h(()=>{"use strict";Sr();J6();J0o();tIo();UFr();Lvo();_vo();kFr();O6e();wee=re.undiscriminatedUnion([zV,re.lazyObject(()=>RNr),PFr,DNr,Ztt,$tt,MFr,BNr])});var hJc,gJc=h(()=>{"use strict";Sr();U6t();O6e();V6t();P6e();hJc=re.object({tabs:re.record(QV,hve).optional(),landingPage:re.property("landing-page",zV.optional()),navigation:mve})});var kNr,Uvo=h(()=>{"use strict";Sr();z1();Q1();kNr=re.object({displayName:re.property("display-name",re.string()),path:re.string(),slug:re.string().optional()}).extend(Dd).extend(Bd)});var AJc,yJc=h(()=>{"use strict";Sr();g0o();Uvo();AJc=re.undiscriminatedUnion([kNr,Zkr])});var RNr,bJc=h(()=>{"use strict";Sr();J6();Iee();Jtt();z1();Q1();RNr=re.object({section:re.string(),path:re.string().optional(),contents:re.list(re.lazy(()=>wee)),collapsed:vee.optional(),collapsible:re.boolean().optional(),collapsedByDefault:re.property("collapsed-by-default",re.boolean().optional()),slug:re.string().optional(),icon:re.string().optional(),hidden:re.boolean().optional(),skipSlug:re.property("skip-slug",re.boolean().optional()),availability:j1.optional()}).extend(Dd).extend(Bd)});var EJc,IJc=h(()=>{"use strict";Sr();U6t();O6e();V6t();P6e();EJc=re.object({tabs:re.record(QV,hve).optional(),landingPage:re.property("landing-page",zV.optional()),navigation:mve})});var Vvo=h(()=>{"use strict";g0o();y0o();C0o();E0o();I0o();v0o();b0o();x0o();D0o();F6t();J0o();Y0o();X0o();cJc();Z0o();lJc();uJc();pJc();M0o();R0o();F0o();k0o();N0o();j0o();z0o();Q0o();Ktt();L0o();Iee();eIo();$0o();tIo();rIo();nIo();UFr();z6t();iIo();aIo();oIo();sIo();lIo();cIo();_0o();Jtt();pIo();fIo();uIo();dIo();mIo();hIo();gIo();dJc();EIo();wIo();DIo();bIo();AIo();IIo();FIo();vvo();kIo();RIo();H0o();K0o();Lvo();BIo();OIo();TIo();PIo();u2r();p2r();NIo();Ovo();S0o();yIo();JIo();w0o();T0o();UIo();vIo();CIo();jIo();O0o();Cvo();_Io();LIo();QIo();zIo();MIo();I2r();M6t();Pvo();qIo();KIo();evo();XIo();ZIo();L2r();WIo();$Io();_vo();HIo();kFr();tvo();ivo();ovo();avo();svo();cvo();q2r();U6t();mJc();rvo();hvo();bvo();Evo();Bvo();O6e();A0o();YIo();U0o();Ytt();P0o();xvo();uNr();gJc();yJc();Dvo();Svo();wvo();Tvo();Uvo();OFr();TFr();VIo();xIo();bJc();B0o();Rvo();kvo();gvo();Avo();yvo();G0o();q0o();W0o();GIo();dvo();fvo();lvo();pvo();V6t();P6e();Fvo();P2r();jvo();Nvo();xNr();uvo();T6e();zvo();a2r();Mvo();Qvo();nvo();mvo();Ivo();lNr();V0o();IJc();SIo();z1();Q1();_6t()});var Gvo={};ne(Gvo,{AbsoluteProductPath:()=>Zkr,AgentsConfig:()=>eFr,AiChatConfig:()=>k6t,AiChatDatasource:()=>rFr,AiChatLocation:()=>nFr,AiChatModel:()=>iFr,AiChatWebsiteDatasource:()=>tFr,AiExamplesConfig:()=>oFr,AnalyticsConfig:()=>fFr,AnnouncementConfig:()=>pve,ApiReferenceConfiguration:()=>PFr,ApiReferenceEndpointConfiguration:()=>BFr,ApiReferenceLayout:()=>DFr,ApiReferenceLayoutItem:()=>xee,ApiReferenceOperationConfiguration:()=>RFr,ApiReferencePackageConfiguration:()=>FFr,ApiReferencePackageConfigurationWithOptions:()=>jFr,ApiReferenceSectionConfiguration:()=>NFr,ApiSpecConfiguration:()=>EFr,ApiSpecErrorResponseApplyTo:()=>dFr,ApiSpecErrorResponseEnsure:()=>hFr,ApiSpecErrorResponseHttpMethod:()=>mFr,ApiSpecErrorResponseSchemaSource:()=>gFr,ApiSpecErrorResponses:()=>AFr,ApiSpecImportSettings:()=>yFr,ApiSpecType:()=>bFr,Audience:()=>Eee,AudienceId:()=>N6t,Availability:()=>j1,BackgroundImageConfiguration:()=>QFr,BackgroundImageThemedConfig:()=>zFr,BlogConfiguration:()=>MFr,BodyThemeConfig:()=>LFr,BreadcrumbsConfig:()=>_Fr,ChangelogConfiguration:()=>$tt,ChangelogFolderRelativePath:()=>Rfe,ChangelogLayout:()=>VFr,CheckConfig:()=>qFr,CheckRuleSeverity:()=>TH,CheckRulesConfig:()=>GFr,CodeBlockTheme:()=>Q6t,CodeBlocksThemeConfig:()=>WFr,CollapsedStringValue:()=>IFr,CollapsedValue:()=>vee,ColorConfig:()=>qI,ColorThemedConfig:()=>HFr,ColorsConfiguration:()=>KFr,ContentAlignment:()=>JFr,CssConfig:()=>YFr,CustomDomain:()=>XFr,CustomPageAction:()=>ZFr,DocsConfiguration:()=>fJc,DocsInstance:()=>r2r,DocsSettingsConfig:()=>l2r,DocsTypographyConfig:()=>h2r,EditThisPageConfig:()=>t2r,EditThisPageLaunch:()=>$Fr,EmbeddingConfig:()=>n2r,ExperimentalConfig:()=>y2r,ExternalProduct:()=>pNr,ExternalSitemap:()=>A2r,ExternalSitemapConfig:()=>g2r,FeatureFlag:()=>j6t,FeatureFlagConfiguration:()=>wFr,FolderConfiguration:()=>BNr,FontConfig:()=>nrt,FontConfigPath:()=>d2r,FontConfigVariant:()=>f2r,FontDisplay:()=>m2r,FontStyle:()=>trt,FontWeight:()=>rrt,FooterLinksConfig:()=>b2r,FooterNavThemeConfig:()=>ANr,FullStoryAnalyticsConfig:()=>sFr,GitLibraryInputSchema:()=>F2r,GithubEditThisPageConfig:()=>e2r,GoogleAnalytics4Config:()=>aFr,GtmConfig:()=>cFr,HeaderPosition:()=>w2r,HttpSnippetLanguage:()=>i2r,HttpSnippetsConfig:()=>o2r,IntegrationsConfig:()=>E2r,IntercomConfig:()=>lFr,InternalProduct:()=>fNr,JsConfig:()=>S2r,JsConfigOptions:()=>L6t,JsFileConfig:()=>C2r,JsFileConfigSettings:()=>v2r,JsRemoteConfig:()=>x2r,JsScriptStrategy:()=>irt,Language:()=>fve,LanguageSwitcherThemeConfig:()=>yNr,LayoutConfig:()=>B2r,LibraryConfig:()=>k2r,LibraryConfiguration:()=>M2r,LibraryInputConfiguration:()=>j2r,LibraryLanguage:()=>z2r,LibraryName:()=>srt,LibraryOrganizeBy:()=>D2r,LibraryOutputConfiguration:()=>Q2r,LibraryReferenceConfiguration:()=>DNr,LibrarySlugStyle:()=>R2r,LinkConfiguration:()=>Ztt,LogoConfiguration:()=>_2r,MetadataConfig:()=>G2r,NavbarDropdownConfig:()=>W2r,NavbarGithubConfig:()=>K2r,NavbarGithubConfigWithOptions:()=>H2r,NavbarLink:()=>J2r,NavbarLinkConfig:()=>See,NavigationConfig:()=>mve,NavigationItem:()=>wee,OgDynamicLogoColor:()=>U2r,PageActionOption:()=>rNr,PageActionOptions:()=>sNr,PageActionsConfig:()=>aNr,PageActionsThemeConfig:()=>bNr,PageConfiguration:()=>zV,PageDescriptionSource:()=>$kr,PathLibraryInputSchema:()=>N2r,PlaygroundButtonSettings:()=>vFr,PlaygroundSettings:()=>Cee,PostHogConfig:()=>uFr,ProductConfig:()=>dNr,ProductConfigBase:()=>crt,ProductFileConfig:()=>hJc,ProductPath:()=>AJc,ProductSwitcherThemeConfig:()=>ENr,ProgrammingLanguage:()=>mNr,RedirectConfig:()=>hNr,RedirectsConfiguration:()=>gNr,RelativeProductPath:()=>kNr,Role:()=>Xtt,RoleId:()=>w6e,SearchSettingsConfig:()=>s2r,SearchbarPlacement:()=>T2r,SectionConfiguration:()=>RNr,SegmentConfig:()=>pFr,SidebarThemeConfig:()=>INr,SiteSwitcherThemeConfig:()=>vNr,SkillEntry:()=>nNr,SkillsInstallCommand:()=>iNr,SkillsPageActionConfig:()=>oNr,SnippetLanguageConfiguration:()=>K6,SnippetsConfiguration:()=>xFr,SortByAvailabilityValue:()=>SFr,SwitcherPlacement:()=>O2r,TabConfig:()=>hve,TabId:()=>QV,TabVariant:()=>X2r,TabbedNavigationConfig:()=>eNr,TabbedNavigationItem:()=>$2r,TabbedNavigationItemWithLayout:()=>Y2r,TabbedNavigationItemWithVariants:()=>Z2r,TabsAlignment:()=>CNr,TabsPlacement:()=>ort,TabsThemeConfig:()=>wNr,TabsThemeObjectConfig:()=>SNr,TabsThemeStyle:()=>lrt,Target:()=>jV,ThemeConfig:()=>TNr,TitleSource:()=>ert,TranslationConfig:()=>PNr,TranslationConfigObject:()=>ONr,TwitterCardSetting:()=>V2r,UntabbedNavigationConfig:()=>tNr,VersionAvailability:()=>cNr,VersionConfig:()=>art,VersionFileConfig:()=>EJc,VersionedSnippetLanguageConfiguration:()=>CFr,WebSocketOneofDisplay:()=>c2r,WithFeatureFlags:()=>Bd,WithPermissions:()=>Dd,WithViewers:()=>dve});var vJc=h(()=>{"use strict";Vvo()});var CJc=h(()=>{"use strict";vJc();Vvo()});var Mz={};ne(Mz,{AbsoluteProductPath:()=>Zkr,AgentsConfig:()=>eFr,AiChatConfig:()=>k6t,AiChatDatasource:()=>rFr,AiChatLocation:()=>nFr,AiChatModel:()=>iFr,AiChatWebsiteDatasource:()=>tFr,AiExamplesConfig:()=>oFr,AnalyticsConfig:()=>fFr,AnnouncementConfig:()=>pve,ApiReferenceConfiguration:()=>PFr,ApiReferenceEndpointConfiguration:()=>BFr,ApiReferenceLayout:()=>DFr,ApiReferenceLayoutItem:()=>xee,ApiReferenceOperationConfiguration:()=>RFr,ApiReferencePackageConfiguration:()=>FFr,ApiReferencePackageConfigurationWithOptions:()=>jFr,ApiReferenceSectionConfiguration:()=>NFr,ApiSpecConfiguration:()=>EFr,ApiSpecErrorResponseApplyTo:()=>dFr,ApiSpecErrorResponseEnsure:()=>hFr,ApiSpecErrorResponseHttpMethod:()=>mFr,ApiSpecErrorResponseSchemaSource:()=>gFr,ApiSpecErrorResponses:()=>AFr,ApiSpecImportSettings:()=>yFr,ApiSpecType:()=>bFr,Audience:()=>Eee,AudienceId:()=>N6t,Availability:()=>j1,BackgroundImageConfiguration:()=>QFr,BackgroundImageThemedConfig:()=>zFr,BlogConfiguration:()=>MFr,BodyThemeConfig:()=>LFr,BreadcrumbsConfig:()=>_Fr,ChangelogConfiguration:()=>$tt,ChangelogFolderRelativePath:()=>Rfe,ChangelogLayout:()=>VFr,CheckConfig:()=>qFr,CheckRuleSeverity:()=>TH,CheckRulesConfig:()=>GFr,CodeBlockTheme:()=>Q6t,CodeBlocksThemeConfig:()=>WFr,CollapsedStringValue:()=>IFr,CollapsedValue:()=>vee,ColorConfig:()=>qI,ColorThemedConfig:()=>HFr,ColorsConfiguration:()=>KFr,ContentAlignment:()=>JFr,CssConfig:()=>YFr,CustomDomain:()=>XFr,CustomPageAction:()=>ZFr,DocsConfiguration:()=>fJc,DocsInstance:()=>r2r,DocsSettingsConfig:()=>l2r,DocsTypographyConfig:()=>h2r,EditThisPageConfig:()=>t2r,EditThisPageLaunch:()=>$Fr,EmbeddingConfig:()=>n2r,ExperimentalConfig:()=>y2r,ExternalProduct:()=>pNr,ExternalSitemap:()=>A2r,ExternalSitemapConfig:()=>g2r,FeatureFlag:()=>j6t,FeatureFlagConfiguration:()=>wFr,FolderConfiguration:()=>BNr,FontConfig:()=>nrt,FontConfigPath:()=>d2r,FontConfigVariant:()=>f2r,FontDisplay:()=>m2r,FontStyle:()=>trt,FontWeight:()=>rrt,FooterLinksConfig:()=>b2r,FooterNavThemeConfig:()=>ANr,FullStoryAnalyticsConfig:()=>sFr,GitLibraryInputSchema:()=>F2r,GithubEditThisPageConfig:()=>e2r,GoogleAnalytics4Config:()=>aFr,GtmConfig:()=>cFr,HeaderPosition:()=>w2r,HttpSnippetLanguage:()=>i2r,HttpSnippetsConfig:()=>o2r,IntegrationsConfig:()=>E2r,IntercomConfig:()=>lFr,InternalProduct:()=>fNr,JsConfig:()=>S2r,JsConfigOptions:()=>L6t,JsFileConfig:()=>C2r,JsFileConfigSettings:()=>v2r,JsRemoteConfig:()=>x2r,JsScriptStrategy:()=>irt,Language:()=>fve,LanguageSwitcherThemeConfig:()=>yNr,LayoutConfig:()=>B2r,LibraryConfig:()=>k2r,LibraryConfiguration:()=>M2r,LibraryInputConfiguration:()=>j2r,LibraryLanguage:()=>z2r,LibraryName:()=>srt,LibraryOrganizeBy:()=>D2r,LibraryOutputConfiguration:()=>Q2r,LibraryReferenceConfiguration:()=>DNr,LibrarySlugStyle:()=>R2r,LinkConfiguration:()=>Ztt,LogoConfiguration:()=>_2r,MetadataConfig:()=>G2r,NavbarDropdownConfig:()=>W2r,NavbarGithubConfig:()=>K2r,NavbarGithubConfigWithOptions:()=>H2r,NavbarLink:()=>J2r,NavbarLinkConfig:()=>See,NavigationConfig:()=>mve,NavigationItem:()=>wee,OgDynamicLogoColor:()=>U2r,PageActionOption:()=>rNr,PageActionOptions:()=>sNr,PageActionsConfig:()=>aNr,PageActionsThemeConfig:()=>bNr,PageConfiguration:()=>zV,PageDescriptionSource:()=>$kr,PathLibraryInputSchema:()=>N2r,PlaygroundButtonSettings:()=>vFr,PlaygroundSettings:()=>Cee,PostHogConfig:()=>uFr,ProductConfig:()=>dNr,ProductConfigBase:()=>crt,ProductFileConfig:()=>hJc,ProductPath:()=>AJc,ProductSwitcherThemeConfig:()=>ENr,ProgrammingLanguage:()=>mNr,RedirectConfig:()=>hNr,RedirectsConfiguration:()=>gNr,RelativeProductPath:()=>kNr,Role:()=>Xtt,RoleId:()=>w6e,SearchSettingsConfig:()=>s2r,SearchbarPlacement:()=>T2r,SectionConfiguration:()=>RNr,SegmentConfig:()=>pFr,SidebarThemeConfig:()=>INr,SiteSwitcherThemeConfig:()=>vNr,SkillEntry:()=>nNr,SkillsInstallCommand:()=>iNr,SkillsPageActionConfig:()=>oNr,SnippetLanguageConfiguration:()=>K6,SnippetsConfiguration:()=>xFr,SortByAvailabilityValue:()=>SFr,SwitcherPlacement:()=>O2r,TabConfig:()=>hve,TabId:()=>QV,TabVariant:()=>X2r,TabbedNavigationConfig:()=>eNr,TabbedNavigationItem:()=>$2r,TabbedNavigationItemWithLayout:()=>Y2r,TabbedNavigationItemWithVariants:()=>Z2r,TabsAlignment:()=>CNr,TabsPlacement:()=>ort,TabsThemeConfig:()=>wNr,TabsThemeObjectConfig:()=>SNr,TabsThemeStyle:()=>lrt,Target:()=>jV,ThemeConfig:()=>TNr,TitleSource:()=>ert,TranslationConfig:()=>PNr,TranslationConfigObject:()=>ONr,TwitterCardSetting:()=>V2r,UntabbedNavigationConfig:()=>tNr,VersionAvailability:()=>cNr,VersionConfig:()=>art,VersionFileConfig:()=>EJc,VersionedSnippetLanguageConfiguration:()=>CFr,WebSocketOneofDisplay:()=>c2r,WithFeatureFlags:()=>Bd,WithPermissions:()=>Dd,WithViewers:()=>dve,docs:()=>Gvo});var J6=h(()=>{"use strict";CJc()});var xJc=h(()=>{"use strict";JEo();YEo();JHc();J6()});var qvo={};ne(qvo,{AiChatLocation:()=>oEo,AiChatModel:()=>sEo,ApiReferenceLayout:()=>aEo,ApiSpecErrorResponseApplyTo:()=>cEo,ApiSpecErrorResponseHttpMethod:()=>lEo,ApiSpecType:()=>uEo,Availability:()=>pEo,BodyThemeConfig:()=>fEo,ChangelogLayout:()=>dEo,CheckRuleSeverity:()=>mEo,CodeBlockTheme:()=>hEo,CollapsedStringValue:()=>gEo,ContentAlignment:()=>AEo,EditThisPageLaunch:()=>yEo,FernDocsConfig:()=>KEo,FernDocsConfigError:()=>x6e,FernDocsConfigTimeoutError:()=>w6t,FontDisplay:()=>bEo,FontStyle:()=>EEo,FooterNavThemeConfig:()=>IEo,HeaderPosition:()=>vEo,HttpSnippetLanguage:()=>CEo,JsScriptStrategy:()=>xEo,LanguageSwitcherThemeConfig:()=>SEo,LibraryLanguage:()=>wEo,LibraryOrganizeBy:()=>TEo,LibrarySlugStyle:()=>OEo,OgDynamicLogoColor:()=>PEo,PageActionOption:()=>BEo,PageActionsThemeConfig:()=>DEo,PageDescriptionSource:()=>REo,ProductSwitcherThemeConfig:()=>kEo,ProgrammingLanguage:()=>FEo,SearchbarPlacement:()=>NEo,Serializer:()=>Mz,SidebarThemeConfig:()=>jEo,SortByAvailabilityValue:()=>zEo,SwitcherPlacement:()=>QEo,TabsAlignment:()=>MEo,TabsPlacement:()=>LEo,TabsThemeStyle:()=>_Eo,Target:()=>UEo,TitleSource:()=>VEo,TwitterCardSetting:()=>GEo,VersionAvailability:()=>qEo,WebSocketOneofDisplay:()=>WEo,docs:()=>Hkr,logging:()=>$Eo,serialization:()=>Mz});var SJc=h(()=>{"use strict";xJc();JEo();J6()});function ILd(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}var wJc,TJc,vLd,OJc=h(()=>{"use strict";wJc={logo:"global",favicon:"global",backgroundImage:"global",colors:"global",typography:"global",layout:"global",settings:"global",theme:"global",integrations:"global",css:"global",js:"global",header:"global",footer:"global",navbarLinks:"global",footerLinks:"global",aiSearch:"global",announcement:"global",metadata:"global"},TJc=Object.keys(wJc);vLd=new Set(TJc.map(ILd))});function BJc(e){if(e.trim()!==e||e.length===0)return`Origin "${e}" must not be empty or contain surrounding whitespace`;if(e==="*"||e.startsWith("*"))return`Origin "${e}" is not allowed: a bare wildcard would let any site embed your docs. Use a scoped wildcard such as https://*.example.com instead`;if(!CLd.test(e))return`Origin "${e}" is not a valid origin. Expected scheme://host[:port] with no path, query, or CSP keywords, e.g. https://app.example.com or https://*.example.com`}function xLd(e){let t=[];return e.forEach((r,n)=>{let i=BJc(r);i!=null&&t.push(`settings.embedding.allowed-origins[${n}]: ${i}`)}),t}var PJc,CLd,DJc=h(()=>{"use strict";PJc="[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?",CLd=new RegExp(`^https?://(?:\\*\\.)?${PJc}(?:\\.${PJc})*(?::\\d{1,5})?$`)});var Fa={};ne(Fa,{DEFAULT_BLOG_TITLE:()=>nLd,DEFAULT_CHANGELOG_TITLE:()=>rLd,DocsYmlSchemas:()=>iEo,RawSchemas:()=>qvo,THEME_ELIGIBLE_FIELDS:()=>TJc,THEME_ELIGIBLE_YAML_KEYS:()=>vLd,THEME_FIELD_POLICIES:()=>wJc,getChangelogFolderFromNavigationItem:()=>iLd,getChangelogFolderFromTabConfig:()=>oLd,getEmbeddingOriginErrors:()=>xLd,validateEmbeddingOrigin:()=>BJc});var RJc=h(()=>{"use strict";Sqc();wqc();Tqc();SJc();OJc();DJc()});var kJc=h(()=>{"use strict"});async function Tee({absolutePathToFernignore:e}){let t=(await(0,FJc.readFile)(e)).toString();return NJc(t)}function NJc(e){return[F1,...e.trim().split(wLd).map(t=>{let r=t.indexOf("#");return r!==-1?t.slice(0,r).trim():t.trim()}).filter(t=>t.length>0)]}var FJc,wLd,jJc=h(()=>{"use strict";FJc=require("fs/promises");YDr();wLd=/\r?\n/});function QJc(e){return e.output?.location==="rubygems"&&e.github==null}var zJc,MJc=h(()=>{"use strict";zJc="Direct RubyGems publishing is not supported. Add a github block to this generator (for example, github: { repository: your-org/your-ruby-sdk }) so the gem is published by the GitHub Actions workflow generated in that repository."});function _Jc({generatorInvocation:e}){return e.language==="go"?TLd(e):e.outputMode._visit({downloadFiles:()=>{},github:t=>t.publishInfo?._visit({maven:r=>r.coordinate,npm:r=>r.packageName,pypi:r=>r.packageName,postman:()=>{},rubygems:r=>r.packageName,nuget:r=>r.packageName,crates:r=>r.packageName,_other:()=>{}}),githubV2:t=>t.publishInfo?._visit({maven:r=>r.coordinate,npm:r=>r.packageName,pypi:r=>r.packageName,postman:()=>{},rubygems:r=>r.packageName,nuget:r=>r.packageName,crates:r=>r.packageName,_other:()=>{}}),publish:()=>{},publishV2:()=>{},_other:()=>{}})}function TLd(e){return e.outputMode._visit({downloadFiles:()=>{},github:t=>`github.com/${t.owner}/${t.repo}`,githubV2:t=>`github.com/${t.owner}/${t.repo}`,publish:()=>{},publishV2:()=>{},_other:()=>{}})}var LJc,UJc=h(()=>{"use strict";LJc={TYPESCRIPT:"typescript",JAVA:"java",PYTHON:"python",GO:"go",RUBY:"ruby",CSHARP:"csharp",SWIFT:"swift",PHP:"php",RUST:"rust",CLI:"cli"}});function VJc(e){return e==null||!("auto-merge"in e)||e["auto-merge"]!==!0?!1:e.mode==="pull-request"}var GJc=h(()=>{"use strict"});function qJc(e){return typeof e!="string"&&"proto"in e}var WJc=h(()=>{"use strict"});function HJc({rootAutomation:e,groupAutomation:t,generatorAutomation:r}){return{generate:r?.generate??t?.generate??e?.generate??FNr.generate,upgrade:r?.upgrade??t?.upgrade??e?.upgrade??FNr.upgrade,preview:r?.preview??t?.preview??e?.preview??FNr.preview,verify:r?.verify??t?.verify??e?.verify??FNr.verify}}var FNr,KJc=h(()=>{"use strict";FNr={generate:!0,upgrade:!0,preview:!0,verify:!0}});var JJc=h(()=>{"use strict"});var YJc=h(()=>{"use strict"});var XJc,ZJc=h(()=>{"use strict";XJc={Openai:"openai",Anthropic:"anthropic",AwsBedrock:"aws-bedrock"}});var Wvo=h(()=>{"use strict";JJc();YJc();ZJc()});var Hvo={};ne(Hvo,{ModelProvider:()=>XJc});var $Jc=h(()=>{"use strict";Wvo()});var eYc=h(()=>{"use strict"});var Kvo=h(()=>{"use strict";eYc()});var tYc={};var rYc=h(()=>{"use strict";Kvo()});var nYc=h(()=>{"use strict"});var iYc=h(()=>{"use strict"});var oYc=h(()=>{"use strict"});var sYc=h(()=>{"use strict"});var aYc=h(()=>{"use strict"});var cYc=h(()=>{"use strict"});var lYc=h(()=>{"use strict"});var uYc=h(()=>{"use strict"});var pYc=h(()=>{"use strict"});var fYc=h(()=>{"use strict"});var dYc=h(()=>{"use strict"});var mYc=h(()=>{"use strict"});var hYc=h(()=>{"use strict"});var gYc,AYc=h(()=>{"use strict";gYc={ApiKey:"api-key",RefreshToken:"refresh-token"}});var yYc=h(()=>{"use strict"});var bYc=h(()=>{"use strict"});var EYc=h(()=>{"use strict"});var IYc=h(()=>{"use strict"});var vYc=h(()=>{"use strict"});var CYc,xYc=h(()=>{"use strict";CYc={ClientCredentials:"client-credentials",AuthorizationCode:"authorization-code",DeviceCode:"device-code"}});var SYc=h(()=>{"use strict"});var wYc=h(()=>{"use strict"});var TYc=h(()=>{"use strict"});var OYc=h(()=>{"use strict"});var PYc=h(()=>{"use strict"});var BYc=h(()=>{"use strict"});var DYc=h(()=>{"use strict"});var RYc=h(()=>{"use strict"});var kYc=h(()=>{"use strict"});var FYc=h(()=>{"use strict"});var NYc=h(()=>{"use strict"});var Jvo=h(()=>{"use strict";nYc();iYc();oYc();sYc();aYc();cYc();lYc();uYc();pYc();fYc();dYc();mYc();hYc();AYc();yYc();bYc();EYc();IYc();vYc();xYc();SYc();wYc();TYc();OYc();PYc();BYc();DYc();RYc();kYc();FYc();NYc()});var Yvo={};ne(Yvo,{InferredAuthTypeSchema:()=>gYc,OAuthFlowTypeSchema:()=>CYc});var jYc=h(()=>{"use strict";Jvo()});var zYc=h(()=>{"use strict"});var QYc,MYc=h(()=>{"use strict";QYc={InDevelopment:"in-development",PreRelease:"pre-release",Deprecated:"deprecated",GenerallyAvailable:"generally-available"}});var LYc=h(()=>{"use strict"});var Xvo=h(()=>{"use strict";zYc();MYc();LYc()});var Zvo={};ne(Zvo,{AvailabilityStatusSchema:()=>QYc});var _Yc=h(()=>{"use strict";Xvo()});var UYc=h(()=>{"use strict"});var VYc=h(()=>{"use strict"});var GYc=h(()=>{"use strict"});var qYc=h(()=>{"use strict"});var $vo=h(()=>{"use strict";UYc();VYc();GYc();qYc()});var WYc={};var HYc=h(()=>{"use strict";$vo()});var KYc=h(()=>{"use strict"});var JYc=h(()=>{"use strict"});var eCo=h(()=>{"use strict";KYc();JYc()});var YYc={};var XYc=h(()=>{"use strict";eCo()});var ZYc=h(()=>{"use strict"});var $Yc=h(()=>{"use strict"});var eXc=h(()=>{"use strict"});var tXc=h(()=>{"use strict"});var rXc=h(()=>{"use strict"});var tCo=h(()=>{"use strict";ZYc();$Yc();eXc();tXc();rXc()});var nXc={};var iXc=h(()=>{"use strict";tCo()});var oXc=h(()=>{"use strict"});var rCo=h(()=>{"use strict";oXc()});var sXc={};var aXc=h(()=>{"use strict";rCo()});var cXc=h(()=>{"use strict"});var lXc=h(()=>{"use strict"});var uXc=h(()=>{"use strict"});var nCo=h(()=>{"use strict";cXc();lXc();uXc()});var pXc={};var fXc=h(()=>{"use strict";nCo()});var dXc=h(()=>{"use strict"});var mXc=h(()=>{"use strict"});var iCo=h(()=>{"use strict";dXc();mXc()});var hXc={};var gXc=h(()=>{"use strict";iCo()});var AXc=h(()=>{"use strict"});var yXc=h(()=>{"use strict"});var bXc=h(()=>{"use strict"});var EXc=h(()=>{"use strict"});var IXc=h(()=>{"use strict"});var oCo=h(()=>{"use strict";AXc();yXc();bXc();EXc();IXc()});var vXc={};var CXc=h(()=>{"use strict";oCo()});var xXc=h(()=>{"use strict";jYc();Jvo();_Yc();Xvo();HYc();$vo();XYc();eCo();iXc();tCo();aXc();rCo();fXc();nCo();gXc();iCo();CXc();oCo()});var sCo={};ne(sCo,{AvailabilityStatusSchema:()=>QYc,InferredAuthTypeSchema:()=>gYc,OAuthFlowTypeSchema:()=>CYc,auth:()=>Yvo,availability:()=>Zvo,commons:()=>WYc,encoding:()=>YYc,environments:()=>nXc,file:()=>sXc,service:()=>pXc,types:()=>hXc,validation:()=>vXc});var SXc=h(()=>{"use strict";xXc()});var wXc=h(()=>{"use strict"});var TXc=h(()=>{"use strict"});var OXc=h(()=>{"use strict"});var PXc=h(()=>{"use strict"});var BXc=h(()=>{"use strict"});var DXc=h(()=>{"use strict"});var RXc=h(()=>{"use strict"});var kXc=h(()=>{"use strict"});var FXc=h(()=>{"use strict"});var NXc=h(()=>{"use strict"});var jXc=h(()=>{"use strict"});var zXc=h(()=>{"use strict"});var QXc=h(()=>{"use strict"});var MXc,LXc=h(()=>{"use strict";MXc={Literals:"literals",Enums:"enums",EnumsCoerceableToLiterals:"enums-coerceable-to-literals"}});var _Xc=h(()=>{"use strict"});var UXc,VXc=h(()=>{"use strict";UXc={Int32:"int32",Int64:"int64",Uint32:"uint32",Uint64:"uint64"}});var GXc,qXc=h(()=>{"use strict";GXc={Minimal:"minimal",Comprehensive:"comprehensive"}});var WXc,HXc=h(()=>{"use strict";WXc={Form:"form",Json:"json"}});var KXc=h(()=>{"use strict"});var JXc=h(()=>{"use strict"});var YXc=h(()=>{"use strict"});var XXc=h(()=>{"use strict"});var ZXc=h(()=>{"use strict"});var $Xc=h(()=>{"use strict"});var eZc,tZc=h(()=>{"use strict";eZc={Java:"java",Python:"python",Go:"go",Ruby:"ruby",Csharp:"csharp",Typescript:"typescript",Php:"php",Rust:"rust",Swift:"swift"}});var rZc,nZc=h(()=>{"use strict";rZc={V1:"v1",V2:"v2"}});var iZc,oZc=h(()=>{"use strict";iZc={EnvironmentPerServer:"environment-per-server",UrlsPerEnvironment:"urls-per-environment"}});var sZc=h(()=>{"use strict"});var aZc,cZc=h(()=>{"use strict";aZc={All:"all",Untyped:"untyped"}});var lZc=h(()=>{"use strict"});var uZc,pZc=h(()=>{"use strict";uZc={Get:"get",Post:"post",Put:"put",Patch:"patch",Delete:"delete",Head:"head",Options:"options",Trace:"trace"}});var fZc=h(()=>{"use strict"});var dZc=h(()=>{"use strict"});var mZc=h(()=>{"use strict"});var hZc=h(()=>{"use strict"});var gZc=h(()=>{"use strict"});var AZc=h(()=>{"use strict"});var yZc=h(()=>{"use strict"});var bZc=h(()=>{"use strict"});var EZc=h(()=>{"use strict"});var IZc=h(()=>{"use strict"});var vZc,CZc=h(()=>{"use strict";vZc={UrlOrder:"url-order",SpecOrder:"spec-order"}});var xZc=h(()=>{"use strict"});var SZc=h(()=>{"use strict"});var wZc=h(()=>{"use strict"});var TZc=h(()=>{"use strict"});var OZc=h(()=>{"use strict"});var PZc=h(()=>{"use strict"});var BZc=h(()=>{"use strict"});var DZc,RZc=h(()=>{"use strict";DZc={Always:"always",Never:"never"}});var kZc=h(()=>{"use strict"});var FZc=h(()=>{"use strict"});var NZc=h(()=>{"use strict"});var jZc=h(()=>{"use strict"});var zZc=h(()=>{"use strict"});var QZc=h(()=>{"use strict"});var MZc,LZc=h(()=>{"use strict";MZc={V1:"v1"}});var _Zc=h(()=>{"use strict"});var UZc=h(()=>{"use strict"});var aCo=h(()=>{"use strict";wXc();TXc();OXc();PXc();BXc();DXc();RXc();kXc();FXc();NXc();jXc();zXc();QXc();LXc();_Xc();VXc();qXc();HXc();KXc();JXc();YXc();XXc();ZXc();$Xc();tZc();nZc();oZc();sZc();cZc();lZc();pZc();fZc();dZc();mZc();hZc();gZc();AZc();yZc();bZc();EZc();IZc();CZc();xZc();SZc();wZc();TZc();OZc();PZc();BZc();RZc();kZc();FZc();NZc();jZc();zZc();QZc();LZc();_Zc();UZc()});var cCo={};ne(cCo,{CoerceConstsTo:()=>MXc,DefaultIntegerFormat:()=>UXc,ExampleStyle:()=>GXc,FormParameterEncoding:()=>WXc,Language:()=>eZc,MessageNamingSettingsSchema:()=>rZc,MultiServerStrategy:()=>iZc,OpenApiErrorResponsesApplyTo:()=>aZc,OpenApiErrorResponsesHttpMethod:()=>uZc,PathParameterOrder:()=>vZc,RemoveDiscriminantsFromSchemas:()=>DZc,UnionSettingsSchema:()=>MZc});var VZc=h(()=>{"use strict";aCo()});var GZc=h(()=>{"use strict"});var qZc=h(()=>{"use strict"});var WZc=h(()=>{"use strict"});var HZc=h(()=>{"use strict"});var KZc=h(()=>{"use strict"});var JZc=h(()=>{"use strict"});var YZc=h(()=>{"use strict"});var XZc=h(()=>{"use strict"});var ZZc=h(()=>{"use strict"});var $Zc=h(()=>{"use strict"});var e$c=h(()=>{"use strict"});var t$c,r$c=h(()=>{"use strict";t$c={Commit:"commit",Release:"release"}});var n$c=h(()=>{"use strict"});var i$c=h(()=>{"use strict"});var o$c=h(()=>{"use strict"});var s$c=h(()=>{"use strict"});var a$c,c$c=h(()=>{"use strict";a$c={PullRequest:"pull-request",Push:"push",CommitAndRelease:"commit-and-release"}});var l$c=h(()=>{"use strict"});var u$c=h(()=>{"use strict"});var p$c=h(()=>{"use strict"});var f$c=h(()=>{"use strict"});var d$c=h(()=>{"use strict"});var m$c=h(()=>{"use strict"});var h$c=h(()=>{"use strict"});var g$c=h(()=>{"use strict"});var A$c=h(()=>{"use strict"});var y$c=h(()=>{"use strict"});var lCo=h(()=>{"use strict";GZc();qZc();WZc();HZc();KZc();JZc();YZc();XZc();ZZc();$Zc();e$c();r$c();n$c();i$c();o$c();s$c();c$c();l$c();u$c();p$c();f$c();d$c();m$c();h$c();g$c();A$c();y$c()});var uCo={};ne(uCo,{GithubCommitAndReleaseMode:()=>t$c,GithubSelfhostedMode:()=>a$c});var b$c=h(()=>{"use strict";lCo()});var E$c=h(()=>{"use strict"});var I$c=h(()=>{"use strict"});var v$c,C$c=h(()=>{"use strict";v$c={Mit:"MIT",Apache:"Apache-2.0"}});var pCo=h(()=>{"use strict";E$c();I$c();C$c()});var fCo={};ne(fCo,{GithubLicenseType:()=>v$c});var x$c=h(()=>{"use strict";pCo()});var S$c=h(()=>{"use strict"});var dCo=h(()=>{"use strict";S$c()});var w$c={};var T$c=h(()=>{"use strict";dCo()});var O$c=h(()=>{"use strict"});var P$c=h(()=>{"use strict"});var mCo=h(()=>{"use strict";O$c();P$c()});var B$c={};var D$c=h(()=>{"use strict";mCo()});var R$c=h(()=>{"use strict";$Jc();Wvo();rYc();Kvo();SXc();VZc();aCo();b$c();lCo();x$c();pCo();T$c();dCo();D$c();mCo()});var k$c=h(()=>{"use strict";R$c()});var kfe,F$c,hCo,gCo,qj0,N$c=h(()=>{"use strict";kfe={Debug:"debug",Info:"info",Warn:"warn",Error:"error"},F$c={[kfe.Debug]:1,[kfe.Info]:2,[kfe.Warn]:3,[kfe.Error]:4},hCo=class{debug(t,...r){console.debug(t,...r)}info(t,...r){console.info(t,...r)}warn(t,...r){console.warn(t,...r)}error(t,...r){console.error(t,...r)}},gCo=class{level;logger;silent;constructor(t){this.level=F$c[t.level],this.logger=t.logger,this.silent=t.silent}shouldLog(t){return!this.silent&&this.level<=F$c[t]}isDebug(){return this.shouldLog(kfe.Debug)}debug(t,...r){this.isDebug()&&this.logger.debug(t,...r)}isInfo(){return this.shouldLog(kfe.Info)}info(t,...r){this.isInfo()&&this.logger.info(t,...r)}isWarn(){return this.shouldLog(kfe.Warn)}warn(t,...r){this.isWarn()&&this.logger.warn(t,...r)}isError(){return this.shouldLog(kfe.Error)}error(t,...r){this.isError()&&this.logger.error(t,...r)}},qj0=new gCo({level:kfe.Info,logger:new hCo,silent:!0})});var j$c=h(()=>{"use strict"});var z$c=h(()=>{"use strict";N$c()});var Q$c=h(()=>{"use strict"});var Yl,$S=h(()=>{"use strict";Yl={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",NEVER:"never",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",NULLABLE:"nullable",OPTIONAL:"optional",OPTIONAL_NULLABLE:"optionalNullable"}});function pm(e,t){return`Expected ${t}. Received ${PLd(e)}.`}function PLd(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}var UF=h(()=>{"use strict"});function M1(e){return{...e,json:M$c(e.json),parse:M$c(e.parse)}}function M$c(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(o=>" - "+(o.path.length>0?`${o.path.join(".")}: ${o.message}`:o.message))].join(`
|
|
241
|
+
`)),{ok:!0,value:t}):n}}var yee=h(()=>{"use strict"});function Kkr(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var e0o=h(()=>{"use strict"});var qtt,t0o=h(()=>{"use strict";e0o();qtt=class e extends Error{errors;constructor(t){super(t.map(Kkr).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype),this.name="JsonError"}}});var Wtt,r0o=h(()=>{"use strict";e0o();Wtt=class e extends Error{errors;constructor(t){super(t.map(Kkr).join("; ")),this.errors=t,Object.setPrototypeOf(this,e.prototype),this.name="ParseError"}}});function um(e){return{nullable:()=>pLd(e),optional:()=>n0o(e),optionalNullable:()=>fLd(e),transform:t=>i0o(e,t),parseOrThrow:(t,r)=>{let n=e.parse(t,r);if(n.ok)return n.value;throw new Wtt(n.errors)},jsonOrThrow:(t,r)=>{let n=e.json(t,r);if(n.ok)return n.value;throw new qtt(n.errors)}}}function pLd(e){let t={parse:(r,n)=>r==null?{ok:!0,value:null}:e.parse(r,n),json:(r,n)=>r==null?{ok:!0,value:null}:e.json(r,n),getType:()=>fl.NULLABLE};return{...t,...um(t)}}function n0o(e){let t={parse:(r,n)=>r==null?{ok:!0,value:void 0}:e.parse(r,n),json:(r,n)=>n?.omitUndefined&&r===void 0?{ok:!0,value:void 0}:r==null?{ok:!0,value:null}:e.json(r,n),getType:()=>fl.OPTIONAL};return{...t,...um(t)}}function fLd(e){let t={parse:(r,n)=>r===void 0?{ok:!0,value:void 0}:r===null?{ok:!0,value:null}:e.parse(r,n),json:(r,n)=>r===void 0?{ok:!0,value:void 0}:r===null?{ok:!0,value:null}:e.json(r,n),getType:()=>fl.OPTIONAL_NULLABLE};return{...t,...um(t)}}function i0o(e,t){let r={parse:(n,i)=>{let o=e.parse(n,i);return o.ok?{ok:!0,value:t.transform(o.value)}:o},json:(n,i)=>{let o=t.untransform(n);return e.json(o,i)},getType:()=>e.getType()};return{...r,...um(r)}}var eKc=h(()=>{"use strict";XS();t0o();r0o()});var Qz=h(()=>{"use strict";eKc();t0o();r0o()});function tKc(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t=="bigint"?{ok:!0,value:t}:typeof t=="number"?{ok:!0,value:BigInt(t)}:{ok:!1,errors:[{path:r,message:lm(t,"bigint | number")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="bigint"?{ok:!1,errors:[{path:r,message:lm(t,"bigint")}]}:{ok:!0,value:t},getType:()=>fl.BIGINT};return{...ZS(e),...um(e)}}var rKc=h(()=>{"use strict";XS();_F();yee();Qz()});var nKc=h(()=>{"use strict";rKc()});function iKc(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:lm(t,"string")}]}:dLd.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:lm(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:lm(t,"Date object")}]},getType:()=>fl.DATE};return{...ZS(e),...um(e)}}var dLd,oKc=h(()=>{"use strict";XS();_F();yee();Qz();dLd=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/});var sKc=h(()=>{"use strict";oKc()});function N1(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return{...ZS(r),...um(r)}}}var bee=h(()=>{"use strict";Qz();yee()});function O6t(e){let t=new Set(e);return N1(fl.ENUM,(n,{allowUnrecognizedEnumValues:i,breadcrumbsPrefix:o=[]}={})=>typeof n!="string"?{ok:!1,errors:[{path:o,message:lm(n,"string")}]}:!t.has(n)&&!i?{ok:!1,errors:[{path:o,message:lm(n,"enum")}]}:{ok:!0,value:n})()}function aKc(e){return O6t(e).transform({transform:t=>t,untransform:t=>t})}var cKc=h(()=>{"use strict";XS();bee();_F()});var o0o=h(()=>{"use strict";cKc()});function lKc(e){let t=s0o(e);return{...t,...um(t)}}function s0o(e){return{parse:(t,r)=>Htt(e).parse(t,r),json:(t,r)=>Htt(e).json(t,r),getType:()=>Htt(e).getType()}}function Htt(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}var a0o=h(()=>{"use strict";Qz()});function c0o(e){return Object.entries(e)}var uKc=h(()=>{"use strict"});function P6t(e,t){let r=new Set(t);return Object.entries(e).reduce((n,[i,o])=>(r.has(i)&&(n[i]=o),n),{})}var l0o=h(()=>{"use strict"});function Bfe(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return t===null?!0:Object.getPrototypeOf(t)===null}var B6t=h(()=>{"use strict"});function D6t(e){return Object.keys(e)}var u0o=h(()=>{"use strict"});function pKc(e,t){let r=[],n=[];for(let i of e)t(i)?r.push(i):n.push(i);return[r,n]}var fKc=h(()=>{"use strict"});function wH(e){return{withParsedProperties:t=>p0o(e,t)}}function p0o(e,t){let r={parse:(n,i)=>{let o=e.parse(n,i);if(!o.ok)return o;let s={};for(let a in t)if(mLd.call(t,a)){let c=t[a];s[a]=typeof c=="function"?c(o.value):c}return{ok:!0,value:{...o.value,...s}}},json:(n,i)=>{if(!Bfe(n))return{ok:!1,errors:[{path:i?.breadcrumbsPrefix??[],message:lm(n,"object")}]};let o=new Set(Object.keys(t)),s=P6t(n,Object.keys(n).filter(a=>!o.has(a)));return e.json(s,i)},getType:()=>e.getType()};return{...r,...um(r),...wH(r)}}var mLd,dKc=h(()=>{"use strict";l0o();_F();B6t();Qz();mLd=Object.prototype.hasOwnProperty});var R6t=h(()=>{"use strict";dKc()});function mKc(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function Dfe(e){return e.isProperty}var f0o=h(()=>{"use strict"});function Jkr(e){let t;function r(){if(t==null){t={};for(let[d,f]of c0o(e)){let m=Dfe(f)?f.rawKey:d,g=Dfe(f)?f.valueSchema:f;t[m]={rawKey:m,parsedKey:d,valueSchema:g}}}return t}let n,i,o,s;function a(){if(n==null){n=[],i=[];for(let[d,f]of c0o(e)){let m=Dfe(f)?f.rawKey:d,g=Dfe(f)?f.valueSchema:f;gLd(g)&&(n.push(m),i.push(d))}o=new Set(n),s=new Set(i)}return n}function c(){return i==null&&a(),i}function l(){return o==null&&a(),o}function u(){return s==null&&a(),s}let p={_getRawProperties:()=>Object.entries(e).map(([d,f])=>Dfe(f)?f.rawKey:d),_getParsedProperties:()=>D6t(e),parse:(d,f)=>{let m=f?.breadcrumbsPrefix??[];return hKc({value:d,requiredKeys:a(),requiredKeysSet:l(),getProperty:g=>{let A=r()[g];if(A!=null)return{transformedKey:A.parsedKey,transform:y=>{let I=[...m,g];return A.valueSchema.parse(y,{...f,breadcrumbsPrefix:I})}}},unrecognizedObjectKeys:f?.unrecognizedObjectKeys,skipValidation:f?.skipValidation,breadcrumbsPrefix:m,omitUndefined:f?.omitUndefined})},json:(d,f)=>{let m=f?.breadcrumbsPrefix??[];return hKc({value:d,requiredKeys:c(),requiredKeysSet:u(),getProperty:g=>{let A=e[g];if(A!=null)return Dfe(A)?{transformedKey:A.rawKey,transform:y=>{let I=[...m,g];return A.valueSchema.json(y,{...f,breadcrumbsPrefix:I})}}:{transformedKey:g,transform:y=>{let I=[...m,g];return A.json(y,{...f,breadcrumbsPrefix:I})}}},unrecognizedObjectKeys:f?.unrecognizedObjectKeys,skipValidation:f?.skipValidation,breadcrumbsPrefix:m,omitUndefined:f?.omitUndefined})},getType:()=>fl.OBJECT};return{...ZS(p),...um(p),...wH(p),...S6e(p)}}function hKc({value:e,requiredKeys:t,requiredKeysSet:r,getProperty:n,unrecognizedObjectKeys:i="fail",skipValidation:o=!1,breadcrumbsPrefix:s=[]}){if(!Bfe(e))return{ok:!1,errors:[{path:s,message:lm(e,"object")}]};let a=t.length,c=[],l={};for(let u in e){if(!hLd.call(e,u))continue;let p=e[u],d=n(u);if(d!=null){a>0&&r.has(u)&&a--;let f=d.transform(p);if(f.ok)l[d.transformedKey]=f.value;else{l[u]=p;for(let m of f.errors)c.push(m)}}else switch(i){case"fail":c.push({path:[...s,u],message:`Unexpected key "${u}"`});break;case"strip":break;case"passthrough":l[u]=p;break}}if(a>0)for(let u of t)u in e||c.push({path:s,message:`Missing required key "${u}"`});return c.length===0||o?{ok:!0,value:l}:{ok:!1,errors:c}}function S6e(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(n,i)=>gKc({extensionKeys:t._getRawProperties(),value:n,transformBase:o=>e.parse(o,i),transformExtension:o=>t.parse(o,i),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>gKc({extensionKeys:t._getParsedProperties(),value:n,transformBase:o=>e.json(o,i),transformExtension:o=>t.json(o,i),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>fl.OBJECT};return{...r,...um(r),...wH(r),...S6e(r)}},passthrough:()=>{let t=new Set(e._getRawProperties()),r=new Set(e._getParsedProperties()),n={_getParsedProperties:()=>e._getParsedProperties(),_getRawProperties:()=>e._getRawProperties(),parse:(i,o)=>{let s=e.parse(i,{...o,unrecognizedObjectKeys:"passthrough"});if(!s.ok)return s;let a={};if(typeof i=="object"&&i!=null)for(let[c,l]of Object.entries(i))t.has(c)||(a[c]=l);return{ok:!0,value:{...a,...s.value}}},json:(i,o)=>{let s=e.json(i,{...o,unrecognizedObjectKeys:"passthrough"});if(!s.ok)return s;let a={};if(typeof i=="object"&&i!=null)for(let[c,l]of Object.entries(i))r.has(c)||(a[c]=l);return{ok:!0,value:{...a,...s.value}}},getType:()=>fl.OBJECT};return{...n,...um(n),...wH(n),...S6e(n)}}}}function gKc({extensionKeys:e,value:t,transformBase:r,transformExtension:n,breadcrumbsPrefix:i=[]}){if(!Bfe(t))return{ok:!1,errors:[{path:i,message:lm(t,"object")}]};let o=new Set(e),[s,a]=pKc(D6t(t),u=>o.has(u)),c=r(P6t(t,a)),l=n(P6t(t,s));return c.ok&&l.ok?{ok:!0,value:{...c.value,...l.value}}:{ok:!1,errors:[...c.ok?[]:c.errors,...l.ok?[]:l.errors]}}function gLd(e){return!ALd(e)}function ALd(e){switch(e.getType()){case fl.ANY:case fl.UNKNOWN:case fl.OPTIONAL:case fl.OPTIONAL_NULLABLE:return!0;default:return!1}}var hLd,d0o=h(()=>{"use strict";XS();uKc();l0o();_F();B6t();u0o();yee();fKc();R6t();Qz();f0o();hLd=Object.prototype.hasOwnProperty});function AKc(e){return Jkr(e)}var yKc=h(()=>{"use strict";d0o()});var m0o=h(()=>{"use strict";d0o();yKc();f0o()});function bKc(e){let t={...s0o(e),_getRawProperties:()=>Htt(e)._getRawProperties(),_getParsedProperties:()=>Htt(e)._getParsedProperties()};return{...t,...um(t),...wH(t),...S6e(t)}}var EKc=h(()=>{"use strict";m0o();R6t();Qz();a0o()});var IKc=h(()=>{"use strict";a0o();EKc()});function Ykr(e){let t={parse:(r,n)=>vKc(r,(i,o)=>e.parse(i,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`[${o}]`]})),json:(r,n)=>vKc(r,(i,o)=>e.json(i,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`[${o}]`]})),getType:()=>fl.LIST};return{...ZS(t),...um(t)}}function vKc(e,t){if(!Array.isArray(e))return{ok:!1,errors:[{message:lm(e,"list"),path:[]}]};let r=[],n=[];for(let i=0;i<e.length;i++){let o=t(e[i],i);if(o.ok)r.push(o.value);else for(let s of o.errors)n.push(s)}return n.length===0?{ok:!0,value:r}:{ok:!1,errors:n}}var CKc=h(()=>{"use strict";XS();_F();yee();Qz()});var h0o=h(()=>{"use strict";CKc()});function xKc(e){return N1(fl.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:lm(r,`${e.toString()}`)}]})()}var SKc=h(()=>{"use strict";XS();bee();_F()});function wKc(e){return N1(fl.STRING_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:lm(r,`"${e}"`)}]})()}var TKc=h(()=>{"use strict";XS();bee();_F()});var OKc=h(()=>{"use strict";SKc();TKc()});var PKc,BKc=h(()=>{"use strict";XS();bee();PKc=N1(fl.ANY,e=>({ok:!0,value:e}))});var DKc,RKc=h(()=>{"use strict";XS();bee();_F();DKc=N1(fl.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:lm(e,"boolean")}]})});var kKc,FKc=h(()=>{"use strict";XS();bee();kKc=N1(fl.NEVER,(e,{breadcrumbsPrefix:t=[]}={})=>({ok:!1,errors:[{path:t,message:"Expected never"}]}))});var NKc,jKc=h(()=>{"use strict";XS();bee();_F();NKc=N1(fl.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:lm(e,"number")}]})});var zKc,QKc=h(()=>{"use strict";XS();bee();_F();zKc=N1(fl.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:lm(e,"string")}]})});var MKc,LKc=h(()=>{"use strict";XS();bee();MKc=N1(fl.UNKNOWN,e=>({ok:!0,value:e}))});var _Kc=h(()=>{"use strict";BKc();RKc();FKc();jKc();QKc();LKc()});function UKc(e,t){let r={parse:(n,i)=>Xkr({value:n,isKeyNumeric:e.getType()===fl.NUMBER,transformKey:o=>e.parse(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o} (key)`]}),transformValue:(o,s)=>t.parse(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>Xkr({value:n,isKeyNumeric:e.getType()===fl.NUMBER,transformKey:o=>e.json(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o} (key)`]}),transformValue:(o,s)=>t.json(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>fl.RECORD};return{...ZS(r),...um(r)}}function VKc(e,t){let r={parse:(n,i)=>Xkr({value:n,isKeyNumeric:e.getType()===fl.NUMBER,transformKey:o=>e.parse(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o} (key)`]}),transformValue:(o,s)=>t.parse(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>Xkr({value:n,isKeyNumeric:e.getType()===fl.NUMBER,transformKey:o=>e.json(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o} (key)`]}),transformValue:(o,s)=>t.json(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>fl.RECORD};return{...ZS(r),...um(r)}}function Xkr({value:e,isKeyNumeric:t,transformKey:r,transformValue:n,breadcrumbsPrefix:i=[]}){if(!Bfe(e))return{ok:!1,errors:[{path:i,message:lm(e,"object")}]};let o={},s=[];for(let a in e){if(!yLd.call(e,a))continue;let c=e[a];if(c===void 0)continue;let l=a;if(t){let d=a.length>0?Number(a):NaN;Number.isNaN(d)||(l=d)}let u=r(l),p=n(c,l);if(u.ok&&p.ok)o[u.value]=p.value;else{if(!u.ok)for(let d of u.errors)s.push(d);if(!p.ok)for(let d of p.errors)s.push(d)}}return s.length===0?{ok:!0,value:o}:{ok:!1,errors:s}}var yLd,GKc=h(()=>{"use strict";XS();_F();B6t();yee();Qz();yLd=Object.prototype.hasOwnProperty});var qKc=h(()=>{"use strict";GKc()});function WKc(e){let t=Ykr(e),r={parse:(n,i)=>{let o=t.parse(n,i);return o.ok?{ok:!0,value:new Set(o.value)}:o},json:(n,i)=>n instanceof Set?t.json([...n],i):{ok:!1,errors:[{path:i?.breadcrumbsPrefix??[],message:lm(n,"Set")}]},getType:()=>fl.SET};return{...ZS(r),...um(r)}}var HKc=h(()=>{"use strict";XS();_F();yee();h0o();Qz()});var KKc=h(()=>{"use strict";HKc()});function YKc(e){let t={parse:(r,n)=>JKc((i,o)=>i.parse(r,o),e,n),json:(r,n)=>JKc((i,o)=>i.json(r,o),e,n),getType:()=>fl.UNDISCRIMINATED_UNION};return{...ZS(t),...um(t)}}function JKc(e,t,r){let n=[];for(let[i,o]of t.entries()){let s=e(o,{...r,skipValidation:!1});if(s.ok)return s;for(let a of s.errors)n.push({path:a.path,message:`[Variant ${i}] ${a.message}`})}return{ok:!1,errors:n}}var XKc=h(()=>{"use strict";XS();yee();Qz()});var ZKc=h(()=>{"use strict";XKc()});function $Kc(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}var eJc=h(()=>{"use strict"});function rJc(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,n=typeof e=="string"?e:e.parsedDiscriminant,i=O6t(D6t(t)),o={parse:(s,a)=>tJc({value:s,discriminant:r,transformedDiscriminant:n,transformDiscriminantValue:c=>i.parse(c,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...a?.breadcrumbsPrefix??[],r]}),getAdditionalPropertiesSchema:c=>t[c],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(c,l)=>l.parse(c,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),json:(s,a)=>tJc({value:s,discriminant:n,transformedDiscriminant:r,transformDiscriminantValue:c=>i.json(c,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...a?.breadcrumbsPrefix??[],n]}),getAdditionalPropertiesSchema:c=>t[c],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(c,l)=>l.json(c,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),getType:()=>fl.UNION};return{...ZS(o),...um(o),...wH(o)}}function tJc({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:n,getAdditionalPropertiesSchema:i,allowUnrecognizedUnionMembers:o=!1,transformAdditionalProperties:s,breadcrumbsPrefix:a=[]}){if(!Bfe(e))return{ok:!1,errors:[{path:a,message:lm(e,"object")}]};let c=e[t],l={};for(let f in e)bLd.call(e,f)&&f!==t&&(l[f]=e[f]);if(c==null)return{ok:!1,errors:[{path:a,message:`Missing discriminant ("${t}")`}]};let u=n(c);if(!u.ok)return{ok:!1,errors:u.errors};let p=i(u.value);if(p==null)return o?{ok:!0,value:{[r]:u.value,...l}}:{ok:!1,errors:[{path:[...a,t],message:"Unexpected discriminant value"}]};let d=s(l,p);return d.ok?{ok:!0,value:{[r]:c,...d.value}}:d}var bLd,nJc=h(()=>{"use strict";XS();_F();B6t();u0o();yee();o0o();R6t();Qz();bLd=Object.prototype.hasOwnProperty});var iJc=h(()=>{"use strict";eJc();nJc()});var oJc=h(()=>{"use strict";nKc();sKc();o0o();IKc();h0o();OKc();m0o();R6t();_Kc();qKc();Qz();KKc();ZKc();iJc()});var re={};ne(re,{JsonError:()=>qtt,ParseError:()=>Wtt,any:()=>PKc,bigint:()=>tKc,boolean:()=>DKc,booleanLiteral:()=>xKc,date:()=>iKc,discriminant:()=>$Kc,enum_:()=>O6t,forwardCompatibleEnum_:()=>aKc,getObjectLikeUtils:()=>wH,getObjectUtils:()=>S6e,getSchemaUtils:()=>um,isProperty:()=>Dfe,lazy:()=>lKc,lazyObject:()=>bKc,list:()=>Ykr,never:()=>kKc,number:()=>NKc,object:()=>Jkr,objectWithoutOptionalProperties:()=>AKc,optional:()=>n0o,partialRecord:()=>VKc,property:()=>mKc,record:()=>UKc,set:()=>WKc,string:()=>zKc,stringLiteral:()=>wKc,transform:()=>i0o,undiscriminatedUnion:()=>YKc,union:()=>rJc,unknown:()=>MKc,withParsedProperties:()=>p0o});var sJc=h(()=>{"use strict";oJc()});var aJc=h(()=>{"use strict"});var Sr=h(()=>{"use strict";YHc();XHc();ZHc();sJc();aJc()});var Zkr,g0o=h(()=>{"use strict";Sr();Zkr=re.object({href:re.string()})});var $kr,A0o=h(()=>{"use strict";Sr();$kr=re.enum_(["description","subtitle"])});var eFr,y0o=h(()=>{"use strict";Sr();A0o();eFr=re.object({pageDirective:re.property("page-directive",re.string().optional()),pageDescriptionSource:re.property("page-description-source",$kr.optional()),llmsTxt:re.property("llms-txt",re.string().optional()),llmsFullTxt:re.property("llms-full-txt",re.string().optional()),robotsTxt:re.property("robots-txt",re.string().optional())})});var tFr,b0o=h(()=>{"use strict";Sr();tFr=re.object({url:re.string(),title:re.string().optional()})});var rFr,E0o=h(()=>{"use strict";Sr();b0o();rFr=re.undiscriminatedUnion([tFr])});var nFr,I0o=h(()=>{"use strict";Sr();nFr=re.enum_(["docs","slack","discord"])});var iFr,v0o=h(()=>{"use strict";Sr();iFr=re.enum_(["claude-3.7","claude-4","command-a"])});var k6t,C0o=h(()=>{"use strict";Sr();E0o();I0o();v0o();k6t=re.object({model:iFr.optional(),systemPrompt:re.property("system-prompt",re.string().optional()),location:re.list(nFr).optional(),datasources:re.list(rFr).optional(),maskPii:re.property("mask-pii",re.boolean().optional()),disclaimer:re.string().optional(),buttonText:re.property("button-text",re.string().optional())})});var oFr,x0o=h(()=>{"use strict";Sr();oFr=re.object({enabled:re.boolean().optional(),style:re.string().optional()})});var sFr,S0o=h(()=>{"use strict";Sr();sFr=re.object({orgId:re.property("org-id",re.string())})});var aFr,w0o=h(()=>{"use strict";Sr();aFr=re.object({measurementId:re.property("measurement-id",re.string())})});var cFr,T0o=h(()=>{"use strict";Sr();cFr=re.object({containerId:re.property("container-id",re.string())})});var lFr,O0o=h(()=>{"use strict";Sr();lFr=re.object({appId:re.property("app-id",re.string()),apiBase:re.property("api-base",re.string().optional())})});var uFr,P0o=h(()=>{"use strict";Sr();uFr=re.object({apiKey:re.property("api-key",re.string()),endpoint:re.string().optional()})});var pFr,B0o=h(()=>{"use strict";Sr();pFr=re.object({writeKey:re.property("write-key",re.string())})});var fFr,D0o=h(()=>{"use strict";Sr();S0o();w0o();T0o();O0o();P0o();B0o();fFr=re.object({segment:pFr.optional(),fullstory:sFr.optional(),intercom:lFr.optional(),posthog:uFr.optional(),gtm:cFr.optional(),ga4:aFr.optional()})});var pve,F6t=h(()=>{"use strict";Sr();pve=re.object({message:re.string()})});var dFr,R0o=h(()=>{"use strict";Sr();dFr=re.enum_(["all","untyped"])});var mFr,k0o=h(()=>{"use strict";Sr();mFr=re.enum_(["get","post","put","patch","delete","head","options","trace"])});var hFr,F0o=h(()=>{"use strict";Sr();k0o();hFr=re.object({statusCode:re.property("status-code",re.number()),methods:re.list(mFr).optional()})});var gFr,N0o=h(()=>{"use strict";Sr();gFr=re.undiscriminatedUnion([re.string(),re.record(re.string(),re.unknown())])});var AFr,j0o=h(()=>{"use strict";Sr();R0o();F0o();N0o();AFr=re.object({schema:gFr,name:re.string().optional(),applyTo:re.property("apply-to",dFr.optional()),ensure:re.list(hFr).optional()})});var yFr,z0o=h(()=>{"use strict";Sr();j0o();yFr=re.object({typeDatesAsStrings:re.property("type-dates-as-strings",re.boolean().optional()),useBytesForBinaryResponse:re.property("use-bytes-for-binary-response",re.boolean().optional()),respectParameterContent:re.property("respect-parameter-content",re.boolean().optional()),respectOperationIdWordBoundaries:re.property("respect-operation-id-word-boundaries",re.boolean().optional()),inferForwardCompatible:re.property("infer-forward-compatible",re.boolean().optional()),preserveOneOfInAllOf:re.property("preserve-one-of-in-all-of",re.boolean().optional()),anyOfSiblingPropertiesAsObject:re.property("any-of-sibling-properties-as-object",re.boolean().optional()),errorResponses:re.property("error-responses",AFr.optional())})});var bFr,Q0o=h(()=>{"use strict";Sr();bFr=re.enum_(["openapi","asyncapi","graphql"])});var EFr,M0o=h(()=>{"use strict";Sr();z0o();Q0o();EFr=re.object({type:bFr,path:re.string(),namespace:re.string().optional(),overlays:re.string().optional(),overrides:re.list(re.string()).optional(),settings:yFr.optional()})});var N6t,L0o=h(()=>{"use strict";Sr();N6t=re.string()});var Eee,Ktt=h(()=>{"use strict";Sr();L0o();Eee=re.undiscriminatedUnion([N6t,re.list(N6t)])});var j1,Iee=h(()=>{"use strict";Sr();j1=re.enum_(["stable","generally-available","in-development","pre-release","deprecated","beta","alpha","preview","legacy"])});var IFr,_0o=h(()=>{"use strict";Sr();IFr=re.enum_(["open-by-default"])});var vee,Jtt=h(()=>{"use strict";Sr();_0o();vee=re.undiscriminatedUnion([re.boolean(),IFr])});var vFr,U0o=h(()=>{"use strict";Sr();vFr=re.object({href:re.string().optional()})});var Cee,Ytt=h(()=>{"use strict";Sr();U0o();Cee=re.object({hidden:re.boolean().optional(),environments:re.list(re.string()).optional(),button:vFr.optional(),oauth:re.boolean().optional(),limitWebsocketMessagesPerConnection:re.property("limit-websocket-messages-per-connection",re.number().optional()),sendOptionalDefaults:re.property("send-optional-defaults",re.boolean().optional())})});var CFr,V0o=h(()=>{"use strict";Sr();CFr=re.object({version:re.string(),package:re.string()})});var K6,G0o=h(()=>{"use strict";Sr();V0o();K6=re.undiscriminatedUnion([re.string(),CFr])});var xFr,q0o=h(()=>{"use strict";Sr();G0o();xFr=re.object({python:K6.optional(),typescript:K6.optional(),go:K6.optional(),java:K6.optional(),ruby:K6.optional(),csharp:K6.optional(),php:K6.optional(),swift:K6.optional(),rust:K6.optional(),cli:K6.optional()})});var SFr,W0o=h(()=>{"use strict";Sr();SFr=re.enum_(["unset","stable","generally-available","in-development","pre-release","deprecated","beta","alpha","preview","legacy"])});var j6t,H0o=h(()=>{"use strict";Sr();j6t=re.object({flag:re.string(),fallbackValue:re.property("fallback-value",re.unknown().optional()),match:re.unknown().optional()})});var wFr,K0o=h(()=>{"use strict";Sr();H0o();wFr=re.undiscriminatedUnion([re.string(),j6t,re.list(j6t)])});var Bd,z1=h(()=>{"use strict";Sr();K0o();Bd=re.object({featureFlag:re.property("feature-flag",wFr.optional())})});var w6e,TFr=h(()=>{"use strict";Sr();w6e=re.string()});var Xtt,OFr=h(()=>{"use strict";Sr();TFr();Xtt=re.undiscriminatedUnion([w6e,re.list(w6e)])});var Dd,Q1=h(()=>{"use strict";Sr();OFr();Dd=re.object({viewers:Xtt.optional(),orphaned:re.boolean().optional()})});var PFr,J0o=h(()=>{"use strict";Sr();J6();M0o();Ktt();Iee();Jtt();Ytt();q0o();W0o();z1();Q1();PFr=re.object({api:re.string(),apiName:re.property("api-name",re.string().optional()),specs:re.list(EFr).optional(),openrpc:re.string().optional(),audiences:Eee.optional(),displayErrors:re.property("display-errors",re.boolean().optional()),tagDescriptionPages:re.property("tag-description-pages",re.boolean().optional()),snippets:xFr.optional(),postman:re.string().optional(),summary:re.string().optional(),layout:re.list(re.lazy(()=>xee)).optional(),collapsed:vee.optional(),icon:re.string().optional(),slug:re.string().optional(),hidden:re.boolean().optional(),availability:j1.optional(),skipSlug:re.property("skip-slug",re.boolean().optional()),alphabetized:re.boolean().optional(),sortByAvailability:re.property("sort-by-availability",re.list(SFr).optional()),flattened:re.boolean().optional(),paginated:re.boolean().optional(),playground:Cee.optional()}).extend(Dd).extend(Bd)});var BFr,Y0o=h(()=>{"use strict";Sr();Iee();Ytt();z1();Q1();BFr=re.object({endpoint:re.string(),title:re.string().optional(),slug:re.string().optional(),icon:re.string().optional(),hidden:re.boolean().optional(),availability:j1.optional(),playground:Cee.optional()}).extend(Dd).extend(Bd)});var DFr,X0o=h(()=>{"use strict";Sr();DFr=re.enum_(["indented","cards"])});var RFr,Z0o=h(()=>{"use strict";Sr();Iee();z1();Q1();RFr=re.object({operation:re.string(),title:re.string().optional(),slug:re.string().optional(),hidden:re.boolean().optional(),availability:j1.optional()}).extend(Dd).extend(Bd)});var jV,T6e=h(()=>{"use strict";Sr();jV=re.enum_(["_blank","_self","_parent","_top"])});var Ztt,kFr=h(()=>{"use strict";Sr();T6e();Ztt=re.object({link:re.string(),href:re.string(),icon:re.string().optional(),target:jV.optional()})});var zV,O6e=h(()=>{"use strict";Sr();Iee();z1();Q1();zV=re.object({page:re.string(),path:re.string(),slug:re.string().optional(),icon:re.string().optional(),hidden:re.boolean().optional(),noindex:re.boolean().optional(),availability:j1.optional()}).extend(Dd).extend(Bd)});var xee,cJc=h(()=>{"use strict";Sr();J6();Y0o();Z0o();kFr();O6e();xee=re.undiscriminatedUnion([re.string(),re.record(re.string(),re.lazy(()=>FFr)),re.lazyObject(()=>NFr),BFr,RFr,zV,Ztt])});var FFr,lJc=h(()=>{"use strict";Sr();J6();FFr=re.undiscriminatedUnion([re.list(re.lazy(()=>xee)),re.lazyObject(()=>jFr)])});var jFr,uJc=h(()=>{"use strict";Sr();J6();Iee();Ytt();z1();Q1();jFr=re.object({title:re.string().optional(),summary:re.string().optional(),contents:re.list(re.lazy(()=>xee)).optional(),availability:j1.optional(),slug:re.string().optional(),icon:re.string().optional(),hidden:re.boolean().optional(),skipSlug:re.property("skip-slug",re.boolean().optional()),playground:Cee.optional()}).extend(Dd).extend(Bd)});var NFr,pJc=h(()=>{"use strict";Sr();J6();Iee();Jtt();Ytt();z1();Q1();NFr=re.object({section:re.string(),referencedPackages:re.property("referenced-packages",re.list(re.string()).optional()),summary:re.string().optional(),contents:re.list(re.lazy(()=>xee)).optional(),slug:re.string().optional(),icon:re.string().optional(),hidden:re.boolean().optional(),skipSlug:re.property("skip-slug",re.boolean().optional()),collapsed:vee.optional(),collapsible:re.boolean().optional(),collapsedByDefault:re.property("collapsed-by-default",re.boolean().optional()),availability:j1.optional(),playground:Cee.optional()}).extend(Dd).extend(Bd)});var zFr,$0o=h(()=>{"use strict";Sr();zFr=re.object({dark:re.string().optional(),light:re.string().optional()})});var QFr,eIo=h(()=>{"use strict";Sr();$0o();QFr=re.undiscriminatedUnion([re.string(),zFr])});var Rfe,z6t=h(()=>{"use strict";Sr();Rfe=re.string()});var MFr,tIo=h(()=>{"use strict";Sr();z6t();z1();Q1();MFr=re.object({blog:Rfe,title:re.string().optional(),slug:re.string().optional(),icon:re.string().optional(),hidden:re.boolean().optional()}).extend(Dd).extend(Bd)});var LFr,rIo=h(()=>{"use strict";Sr();LFr=re.enum_(["default","canvas"])});var _Fr,nIo=h(()=>{"use strict";Sr();_Fr=re.object({currentPage:re.property("current-page",re.boolean().optional())})});var $tt,UFr=h(()=>{"use strict";Sr();z6t();z1();Q1();$tt=re.object({changelog:Rfe,title:re.string().optional(),slug:re.string().optional(),icon:re.string().optional(),hidden:re.boolean().optional()}).extend(Dd).extend(Bd)});var VFr,iIo=h(()=>{"use strict";Sr();VFr=re.enum_(["timeline","classic"])});var TH,oIo=h(()=>{"use strict";Sr();TH=re.enum_(["warn","error"])});var GFr,sIo=h(()=>{"use strict";Sr();oIo();GFr=re.object({exampleValidation:re.property("example-validation",TH.optional()),brokenLinks:re.property("broken-links",TH.optional()),noNonComponentRefs:re.property("no-non-component-refs",TH.optional()),validLocalReferences:re.property("valid-local-references",TH.optional()),noCircularRedirects:re.property("no-circular-redirects",TH.optional()),validDocsEndpoints:re.property("valid-docs-endpoints",TH.optional()),missingRedirects:re.property("missing-redirects",TH.optional()),validChangelogSlug:re.property("valid-changelog-slug",TH.optional())})});var qFr,aIo=h(()=>{"use strict";Sr();sIo();qFr=re.object({rules:GFr.optional()})});var Q6t,cIo=h(()=>{"use strict";Sr();Q6t=re.enum_(["github-dark","github-dark-default","github-dark-dimmed","github-dark-high-contrast","github-light","github-light-default","github-light-high-contrast","material-theme-darker","min-dark","min-light"])});var WFr,lIo=h(()=>{"use strict";Sr();cIo();WFr=re.object({light:Q6t.optional(),dark:Q6t.optional()})});var HFr,uIo=h(()=>{"use strict";Sr();HFr=re.object({dark:re.string().optional(),light:re.string().optional()})});var qI,pIo=h(()=>{"use strict";Sr();uIo();qI=re.undiscriminatedUnion([re.string(),HFr])});var KFr,fIo=h(()=>{"use strict";Sr();pIo();KFr=re.object({accentPrimary:re.property("accent-primary",qI.optional()),accentPrimaryDeprecated:re.property("accentPrimary",qI.optional()),background:qI.optional(),border:qI.optional(),sidebarBackground:re.property("sidebar-background",qI.optional()),headerBackground:re.property("header-background",qI.optional()),cardBackground:re.property("card-background",qI.optional()),accent1:re.property("accent-1",qI.optional()),accent2:re.property("accent-2",qI.optional()),accent3:re.property("accent-3",qI.optional()),accent4:re.property("accent-4",qI.optional()),accent5:re.property("accent-5",qI.optional()),accent6:re.property("accent-6",qI.optional()),accent7:re.property("accent-7",qI.optional()),accent8:re.property("accent-8",qI.optional()),accent9:re.property("accent-9",qI.optional()),accent10:re.property("accent-10",qI.optional()),accent11:re.property("accent-11",qI.optional()),accent12:re.property("accent-12",qI.optional())})});var JFr,dIo=h(()=>{"use strict";Sr();JFr=re.enum_(["center","left"])});var YFr,mIo=h(()=>{"use strict";Sr();YFr=re.undiscriminatedUnion([re.string(),re.list(re.string())])});var XFr,hIo=h(()=>{"use strict";Sr();XFr=re.undiscriminatedUnion([re.string(),re.list(re.string())])});var ZFr,gIo=h(()=>{"use strict";Sr();ZFr=re.object({title:re.string(),subtitle:re.string().optional(),url:re.string(),icon:re.string().optional(),default:re.boolean().optional()})});var $Fr,AIo=h(()=>{"use strict";Sr();$Fr=re.enum_(["github","dashboard"])});var e2r,yIo=h(()=>{"use strict";Sr();e2r=re.object({host:re.string().optional(),owner:re.string(),repo:re.string(),branch:re.string().optional()})});var t2r,bIo=h(()=>{"use strict";Sr();AIo();yIo();t2r=re.object({github:e2r.optional(),launch:$Fr.optional()})});var r2r,EIo=h(()=>{"use strict";Sr();Ktt();hIo();bIo();r2r=re.object({url:re.string(),customDomain:re.property("custom-domain",XFr.optional()),editThisPage:re.property("edit-this-page",t2r.optional()),audiences:Eee.optional(),multiSource:re.property("multi-source",re.boolean().optional())})});var n2r,IIo=h(()=>{"use strict";Sr();n2r=re.object({allowedOrigins:re.property("allowed-origins",re.list(re.string()))})});var i2r,vIo=h(()=>{"use strict";Sr();i2r=re.enum_(["curl","csharp","go","java","javascript","php","python","ruby","swift","typescript"])});var o2r,CIo=h(()=>{"use strict";Sr();vIo();o2r=re.undiscriminatedUnion([re.boolean(),re.list(i2r)])});var fve,M6t=h(()=>{"use strict";Sr();fve=re.string()});var s2r,xIo=h(()=>{"use strict";Sr();s2r=re.object({prioritizeCurrentProduct:re.property("prioritize-current-product",re.boolean().optional()),defaultFilterByCurrentProduct:re.property("default-filter-by-current-product",re.boolean().optional())})});var ert,a2r=h(()=>{"use strict";Sr();ert=re.enum_(["frontmatter","filename"])});var c2r,SIo=h(()=>{"use strict";Sr();c2r=re.enum_(["flat","grouped"])});var l2r,wIo=h(()=>{"use strict";Sr();IIo();CIo();M6t();xIo();a2r();SIo();l2r=re.object({searchText:re.property("search-text",re.string().optional()),disableSearch:re.property("disable-search",re.boolean().optional()),darkModeCode:re.property("dark-mode-code",re.boolean().optional()),defaultSearchFilters:re.property("default-search-filters",re.boolean().optional()),search:s2r.optional(),httpSnippets:re.property("http-snippets",o2r.optional()),hide404Page:re.property("hide-404-page",re.boolean().optional()),useJavascriptAsTypescript:re.property("use-javascript-as-typescript",re.boolean().optional()),disableExplorerProxy:re.property("disable-explorer-proxy",re.boolean().optional()),disableEnvironmentEditing:re.property("disable-environment-editing",re.boolean().optional()),disableAnalytics:re.property("disable-analytics",re.boolean().optional()),language:fve.optional(),folderTitleSource:re.property("folder-title-source",ert.optional()),substituteEnvVars:re.property("substitute-env-vars",re.boolean().optional()),websocketOneofDisplay:re.property("websocket-oneof-display",c2r.optional()),embedding:n2r.optional(),showHeadersInExamples:re.property("show-headers-in-examples",re.boolean().optional()),requireAnalyticsConsent:re.property("require-analytics-consent",re.boolean().optional())})});var trt,u2r=h(()=>{"use strict";Sr();trt=re.enum_(["normal","italic"])});var rrt,p2r=h(()=>{"use strict";Sr();rrt=re.undiscriminatedUnion([re.string(),re.number()])});var f2r,TIo=h(()=>{"use strict";Sr();u2r();p2r();f2r=re.object({path:re.string(),weight:rrt.optional(),style:trt.optional()})});var d2r,OIo=h(()=>{"use strict";Sr();TIo();d2r=re.undiscriminatedUnion([re.string(),f2r])});var m2r,PIo=h(()=>{"use strict";Sr();m2r=re.enum_(["auto","block","swap","fallback","optional"])});var nrt,BIo=h(()=>{"use strict";Sr();OIo();PIo();u2r();p2r();nrt=re.object({name:re.string().optional(),path:re.string().optional(),weight:rrt.optional(),style:trt.optional(),paths:re.list(d2r).optional(),display:m2r.optional(),fallback:re.list(re.string()).optional(),fontVariationSettings:re.property("font-variation-settings",re.string().optional())})});var h2r,DIo=h(()=>{"use strict";Sr();BIo();h2r=re.object({headingsFont:nrt.optional(),bodyFont:nrt.optional(),codeFont:nrt.optional()})});var g2r,RIo=h(()=>{"use strict";Sr();g2r=re.object({url:re.string(),locale:re.string().optional()})});var A2r,kIo=h(()=>{"use strict";Sr();RIo();A2r=re.undiscriminatedUnion([re.string(),g2r])});var y2r,FIo=h(()=>{"use strict";Sr();kIo();y2r=re.object({mdxComponents:re.property("mdx-components",re.list(re.string()).optional()),disableStreamToggle:re.property("disable-stream-toggle",re.boolean().optional()),openapiParserV2:re.property("openapi-parser-v2",re.boolean().optional()),openapiParserV3:re.property("openapi-parser-v3",re.boolean().optional()),dynamicSnippets:re.property("dynamic-snippets",re.boolean().optional()),aiExamples:re.property("ai-examples",re.boolean().optional()),aiExampleStyleInstructions:re.property("ai-example-style-instructions",re.string().optional()),excludeApis:re.property("exclude-apis",re.boolean().optional()),basepathAware:re.property("basepath-aware",re.boolean().optional()),robotsTxtOnInstanceUrl:re.property("robots-txt-on-instance-url",re.boolean().optional()),externalSitemaps:re.property("external-sitemaps",re.list(A2r).optional())})});var b2r,NIo=h(()=>{"use strict";Sr();b2r=re.object({github:re.string().optional(),twitter:re.string().optional(),x:re.string().optional(),linkedin:re.string().optional(),youtube:re.string().optional(),instagram:re.string().optional(),facebook:re.string().optional(),discord:re.string().optional(),slack:re.string().optional(),hackernews:re.string().optional(),medium:re.string().optional(),website:re.string().optional()})});var E2r,jIo=h(()=>{"use strict";Sr();E2r=re.object({intercom:re.string().optional(),context7:re.string().optional()})});var irt,I2r=h(()=>{"use strict";Sr();irt=re.enum_(["beforeInteractive","afterInteractive","lazyOnload"])});var v2r,zIo=h(()=>{"use strict";Sr();I2r();v2r=re.object({path:re.string(),strategy:irt.optional()})});var C2r,QIo=h(()=>{"use strict";Sr();zIo();C2r=re.undiscriminatedUnion([re.string(),v2r])});var x2r,MIo=h(()=>{"use strict";Sr();I2r();x2r=re.object({url:re.string(),strategy:irt.optional(),disableSri:re.property("disable-sri",re.boolean().optional())})});var L6t,LIo=h(()=>{"use strict";Sr();QIo();MIo();L6t=re.undiscriminatedUnion([x2r,C2r])});var S2r,_Io=h(()=>{"use strict";Sr();LIo();S2r=re.undiscriminatedUnion([L6t,re.list(L6t)])});var w2r,UIo=h(()=>{"use strict";Sr();w2r=re.enum_(["fixed","static"])});var T2r,VIo=h(()=>{"use strict";Sr();T2r=re.enum_(["header","header-tabs","sidebar"])});var O2r,GIo=h(()=>{"use strict";Sr();O2r=re.enum_(["header","sidebar"])});var ort,P2r=h(()=>{"use strict";Sr();ort=re.enum_(["header","sidebar"])});var B2r,qIo=h(()=>{"use strict";Sr();X0o();nIo();iIo();dIo();UIo();VIo();GIo();P2r();B2r=re.object({pageWidth:re.property("page-width",re.string().optional()),contentWidth:re.property("content-width",re.string().optional()),sidebarWidth:re.property("sidebar-width",re.string().optional()),headerHeight:re.property("header-height",re.string().optional()),searchbarPlacement:re.property("searchbar-placement",T2r.optional()),tabsPlacement:re.property("tabs-placement",ort.optional()),switcherPlacement:re.property("switcher-placement",O2r.optional()),contentAlignment:re.property("content-alignment",JFr.optional()),headerPosition:re.property("header-position",w2r.optional()),disableHeader:re.property("disable-header",re.boolean().optional()),hideNavLinks:re.property("hide-nav-links",re.boolean().optional()),hideFeedback:re.property("hide-feedback",re.boolean().optional()),mobileToc:re.property("mobile-toc",re.boolean().optional()),changelogLayout:re.property("changelog-layout",VFr.optional()),apiReferenceLayout:re.property("api-reference-layout",DFr.optional()),apiReferenceExpandProperties:re.property("api-reference-expand-properties",re.boolean().optional()),showNavAvailabilityBadges:re.property("show-nav-availability-badges",re.boolean().optional()),hideWebhookMethodBadges:re.property("hide-webhook-method-badges",re.boolean().optional()),breadcrumbs:_Fr.optional()})});var D2r,WIo=h(()=>{"use strict";Sr();D2r=re.enum_(["kind","header"])});var R2r,HIo=h(()=>{"use strict";Sr();R2r=re.enum_(["compact","hyphenated"])});var k2r,KIo=h(()=>{"use strict";Sr();WIo();HIo();k2r=re.object({doxyfile:re.string().optional(),includeUndocumentedMacros:re.property("include-undocumented-macros",re.boolean().optional()),slugStyle:re.property("slug-style",R2r.optional()),organizeBy:re.property("organize-by",D2r.optional()),include:re.list(re.string()).optional(),exclude:re.list(re.string()).optional(),excludeSymbols:re.property("exclude-symbols",re.list(re.string()).optional())})});var F2r,JIo=h(()=>{"use strict";Sr();F2r=re.object({git:re.string(),subpath:re.string().optional(),ref:re.string().optional()})});var N2r,YIo=h(()=>{"use strict";Sr();N2r=re.object({path:re.string()})});var j2r,XIo=h(()=>{"use strict";Sr();JIo();YIo();j2r=re.undiscriminatedUnion([F2r,N2r])});var z2r,ZIo=h(()=>{"use strict";Sr();z2r=re.enum_(["python","cpp"])});var Q2r,$Io=h(()=>{"use strict";Sr();Q2r=re.object({path:re.string()})});var M2r,evo=h(()=>{"use strict";Sr();KIo();XIo();ZIo();$Io();M2r=re.object({input:j2r,output:Q2r,lang:z2r,config:k2r.optional()})});var srt,L2r=h(()=>{"use strict";Sr();srt=re.string()});var _2r,tvo=h(()=>{"use strict";Sr();_2r=re.object({dark:re.string().optional(),light:re.string().optional(),height:re.number().optional(),href:re.string().optional(),rightText:re.property("right-text",re.string().optional())})});var U2r,rvo=h(()=>{"use strict";Sr();U2r=re.enum_(["dark","light"])});var V2r,nvo=h(()=>{"use strict";Sr();V2r=re.enum_(["summary","summary_large_image","app","player"])});var G2r,ivo=h(()=>{"use strict";Sr();rvo();nvo();G2r=re.object({ogSiteName:re.property("og:site_name",re.string().optional()),ogTitle:re.property("og:title",re.string().optional()),ogDescription:re.property("og:description",re.string().optional()),ogUrl:re.property("og:url",re.string().optional()),ogImage:re.property("og:image",re.string().optional()),ogImageWidth:re.property("og:image:width",re.number().optional()),ogImageHeight:re.property("og:image:height",re.number().optional()),ogLocale:re.property("og:locale",re.string().optional()),ogLogo:re.property("og:logo",re.string().optional()),twitterTitle:re.property("twitter:title",re.string().optional()),twitterDescription:re.property("twitter:description",re.string().optional()),twitterHandle:re.property("twitter:handle",re.string().optional()),twitterImage:re.property("twitter:image",re.string().optional()),twitterSite:re.property("twitter:site",re.string().optional()),twitterUrl:re.property("twitter:url",re.string().optional()),twitterCard:re.property("twitter:card",V2r.optional()),ogDynamic:re.property("og:dynamic",re.boolean().optional()),ogDynamicBackgroundImage:re.property("og:dynamic:background-image",re.string().optional()),ogDynamicTextColor:re.property("og:dynamic:text-color",re.string().optional()),ogDynamicBackgroundColor:re.property("og:dynamic:background-color",re.string().optional()),ogDynamicLogoColor:re.property("og:dynamic:logo-color",U2r.optional()),ogDynamicShowLogo:re.property("og:dynamic:show-logo",re.boolean().optional()),ogDynamicShowSection:re.property("og:dynamic:show-section",re.boolean().optional()),ogDynamicShowDescription:re.property("og:dynamic:show-description",re.boolean().optional()),ogDynamicShowUrl:re.property("og:dynamic:show-url",re.boolean().optional()),ogDynamicShowGradient:re.property("og:dynamic:show-gradient",re.boolean().optional()),canonicalHost:re.property("canonical-host",re.string().optional())})});var dve,_6t=h(()=>{"use strict";Sr();OFr();dve=re.object({viewers:Xtt.optional()})});var See,q2r=h(()=>{"use strict";Sr();T6e();_6t();See=re.object({href:re.string().optional(),target:jV.optional(),url:re.string().optional(),text:re.string().optional(),icon:re.string().optional(),rightIcon:re.string().optional(),rounded:re.boolean().optional()}).extend(dve)});var W2r,ovo=h(()=>{"use strict";Sr();q2r();_6t();W2r=re.object({links:re.list(See),text:re.string().optional(),icon:re.string().optional(),rightIcon:re.string().optional(),rounded:re.boolean().optional()}).extend(dve)});var H2r,svo=h(()=>{"use strict";Sr();T6e();_6t();H2r=re.object({url:re.string(),target:jV.optional()}).extend(dve)});var K2r,avo=h(()=>{"use strict";Sr();svo();K2r=re.undiscriminatedUnion([re.string(),H2r])});var J2r,cvo=h(()=>{"use strict";Sr();ovo();avo();q2r();J2r=re.union("type",{filled:See,outlined:See,minimal:See,github:re.object({value:K2r}),dropdown:W2r,primary:See,secondary:See}).transform({transform:e=>e,untransform:e=>e})});var QV,P6e=h(()=>{"use strict";Sr();QV=re.string()});var Y2r,lvo=h(()=>{"use strict";Sr();J6();P6e();Y2r=re.object({tab:QV,layout:re.list(re.lazy(()=>wee)).optional()})});var X2r,uvo=h(()=>{"use strict";Sr();J6();z1();Q1();X2r=re.object({title:re.string(),subtitle:re.string().optional(),icon:re.string().optional(),layout:re.list(re.lazy(()=>wee)),slug:re.string().optional(),skipSlug:re.property("skip-slug",re.boolean().optional()),hidden:re.boolean().optional(),default:re.boolean().optional()}).extend(Dd).extend(Bd)});var Z2r,pvo=h(()=>{"use strict";Sr();P6e();uvo();Z2r=re.object({tab:QV,variants:re.list(X2r)})});var $2r,fvo=h(()=>{"use strict";Sr();lvo();pvo();$2r=re.undiscriminatedUnion([Y2r,Z2r])});var eNr,dvo=h(()=>{"use strict";Sr();fvo();eNr=re.list($2r)});var tNr,mvo=h(()=>{"use strict";Sr();J6();tNr=re.list(re.lazy(()=>wee))});var mve,U6t=h(()=>{"use strict";Sr();dvo();mvo();mve=re.undiscriminatedUnion([eNr,tNr])});var rNr,hvo=h(()=>{"use strict";Sr();rNr=re.enum_(["copy-page","view-as-markdown","ask-ai","chatgpt","claude","cursor","claude-code","vscode"])});var nNr,gvo=h(()=>{"use strict";Sr();nNr=re.object({name:re.string(),description:re.string().optional(),url:re.string().optional()})});var iNr,Avo=h(()=>{"use strict";Sr();iNr=re.undiscriminatedUnion([re.string(),re.list(re.string())])});var oNr,yvo=h(()=>{"use strict";Sr();gvo();Avo();oNr=re.object({title:re.string().optional(),description:re.string().optional(),learnMoreUrl:re.property("learn-more-url",re.string().optional()),repository:re.string().optional(),installCommand:re.property("install-command",iNr.optional()),skills:re.list(nNr).optional()})});var sNr,bvo=h(()=>{"use strict";Sr();gIo();yvo();sNr=re.object({copyPage:re.property("copy-page",re.boolean().optional()),viewAsMarkdown:re.property("view-as-markdown",re.boolean().optional()),askAi:re.property("ask-ai",re.boolean().optional()),chatgpt:re.boolean().optional(),claude:re.boolean().optional(),claudeCode:re.property("claude-code",re.boolean().optional()),cursor:re.boolean().optional(),mcp:re.boolean().optional(),vscode:re.boolean().optional(),custom:re.list(ZFr).optional(),skills:oNr.optional()})});var aNr,Evo=h(()=>{"use strict";Sr();hvo();bvo();aNr=re.object({default:rNr.optional(),options:sNr.optional()})});var cNr,Ivo=h(()=>{"use strict";Sr();cNr=re.enum_(["deprecated","legacy","ga","stable","beta","alpha","preview"])});var art,lNr=h(()=>{"use strict";Sr();F6t();Ktt();Ivo();z1();Q1();art=re.object({displayName:re.property("display-name",re.string()),path:re.string().optional(),ref:re.string().optional(),slug:re.string().optional(),availability:cNr.optional(),audiences:Eee.optional(),hidden:re.boolean().optional(),default:re.boolean().optional(),announcement:pve.optional()}).extend(Dd).extend(Bd)});var crt,uNr=h(()=>{"use strict";Sr();Ktt();lNr();z1();Q1();crt=re.object({displayName:re.property("display-name",re.string()),subtitle:re.string().optional(),icon:re.string().optional(),image:re.string().optional(),versions:re.list(art).optional(),audiences:Eee.optional()}).extend(Dd).extend(Bd)});var pNr,vvo=h(()=>{"use strict";Sr();uNr();T6e();pNr=re.object({href:re.string(),target:jV.optional()}).extend(crt)});var fNr,Cvo=h(()=>{"use strict";Sr();F6t();uNr();fNr=re.object({path:re.string(),slug:re.string().optional(),announcement:pve.optional()}).extend(crt)});var dNr,xvo=h(()=>{"use strict";Sr();vvo();Cvo();dNr=re.undiscriminatedUnion([fNr,pNr])});var mNr,Svo=h(()=>{"use strict";Sr();mNr=re.enum_(["typescript","javascript","python","java","go","ruby","csharp","php","swift","rust","nodets","nodejs","dotnet","curl","jvm","ts","js"])});var hNr,wvo=h(()=>{"use strict";Sr();hNr=re.object({source:re.string(),destination:re.string(),permanent:re.boolean().optional()})});var gNr,Tvo=h(()=>{"use strict";Sr();wvo();gNr=re.undiscriminatedUnion([re.list(hNr),re.string(),re.list(re.string())])});var hve,V6t=h(()=>{"use strict";Sr();z6t();T6e();z1();Q1();hve=re.object({displayName:re.property("display-name",re.string()),icon:re.string().optional(),slug:re.string().optional(),skipSlug:re.property("skip-slug",re.boolean().optional()),hidden:re.boolean().optional(),href:re.string().optional(),target:jV.optional(),changelog:Rfe.optional(),blog:Rfe.optional()}).extend(Dd).extend(Bd)});var ANr,Ovo=h(()=>{"use strict";Sr();ANr=re.enum_(["default","minimal"])});var yNr,Pvo=h(()=>{"use strict";Sr();yNr=re.enum_(["default","minimal"])});var bNr,Bvo=h(()=>{"use strict";Sr();bNr=re.enum_(["default","toolbar"])});var ENr,Dvo=h(()=>{"use strict";Sr();ENr=re.enum_(["default","toggle","tabs"])});var INr,Rvo=h(()=>{"use strict";Sr();INr=re.enum_(["default","minimal"])});var vNr,kvo=h(()=>{"use strict";Sr();vNr=re.object({enabled:re.boolean().optional(),order:re.list(re.string()).optional(),hide:re.list(re.string()).optional(),labels:re.record(re.string(),re.string()).optional(),showProducts:re.property("show-products",re.boolean().optional())})});var CNr,Fvo=h(()=>{"use strict";Sr();CNr=re.enum_(["left","center"])});var lrt,xNr=h(()=>{"use strict";Sr();lrt=re.enum_(["default","bubble"])});var SNr,Nvo=h(()=>{"use strict";Sr();Fvo();P2r();xNr();SNr=re.object({style:lrt.optional(),alignment:CNr.optional(),placement:ort.optional()})});var wNr,jvo=h(()=>{"use strict";Sr();Nvo();xNr();wNr=re.undiscriminatedUnion([lrt,SNr])});var TNr,zvo=h(()=>{"use strict";Sr();rIo();lIo();Ovo();Pvo();Bvo();Dvo();Rvo();kvo();jvo();TNr=re.object({sidebar:INr.optional(),body:LFr.optional(),tabs:wNr.optional(),pageActions:re.property("page-actions",bNr.optional()),footerNav:re.property("footer-nav",ANr.optional()),languageSwitcher:re.property("language-switcher",yNr.optional()),productSwitcher:re.property("product-switcher",ENr.optional()),siteSwitcher:re.property("site-switcher",vNr.optional()),codeBlocks:re.property("code-blocks",WFr.optional())})});var ONr,Qvo=h(()=>{"use strict";Sr();M6t();ONr=re.object({lang:fve,default:re.boolean().optional()})});var PNr,Mvo=h(()=>{"use strict";Sr();M6t();Qvo();PNr=re.undiscriminatedUnion([fve,ONr])});var fJc,dJc=h(()=>{"use strict";Sr();y0o();C0o();x0o();D0o();F6t();eIo();UFr();aIo();fIo();mIo();EIo();wIo();DIo();FIo();NIo();jIo();_Io();qIo();evo();L2r();tvo();ivo();cvo();U6t();Evo();O6e();xvo();Svo();Tvo();TFr();V6t();P6e();zvo();Mvo();lNr();fJc=re.object({instances:re.list(r2r),title:re.string().optional(),libraries:re.record(srt,M2r).optional(),analytics:fFr.optional(),announcement:pve.optional(),roles:re.list(w6e).optional(),tabs:re.record(QV,hve).optional(),versions:re.list(art).optional(),products:re.list(dNr).optional(),changelog:$tt.optional(),landingPage:re.property("landing-page",zV.optional()),navigation:mve.optional(),navbarLinks:re.property("navbar-links",re.list(J2r).optional()),footerLinks:re.property("footer-links",b2r.optional()),pageActions:re.property("page-actions",aNr.optional()),globalTheme:re.property("global-theme",re.string().optional()),experimental:y2r.optional(),defaultLanguage:re.property("default-language",mNr.optional()),languages:re.list(re.string()).optional(),translations:re.list(PNr).optional(),aiChat:re.property("ai-chat",k6t.optional()),aiSearch:re.property("ai-search",k6t.optional()),aiExamples:re.property("ai-examples",oFr.optional()),agents:eFr.optional(),metadata:G2r.optional(),redirects:gNr.optional(),check:qFr.optional(),logo:_2r.optional(),favicon:re.string().optional(),backgroundImage:re.property("background-image",QFr.optional()),colors:KFr.optional(),typography:h2r.optional(),layout:B2r.optional(),settings:l2r.optional(),theme:TNr.optional(),integrations:E2r.optional(),css:YFr.optional(),js:S2r.optional(),header:re.string().optional(),footer:re.string().optional()})});var BNr,Lvo=h(()=>{"use strict";Sr();Iee();Jtt();a2r();z1();Q1();BNr=re.object({folder:re.string(),title:re.string().optional(),titleSource:re.property("title-source",ert.optional()),slug:re.string().optional(),icon:re.string().optional(),hidden:re.boolean().optional(),skipSlug:re.property("skip-slug",re.boolean().optional()),collapsed:vee.optional(),collapsible:re.boolean().optional(),collapsedByDefault:re.property("collapsed-by-default",re.boolean().optional()),availability:j1.optional()}).extend(Dd).extend(Bd)});var DNr,_vo=h(()=>{"use strict";Sr();L2r();z1();Q1();DNr=re.object({library:srt,title:re.string().optional(),slug:re.string().optional()}).extend(Dd).extend(Bd)});var wee,mJc=h(()=>{"use strict";Sr();J6();J0o();tIo();UFr();Lvo();_vo();kFr();O6e();wee=re.undiscriminatedUnion([zV,re.lazyObject(()=>RNr),PFr,DNr,Ztt,$tt,MFr,BNr])});var hJc,gJc=h(()=>{"use strict";Sr();U6t();O6e();V6t();P6e();hJc=re.object({tabs:re.record(QV,hve).optional(),landingPage:re.property("landing-page",zV.optional()),navigation:mve})});var kNr,Uvo=h(()=>{"use strict";Sr();z1();Q1();kNr=re.object({displayName:re.property("display-name",re.string()),path:re.string(),slug:re.string().optional()}).extend(Dd).extend(Bd)});var AJc,yJc=h(()=>{"use strict";Sr();g0o();Uvo();AJc=re.undiscriminatedUnion([kNr,Zkr])});var RNr,bJc=h(()=>{"use strict";Sr();J6();Iee();Jtt();z1();Q1();RNr=re.object({section:re.string(),path:re.string().optional(),contents:re.list(re.lazy(()=>wee)),collapsed:vee.optional(),collapsible:re.boolean().optional(),collapsedByDefault:re.property("collapsed-by-default",re.boolean().optional()),slug:re.string().optional(),icon:re.string().optional(),hidden:re.boolean().optional(),skipSlug:re.property("skip-slug",re.boolean().optional()),availability:j1.optional()}).extend(Dd).extend(Bd)});var EJc,IJc=h(()=>{"use strict";Sr();U6t();O6e();V6t();P6e();EJc=re.object({tabs:re.record(QV,hve).optional(),landingPage:re.property("landing-page",zV.optional()),navigation:mve})});var Vvo=h(()=>{"use strict";g0o();y0o();C0o();E0o();I0o();v0o();b0o();x0o();D0o();F6t();J0o();Y0o();X0o();cJc();Z0o();lJc();uJc();pJc();M0o();R0o();F0o();k0o();N0o();j0o();z0o();Q0o();Ktt();L0o();Iee();eIo();$0o();tIo();rIo();nIo();UFr();z6t();iIo();aIo();oIo();sIo();lIo();cIo();_0o();Jtt();pIo();fIo();uIo();dIo();mIo();hIo();gIo();dJc();EIo();wIo();DIo();bIo();AIo();IIo();FIo();vvo();kIo();RIo();H0o();K0o();Lvo();BIo();OIo();TIo();PIo();u2r();p2r();NIo();Ovo();S0o();yIo();JIo();w0o();T0o();UIo();vIo();CIo();jIo();O0o();Cvo();_Io();LIo();QIo();zIo();MIo();I2r();M6t();Pvo();qIo();KIo();evo();XIo();ZIo();L2r();WIo();$Io();_vo();HIo();kFr();tvo();ivo();ovo();avo();svo();cvo();q2r();U6t();mJc();rvo();hvo();bvo();Evo();Bvo();O6e();A0o();YIo();U0o();Ytt();P0o();xvo();uNr();gJc();yJc();Dvo();Svo();wvo();Tvo();Uvo();OFr();TFr();VIo();xIo();bJc();B0o();Rvo();kvo();gvo();Avo();yvo();G0o();q0o();W0o();GIo();dvo();fvo();lvo();pvo();V6t();P6e();Fvo();P2r();jvo();Nvo();xNr();uvo();T6e();zvo();a2r();Mvo();Qvo();nvo();mvo();Ivo();lNr();V0o();IJc();SIo();z1();Q1();_6t()});var Gvo={};ne(Gvo,{AbsoluteProductPath:()=>Zkr,AgentsConfig:()=>eFr,AiChatConfig:()=>k6t,AiChatDatasource:()=>rFr,AiChatLocation:()=>nFr,AiChatModel:()=>iFr,AiChatWebsiteDatasource:()=>tFr,AiExamplesConfig:()=>oFr,AnalyticsConfig:()=>fFr,AnnouncementConfig:()=>pve,ApiReferenceConfiguration:()=>PFr,ApiReferenceEndpointConfiguration:()=>BFr,ApiReferenceLayout:()=>DFr,ApiReferenceLayoutItem:()=>xee,ApiReferenceOperationConfiguration:()=>RFr,ApiReferencePackageConfiguration:()=>FFr,ApiReferencePackageConfigurationWithOptions:()=>jFr,ApiReferenceSectionConfiguration:()=>NFr,ApiSpecConfiguration:()=>EFr,ApiSpecErrorResponseApplyTo:()=>dFr,ApiSpecErrorResponseEnsure:()=>hFr,ApiSpecErrorResponseHttpMethod:()=>mFr,ApiSpecErrorResponseSchemaSource:()=>gFr,ApiSpecErrorResponses:()=>AFr,ApiSpecImportSettings:()=>yFr,ApiSpecType:()=>bFr,Audience:()=>Eee,AudienceId:()=>N6t,Availability:()=>j1,BackgroundImageConfiguration:()=>QFr,BackgroundImageThemedConfig:()=>zFr,BlogConfiguration:()=>MFr,BodyThemeConfig:()=>LFr,BreadcrumbsConfig:()=>_Fr,ChangelogConfiguration:()=>$tt,ChangelogFolderRelativePath:()=>Rfe,ChangelogLayout:()=>VFr,CheckConfig:()=>qFr,CheckRuleSeverity:()=>TH,CheckRulesConfig:()=>GFr,CodeBlockTheme:()=>Q6t,CodeBlocksThemeConfig:()=>WFr,CollapsedStringValue:()=>IFr,CollapsedValue:()=>vee,ColorConfig:()=>qI,ColorThemedConfig:()=>HFr,ColorsConfiguration:()=>KFr,ContentAlignment:()=>JFr,CssConfig:()=>YFr,CustomDomain:()=>XFr,CustomPageAction:()=>ZFr,DocsConfiguration:()=>fJc,DocsInstance:()=>r2r,DocsSettingsConfig:()=>l2r,DocsTypographyConfig:()=>h2r,EditThisPageConfig:()=>t2r,EditThisPageLaunch:()=>$Fr,EmbeddingConfig:()=>n2r,ExperimentalConfig:()=>y2r,ExternalProduct:()=>pNr,ExternalSitemap:()=>A2r,ExternalSitemapConfig:()=>g2r,FeatureFlag:()=>j6t,FeatureFlagConfiguration:()=>wFr,FolderConfiguration:()=>BNr,FontConfig:()=>nrt,FontConfigPath:()=>d2r,FontConfigVariant:()=>f2r,FontDisplay:()=>m2r,FontStyle:()=>trt,FontWeight:()=>rrt,FooterLinksConfig:()=>b2r,FooterNavThemeConfig:()=>ANr,FullStoryAnalyticsConfig:()=>sFr,GitLibraryInputSchema:()=>F2r,GithubEditThisPageConfig:()=>e2r,GoogleAnalytics4Config:()=>aFr,GtmConfig:()=>cFr,HeaderPosition:()=>w2r,HttpSnippetLanguage:()=>i2r,HttpSnippetsConfig:()=>o2r,IntegrationsConfig:()=>E2r,IntercomConfig:()=>lFr,InternalProduct:()=>fNr,JsConfig:()=>S2r,JsConfigOptions:()=>L6t,JsFileConfig:()=>C2r,JsFileConfigSettings:()=>v2r,JsRemoteConfig:()=>x2r,JsScriptStrategy:()=>irt,Language:()=>fve,LanguageSwitcherThemeConfig:()=>yNr,LayoutConfig:()=>B2r,LibraryConfig:()=>k2r,LibraryConfiguration:()=>M2r,LibraryInputConfiguration:()=>j2r,LibraryLanguage:()=>z2r,LibraryName:()=>srt,LibraryOrganizeBy:()=>D2r,LibraryOutputConfiguration:()=>Q2r,LibraryReferenceConfiguration:()=>DNr,LibrarySlugStyle:()=>R2r,LinkConfiguration:()=>Ztt,LogoConfiguration:()=>_2r,MetadataConfig:()=>G2r,NavbarDropdownConfig:()=>W2r,NavbarGithubConfig:()=>K2r,NavbarGithubConfigWithOptions:()=>H2r,NavbarLink:()=>J2r,NavbarLinkConfig:()=>See,NavigationConfig:()=>mve,NavigationItem:()=>wee,OgDynamicLogoColor:()=>U2r,PageActionOption:()=>rNr,PageActionOptions:()=>sNr,PageActionsConfig:()=>aNr,PageActionsThemeConfig:()=>bNr,PageConfiguration:()=>zV,PageDescriptionSource:()=>$kr,PathLibraryInputSchema:()=>N2r,PlaygroundButtonSettings:()=>vFr,PlaygroundSettings:()=>Cee,PostHogConfig:()=>uFr,ProductConfig:()=>dNr,ProductConfigBase:()=>crt,ProductFileConfig:()=>hJc,ProductPath:()=>AJc,ProductSwitcherThemeConfig:()=>ENr,ProgrammingLanguage:()=>mNr,RedirectConfig:()=>hNr,RedirectsConfiguration:()=>gNr,RelativeProductPath:()=>kNr,Role:()=>Xtt,RoleId:()=>w6e,SearchSettingsConfig:()=>s2r,SearchbarPlacement:()=>T2r,SectionConfiguration:()=>RNr,SegmentConfig:()=>pFr,SidebarThemeConfig:()=>INr,SiteSwitcherThemeConfig:()=>vNr,SkillEntry:()=>nNr,SkillsInstallCommand:()=>iNr,SkillsPageActionConfig:()=>oNr,SnippetLanguageConfiguration:()=>K6,SnippetsConfiguration:()=>xFr,SortByAvailabilityValue:()=>SFr,SwitcherPlacement:()=>O2r,TabConfig:()=>hve,TabId:()=>QV,TabVariant:()=>X2r,TabbedNavigationConfig:()=>eNr,TabbedNavigationItem:()=>$2r,TabbedNavigationItemWithLayout:()=>Y2r,TabbedNavigationItemWithVariants:()=>Z2r,TabsAlignment:()=>CNr,TabsPlacement:()=>ort,TabsThemeConfig:()=>wNr,TabsThemeObjectConfig:()=>SNr,TabsThemeStyle:()=>lrt,Target:()=>jV,ThemeConfig:()=>TNr,TitleSource:()=>ert,TranslationConfig:()=>PNr,TranslationConfigObject:()=>ONr,TwitterCardSetting:()=>V2r,UntabbedNavigationConfig:()=>tNr,VersionAvailability:()=>cNr,VersionConfig:()=>art,VersionFileConfig:()=>EJc,VersionedSnippetLanguageConfiguration:()=>CFr,WebSocketOneofDisplay:()=>c2r,WithFeatureFlags:()=>Bd,WithPermissions:()=>Dd,WithViewers:()=>dve});var vJc=h(()=>{"use strict";Vvo()});var CJc=h(()=>{"use strict";vJc();Vvo()});var Mz={};ne(Mz,{AbsoluteProductPath:()=>Zkr,AgentsConfig:()=>eFr,AiChatConfig:()=>k6t,AiChatDatasource:()=>rFr,AiChatLocation:()=>nFr,AiChatModel:()=>iFr,AiChatWebsiteDatasource:()=>tFr,AiExamplesConfig:()=>oFr,AnalyticsConfig:()=>fFr,AnnouncementConfig:()=>pve,ApiReferenceConfiguration:()=>PFr,ApiReferenceEndpointConfiguration:()=>BFr,ApiReferenceLayout:()=>DFr,ApiReferenceLayoutItem:()=>xee,ApiReferenceOperationConfiguration:()=>RFr,ApiReferencePackageConfiguration:()=>FFr,ApiReferencePackageConfigurationWithOptions:()=>jFr,ApiReferenceSectionConfiguration:()=>NFr,ApiSpecConfiguration:()=>EFr,ApiSpecErrorResponseApplyTo:()=>dFr,ApiSpecErrorResponseEnsure:()=>hFr,ApiSpecErrorResponseHttpMethod:()=>mFr,ApiSpecErrorResponseSchemaSource:()=>gFr,ApiSpecErrorResponses:()=>AFr,ApiSpecImportSettings:()=>yFr,ApiSpecType:()=>bFr,Audience:()=>Eee,AudienceId:()=>N6t,Availability:()=>j1,BackgroundImageConfiguration:()=>QFr,BackgroundImageThemedConfig:()=>zFr,BlogConfiguration:()=>MFr,BodyThemeConfig:()=>LFr,BreadcrumbsConfig:()=>_Fr,ChangelogConfiguration:()=>$tt,ChangelogFolderRelativePath:()=>Rfe,ChangelogLayout:()=>VFr,CheckConfig:()=>qFr,CheckRuleSeverity:()=>TH,CheckRulesConfig:()=>GFr,CodeBlockTheme:()=>Q6t,CodeBlocksThemeConfig:()=>WFr,CollapsedStringValue:()=>IFr,CollapsedValue:()=>vee,ColorConfig:()=>qI,ColorThemedConfig:()=>HFr,ColorsConfiguration:()=>KFr,ContentAlignment:()=>JFr,CssConfig:()=>YFr,CustomDomain:()=>XFr,CustomPageAction:()=>ZFr,DocsConfiguration:()=>fJc,DocsInstance:()=>r2r,DocsSettingsConfig:()=>l2r,DocsTypographyConfig:()=>h2r,EditThisPageConfig:()=>t2r,EditThisPageLaunch:()=>$Fr,EmbeddingConfig:()=>n2r,ExperimentalConfig:()=>y2r,ExternalProduct:()=>pNr,ExternalSitemap:()=>A2r,ExternalSitemapConfig:()=>g2r,FeatureFlag:()=>j6t,FeatureFlagConfiguration:()=>wFr,FolderConfiguration:()=>BNr,FontConfig:()=>nrt,FontConfigPath:()=>d2r,FontConfigVariant:()=>f2r,FontDisplay:()=>m2r,FontStyle:()=>trt,FontWeight:()=>rrt,FooterLinksConfig:()=>b2r,FooterNavThemeConfig:()=>ANr,FullStoryAnalyticsConfig:()=>sFr,GitLibraryInputSchema:()=>F2r,GithubEditThisPageConfig:()=>e2r,GoogleAnalytics4Config:()=>aFr,GtmConfig:()=>cFr,HeaderPosition:()=>w2r,HttpSnippetLanguage:()=>i2r,HttpSnippetsConfig:()=>o2r,IntegrationsConfig:()=>E2r,IntercomConfig:()=>lFr,InternalProduct:()=>fNr,JsConfig:()=>S2r,JsConfigOptions:()=>L6t,JsFileConfig:()=>C2r,JsFileConfigSettings:()=>v2r,JsRemoteConfig:()=>x2r,JsScriptStrategy:()=>irt,Language:()=>fve,LanguageSwitcherThemeConfig:()=>yNr,LayoutConfig:()=>B2r,LibraryConfig:()=>k2r,LibraryConfiguration:()=>M2r,LibraryInputConfiguration:()=>j2r,LibraryLanguage:()=>z2r,LibraryName:()=>srt,LibraryOrganizeBy:()=>D2r,LibraryOutputConfiguration:()=>Q2r,LibraryReferenceConfiguration:()=>DNr,LibrarySlugStyle:()=>R2r,LinkConfiguration:()=>Ztt,LogoConfiguration:()=>_2r,MetadataConfig:()=>G2r,NavbarDropdownConfig:()=>W2r,NavbarGithubConfig:()=>K2r,NavbarGithubConfigWithOptions:()=>H2r,NavbarLink:()=>J2r,NavbarLinkConfig:()=>See,NavigationConfig:()=>mve,NavigationItem:()=>wee,OgDynamicLogoColor:()=>U2r,PageActionOption:()=>rNr,PageActionOptions:()=>sNr,PageActionsConfig:()=>aNr,PageActionsThemeConfig:()=>bNr,PageConfiguration:()=>zV,PageDescriptionSource:()=>$kr,PathLibraryInputSchema:()=>N2r,PlaygroundButtonSettings:()=>vFr,PlaygroundSettings:()=>Cee,PostHogConfig:()=>uFr,ProductConfig:()=>dNr,ProductConfigBase:()=>crt,ProductFileConfig:()=>hJc,ProductPath:()=>AJc,ProductSwitcherThemeConfig:()=>ENr,ProgrammingLanguage:()=>mNr,RedirectConfig:()=>hNr,RedirectsConfiguration:()=>gNr,RelativeProductPath:()=>kNr,Role:()=>Xtt,RoleId:()=>w6e,SearchSettingsConfig:()=>s2r,SearchbarPlacement:()=>T2r,SectionConfiguration:()=>RNr,SegmentConfig:()=>pFr,SidebarThemeConfig:()=>INr,SiteSwitcherThemeConfig:()=>vNr,SkillEntry:()=>nNr,SkillsInstallCommand:()=>iNr,SkillsPageActionConfig:()=>oNr,SnippetLanguageConfiguration:()=>K6,SnippetsConfiguration:()=>xFr,SortByAvailabilityValue:()=>SFr,SwitcherPlacement:()=>O2r,TabConfig:()=>hve,TabId:()=>QV,TabVariant:()=>X2r,TabbedNavigationConfig:()=>eNr,TabbedNavigationItem:()=>$2r,TabbedNavigationItemWithLayout:()=>Y2r,TabbedNavigationItemWithVariants:()=>Z2r,TabsAlignment:()=>CNr,TabsPlacement:()=>ort,TabsThemeConfig:()=>wNr,TabsThemeObjectConfig:()=>SNr,TabsThemeStyle:()=>lrt,Target:()=>jV,ThemeConfig:()=>TNr,TitleSource:()=>ert,TranslationConfig:()=>PNr,TranslationConfigObject:()=>ONr,TwitterCardSetting:()=>V2r,UntabbedNavigationConfig:()=>tNr,VersionAvailability:()=>cNr,VersionConfig:()=>art,VersionFileConfig:()=>EJc,VersionedSnippetLanguageConfiguration:()=>CFr,WebSocketOneofDisplay:()=>c2r,WithFeatureFlags:()=>Bd,WithPermissions:()=>Dd,WithViewers:()=>dve,docs:()=>Gvo});var J6=h(()=>{"use strict";CJc()});var xJc=h(()=>{"use strict";JEo();YEo();JHc();J6()});var qvo={};ne(qvo,{AiChatLocation:()=>oEo,AiChatModel:()=>sEo,ApiReferenceLayout:()=>aEo,ApiSpecErrorResponseApplyTo:()=>cEo,ApiSpecErrorResponseHttpMethod:()=>lEo,ApiSpecType:()=>uEo,Availability:()=>pEo,BodyThemeConfig:()=>fEo,ChangelogLayout:()=>dEo,CheckRuleSeverity:()=>mEo,CodeBlockTheme:()=>hEo,CollapsedStringValue:()=>gEo,ContentAlignment:()=>AEo,EditThisPageLaunch:()=>yEo,FernDocsConfig:()=>KEo,FernDocsConfigError:()=>x6e,FernDocsConfigTimeoutError:()=>w6t,FontDisplay:()=>bEo,FontStyle:()=>EEo,FooterNavThemeConfig:()=>IEo,HeaderPosition:()=>vEo,HttpSnippetLanguage:()=>CEo,JsScriptStrategy:()=>xEo,LanguageSwitcherThemeConfig:()=>SEo,LibraryLanguage:()=>wEo,LibraryOrganizeBy:()=>TEo,LibrarySlugStyle:()=>OEo,OgDynamicLogoColor:()=>PEo,PageActionOption:()=>BEo,PageActionsThemeConfig:()=>DEo,PageDescriptionSource:()=>REo,ProductSwitcherThemeConfig:()=>kEo,ProgrammingLanguage:()=>FEo,SearchbarPlacement:()=>NEo,Serializer:()=>Mz,SidebarThemeConfig:()=>jEo,SortByAvailabilityValue:()=>zEo,SwitcherPlacement:()=>QEo,TabsAlignment:()=>MEo,TabsPlacement:()=>LEo,TabsThemeStyle:()=>_Eo,Target:()=>UEo,TitleSource:()=>VEo,TwitterCardSetting:()=>GEo,VersionAvailability:()=>qEo,WebSocketOneofDisplay:()=>WEo,docs:()=>Hkr,logging:()=>$Eo,serialization:()=>Mz});var SJc=h(()=>{"use strict";xJc();JEo();J6()});function ILd(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}var wJc,TJc,vLd,OJc=h(()=>{"use strict";wJc={logo:"global",favicon:"global",backgroundImage:"global",colors:"global",typography:"global",layout:"global",settings:"global",theme:"global",integrations:"global",css:"global",js:"global",header:"global",footer:"global",navbarLinks:"global",footerLinks:"global",aiSearch:"global",announcement:"global",metadata:"global"},TJc=Object.keys(wJc);vLd=new Set(TJc.map(ILd))});function BJc(e){if(e.trim()!==e||e.length===0)return`Origin "${e}" must not be empty or contain surrounding whitespace`;if(e==="*"||e.startsWith("*"))return`Origin "${e}" is not allowed: a bare wildcard would let any site embed your docs. Use a scoped wildcard such as https://*.example.com instead`;if(!CLd.test(e))return`Origin "${e}" is not a valid origin. Expected scheme://host[:port] with no path, query, or CSP keywords, e.g. https://app.example.com or https://*.example.com`}function xLd(e){let t=[];return e.forEach((r,n)=>{let i=BJc(r);i!=null&&t.push(`settings.embedding.allowed-origins[${n}]: ${i}`)}),t}var PJc,CLd,DJc=h(()=>{"use strict";PJc="[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?",CLd=new RegExp(`^https?://(?:\\*\\.)?${PJc}(?:\\.${PJc})*(?::\\d{1,5})?$`)});var Fa={};ne(Fa,{DEFAULT_BLOG_TITLE:()=>nLd,DEFAULT_CHANGELOG_TITLE:()=>rLd,DocsYmlSchemas:()=>iEo,RawSchemas:()=>qvo,THEME_ELIGIBLE_FIELDS:()=>TJc,THEME_ELIGIBLE_YAML_KEYS:()=>vLd,THEME_FIELD_POLICIES:()=>wJc,getChangelogFolderFromNavigationItem:()=>iLd,getChangelogFolderFromTabConfig:()=>oLd,getEmbeddingOriginErrors:()=>xLd,validateEmbeddingOrigin:()=>BJc});var RJc=h(()=>{"use strict";Sqc();wqc();Tqc();SJc();OJc();DJc()});var kJc=h(()=>{"use strict"});async function Tee({absolutePathToFernignore:e}){let t=(await(0,FJc.readFile)(e)).toString();return NJc(t)}function NJc(e){return[F1,...e.trim().split(wLd).map(t=>{let r=t.indexOf("#");return r!==-1?t.slice(0,r).trim():t.trim()}).filter(t=>t.length>0)]}var FJc,wLd,jJc=h(()=>{"use strict";FJc=require("fs/promises");YDr();wLd=/\r?\n/});function QJc(e){return e.output?.location==="rubygems"&&e.github==null}var zJc,MJc=h(()=>{"use strict";zJc="Direct RubyGems publishing is not supported. Add a github block to this generator (for example, github: { repository: your-org/your-ruby-sdk }) so the gem is published by the GitHub Actions workflow generated in that repository."});function _Jc({generatorInvocation:e}){return e.language==="go"?TLd(e):e.outputMode._visit({downloadFiles:()=>{},github:t=>t.publishInfo?._visit({maven:r=>r.coordinate,npm:r=>r.packageName,pypi:r=>r.packageName,postman:()=>{},rubygems:r=>r.packageName,nuget:r=>r.packageName,crates:r=>r.packageName,_other:()=>{}}),githubV2:t=>t.publishInfo?._visit({maven:r=>r.coordinate,npm:r=>r.packageName,pypi:r=>r.packageName,postman:()=>{},rubygems:r=>r.packageName,nuget:r=>r.packageName,crates:r=>r.packageName,_other:()=>{}}),publish:()=>{},publishV2:()=>{},_other:()=>{}})}function TLd(e){return e.outputMode._visit({downloadFiles:()=>{},github:t=>`github.com/${t.owner}/${t.repo}`,githubV2:t=>`github.com/${t.owner}/${t.repo}`,publish:()=>{},publishV2:()=>{},_other:()=>{}})}var LJc,UJc=h(()=>{"use strict";LJc={TYPESCRIPT:"typescript",JAVA:"java",PYTHON:"python",GO:"go",RUBY:"ruby",CSHARP:"csharp",SWIFT:"swift",PHP:"php",RUST:"rust",CLI:"cli"}});function VJc(e){return e==null||!("auto-merge"in e)||e["auto-merge"]!==!0?!1:e.mode==="pull-request"}var GJc=h(()=>{"use strict"});function qJc(e){return typeof e!="string"&&"proto"in e}var WJc=h(()=>{"use strict"});function HJc({rootAutomation:e,groupAutomation:t,generatorAutomation:r}){return{generate:r?.generate??t?.generate??e?.generate??FNr.generate,upgrade:r?.upgrade??t?.upgrade??e?.upgrade??FNr.upgrade,preview:r?.preview??t?.preview??e?.preview??FNr.preview,verify:r?.verify??t?.verify??e?.verify??FNr.verify}}var FNr,KJc=h(()=>{"use strict";FNr={generate:!0,upgrade:!0,preview:!0,verify:!0}});var JJc=h(()=>{"use strict"});var YJc=h(()=>{"use strict"});var XJc,ZJc=h(()=>{"use strict";XJc={Openai:"openai",Anthropic:"anthropic",AwsBedrock:"aws-bedrock"}});var Wvo=h(()=>{"use strict";JJc();YJc();ZJc()});var Hvo={};ne(Hvo,{ModelProvider:()=>XJc});var $Jc=h(()=>{"use strict";Wvo()});var eYc=h(()=>{"use strict"});var Kvo=h(()=>{"use strict";eYc()});var tYc={};var rYc=h(()=>{"use strict";Kvo()});var nYc=h(()=>{"use strict"});var iYc=h(()=>{"use strict"});var oYc=h(()=>{"use strict"});var sYc=h(()=>{"use strict"});var aYc=h(()=>{"use strict"});var cYc=h(()=>{"use strict"});var lYc=h(()=>{"use strict"});var uYc=h(()=>{"use strict"});var pYc=h(()=>{"use strict"});var fYc=h(()=>{"use strict"});var dYc=h(()=>{"use strict"});var mYc=h(()=>{"use strict"});var hYc=h(()=>{"use strict"});var gYc,AYc=h(()=>{"use strict";gYc={ApiKey:"api-key",RefreshToken:"refresh-token"}});var yYc=h(()=>{"use strict"});var bYc=h(()=>{"use strict"});var EYc=h(()=>{"use strict"});var IYc=h(()=>{"use strict"});var vYc=h(()=>{"use strict"});var CYc,xYc=h(()=>{"use strict";CYc={ClientCredentials:"client-credentials",AuthorizationCode:"authorization-code",DeviceCode:"device-code"}});var SYc=h(()=>{"use strict"});var wYc=h(()=>{"use strict"});var TYc=h(()=>{"use strict"});var OYc=h(()=>{"use strict"});var PYc=h(()=>{"use strict"});var BYc=h(()=>{"use strict"});var DYc=h(()=>{"use strict"});var RYc=h(()=>{"use strict"});var kYc=h(()=>{"use strict"});var FYc=h(()=>{"use strict"});var NYc=h(()=>{"use strict"});var Jvo=h(()=>{"use strict";nYc();iYc();oYc();sYc();aYc();cYc();lYc();uYc();pYc();fYc();dYc();mYc();hYc();AYc();yYc();bYc();EYc();IYc();vYc();xYc();SYc();wYc();TYc();OYc();PYc();BYc();DYc();RYc();kYc();FYc();NYc()});var Yvo={};ne(Yvo,{InferredAuthTypeSchema:()=>gYc,OAuthFlowTypeSchema:()=>CYc});var jYc=h(()=>{"use strict";Jvo()});var zYc=h(()=>{"use strict"});var QYc,MYc=h(()=>{"use strict";QYc={InDevelopment:"in-development",PreRelease:"pre-release",Deprecated:"deprecated",GenerallyAvailable:"generally-available"}});var LYc=h(()=>{"use strict"});var Xvo=h(()=>{"use strict";zYc();MYc();LYc()});var Zvo={};ne(Zvo,{AvailabilityStatusSchema:()=>QYc});var _Yc=h(()=>{"use strict";Xvo()});var UYc=h(()=>{"use strict"});var VYc=h(()=>{"use strict"});var GYc=h(()=>{"use strict"});var qYc=h(()=>{"use strict"});var $vo=h(()=>{"use strict";UYc();VYc();GYc();qYc()});var WYc={};var HYc=h(()=>{"use strict";$vo()});var KYc=h(()=>{"use strict"});var JYc=h(()=>{"use strict"});var eCo=h(()=>{"use strict";KYc();JYc()});var YYc={};var XYc=h(()=>{"use strict";eCo()});var ZYc=h(()=>{"use strict"});var $Yc=h(()=>{"use strict"});var eXc=h(()=>{"use strict"});var tXc=h(()=>{"use strict"});var rXc=h(()=>{"use strict"});var tCo=h(()=>{"use strict";ZYc();$Yc();eXc();tXc();rXc()});var nXc={};var iXc=h(()=>{"use strict";tCo()});var oXc=h(()=>{"use strict"});var rCo=h(()=>{"use strict";oXc()});var sXc={};var aXc=h(()=>{"use strict";rCo()});var cXc=h(()=>{"use strict"});var lXc=h(()=>{"use strict"});var uXc=h(()=>{"use strict"});var nCo=h(()=>{"use strict";cXc();lXc();uXc()});var pXc={};var fXc=h(()=>{"use strict";nCo()});var dXc=h(()=>{"use strict"});var mXc=h(()=>{"use strict"});var iCo=h(()=>{"use strict";dXc();mXc()});var hXc={};var gXc=h(()=>{"use strict";iCo()});var AXc=h(()=>{"use strict"});var yXc=h(()=>{"use strict"});var bXc=h(()=>{"use strict"});var EXc=h(()=>{"use strict"});var IXc=h(()=>{"use strict"});var oCo=h(()=>{"use strict";AXc();yXc();bXc();EXc();IXc()});var vXc={};var CXc=h(()=>{"use strict";oCo()});var xXc=h(()=>{"use strict";jYc();Jvo();_Yc();Xvo();HYc();$vo();XYc();eCo();iXc();tCo();aXc();rCo();fXc();nCo();gXc();iCo();CXc();oCo()});var sCo={};ne(sCo,{AvailabilityStatusSchema:()=>QYc,InferredAuthTypeSchema:()=>gYc,OAuthFlowTypeSchema:()=>CYc,auth:()=>Yvo,availability:()=>Zvo,commons:()=>WYc,encoding:()=>YYc,environments:()=>nXc,file:()=>sXc,service:()=>pXc,types:()=>hXc,validation:()=>vXc});var SXc=h(()=>{"use strict";xXc()});var wXc=h(()=>{"use strict"});var TXc=h(()=>{"use strict"});var OXc=h(()=>{"use strict"});var PXc=h(()=>{"use strict"});var BXc=h(()=>{"use strict"});var DXc=h(()=>{"use strict"});var RXc=h(()=>{"use strict"});var kXc=h(()=>{"use strict"});var FXc=h(()=>{"use strict"});var NXc=h(()=>{"use strict"});var jXc=h(()=>{"use strict"});var zXc=h(()=>{"use strict"});var QXc=h(()=>{"use strict"});var MXc,LXc=h(()=>{"use strict";MXc={Literals:"literals",Enums:"enums",EnumsCoerceableToLiterals:"enums-coerceable-to-literals"}});var _Xc=h(()=>{"use strict"});var UXc,VXc=h(()=>{"use strict";UXc={Int32:"int32",Int64:"int64",Uint32:"uint32",Uint64:"uint64"}});var GXc,qXc=h(()=>{"use strict";GXc={Minimal:"minimal",Comprehensive:"comprehensive"}});var WXc,HXc=h(()=>{"use strict";WXc={Form:"form",Json:"json"}});var KXc=h(()=>{"use strict"});var JXc=h(()=>{"use strict"});var YXc=h(()=>{"use strict"});var XXc=h(()=>{"use strict"});var ZXc=h(()=>{"use strict"});var $Xc=h(()=>{"use strict"});var eZc,tZc=h(()=>{"use strict";eZc={Java:"java",Python:"python",Go:"go",Ruby:"ruby",Csharp:"csharp",Typescript:"typescript",Php:"php",Rust:"rust",Swift:"swift"}});var rZc,nZc=h(()=>{"use strict";rZc={V1:"v1",V2:"v2"}});var iZc,oZc=h(()=>{"use strict";iZc={EnvironmentPerServer:"environment-per-server",UrlsPerEnvironment:"urls-per-environment"}});var sZc=h(()=>{"use strict"});var aZc,cZc=h(()=>{"use strict";aZc={All:"all",Untyped:"untyped"}});var lZc=h(()=>{"use strict"});var uZc,pZc=h(()=>{"use strict";uZc={Get:"get",Post:"post",Put:"put",Patch:"patch",Delete:"delete",Head:"head",Options:"options",Trace:"trace"}});var fZc=h(()=>{"use strict"});var dZc=h(()=>{"use strict"});var mZc=h(()=>{"use strict"});var hZc=h(()=>{"use strict"});var gZc=h(()=>{"use strict"});var AZc=h(()=>{"use strict"});var yZc=h(()=>{"use strict"});var bZc=h(()=>{"use strict"});var EZc=h(()=>{"use strict"});var IZc=h(()=>{"use strict"});var vZc,CZc=h(()=>{"use strict";vZc={UrlOrder:"url-order",SpecOrder:"spec-order"}});var xZc=h(()=>{"use strict"});var SZc=h(()=>{"use strict"});var wZc=h(()=>{"use strict"});var TZc=h(()=>{"use strict"});var OZc=h(()=>{"use strict"});var PZc=h(()=>{"use strict"});var BZc=h(()=>{"use strict"});var DZc,RZc=h(()=>{"use strict";DZc={Always:"always",Never:"never"}});var kZc=h(()=>{"use strict"});var FZc=h(()=>{"use strict"});var NZc=h(()=>{"use strict"});var jZc=h(()=>{"use strict"});var zZc=h(()=>{"use strict"});var QZc=h(()=>{"use strict"});var MZc,LZc=h(()=>{"use strict";MZc={V1:"v1"}});var _Zc=h(()=>{"use strict"});var UZc=h(()=>{"use strict"});var aCo=h(()=>{"use strict";wXc();TXc();OXc();PXc();BXc();DXc();RXc();kXc();FXc();NXc();jXc();zXc();QXc();LXc();_Xc();VXc();qXc();HXc();KXc();JXc();YXc();XXc();ZXc();$Xc();tZc();nZc();oZc();sZc();cZc();lZc();pZc();fZc();dZc();mZc();hZc();gZc();AZc();yZc();bZc();EZc();IZc();CZc();xZc();SZc();wZc();TZc();OZc();PZc();BZc();RZc();kZc();FZc();NZc();jZc();zZc();QZc();LZc();_Zc();UZc()});var cCo={};ne(cCo,{CoerceConstsTo:()=>MXc,DefaultIntegerFormat:()=>UXc,ExampleStyle:()=>GXc,FormParameterEncoding:()=>WXc,Language:()=>eZc,MessageNamingSettingsSchema:()=>rZc,MultiServerStrategy:()=>iZc,OpenApiErrorResponsesApplyTo:()=>aZc,OpenApiErrorResponsesHttpMethod:()=>uZc,PathParameterOrder:()=>vZc,RemoveDiscriminantsFromSchemas:()=>DZc,UnionSettingsSchema:()=>MZc});var VZc=h(()=>{"use strict";aCo()});var GZc=h(()=>{"use strict"});var qZc=h(()=>{"use strict"});var WZc=h(()=>{"use strict"});var HZc=h(()=>{"use strict"});var KZc=h(()=>{"use strict"});var JZc=h(()=>{"use strict"});var YZc=h(()=>{"use strict"});var XZc=h(()=>{"use strict"});var ZZc=h(()=>{"use strict"});var $Zc=h(()=>{"use strict"});var e$c=h(()=>{"use strict"});var t$c,r$c=h(()=>{"use strict";t$c={Commit:"commit",Release:"release"}});var n$c=h(()=>{"use strict"});var i$c=h(()=>{"use strict"});var o$c=h(()=>{"use strict"});var s$c=h(()=>{"use strict"});var a$c,c$c=h(()=>{"use strict";a$c={PullRequest:"pull-request",Push:"push",CommitAndRelease:"commit-and-release"}});var l$c=h(()=>{"use strict"});var u$c=h(()=>{"use strict"});var p$c=h(()=>{"use strict"});var f$c=h(()=>{"use strict"});var d$c=h(()=>{"use strict"});var m$c=h(()=>{"use strict"});var h$c=h(()=>{"use strict"});var g$c=h(()=>{"use strict"});var A$c=h(()=>{"use strict"});var y$c=h(()=>{"use strict"});var lCo=h(()=>{"use strict";GZc();qZc();WZc();HZc();KZc();JZc();YZc();XZc();ZZc();$Zc();e$c();r$c();n$c();i$c();o$c();s$c();c$c();l$c();u$c();p$c();f$c();d$c();m$c();h$c();g$c();A$c();y$c()});var uCo={};ne(uCo,{GithubCommitAndReleaseMode:()=>t$c,GithubSelfhostedMode:()=>a$c});var b$c=h(()=>{"use strict";lCo()});var E$c=h(()=>{"use strict"});var I$c=h(()=>{"use strict"});var v$c,C$c=h(()=>{"use strict";v$c={Mit:"MIT",Apache:"Apache-2.0"}});var pCo=h(()=>{"use strict";E$c();I$c();C$c()});var fCo={};ne(fCo,{GithubLicenseType:()=>v$c});var x$c=h(()=>{"use strict";pCo()});var S$c=h(()=>{"use strict"});var dCo=h(()=>{"use strict";S$c()});var w$c={};var T$c=h(()=>{"use strict";dCo()});var O$c=h(()=>{"use strict"});var P$c=h(()=>{"use strict"});var mCo=h(()=>{"use strict";O$c();P$c()});var B$c={};var D$c=h(()=>{"use strict";mCo()});var R$c=h(()=>{"use strict";$Jc();Wvo();rYc();Kvo();SXc();VZc();aCo();b$c();lCo();x$c();pCo();T$c();dCo();D$c();mCo()});var k$c=h(()=>{"use strict";R$c()});var kfe,F$c,hCo,gCo,qj0,N$c=h(()=>{"use strict";kfe={Debug:"debug",Info:"info",Warn:"warn",Error:"error"},F$c={[kfe.Debug]:1,[kfe.Info]:2,[kfe.Warn]:3,[kfe.Error]:4},hCo=class{debug(t,...r){console.debug(t,...r)}info(t,...r){console.info(t,...r)}warn(t,...r){console.warn(t,...r)}error(t,...r){console.error(t,...r)}},gCo=class{level;logger;silent;constructor(t){this.level=F$c[t.level],this.logger=t.logger,this.silent=t.silent}shouldLog(t){return!this.silent&&this.level<=F$c[t]}isDebug(){return this.shouldLog(kfe.Debug)}debug(t,...r){this.isDebug()&&this.logger.debug(t,...r)}isInfo(){return this.shouldLog(kfe.Info)}info(t,...r){this.isInfo()&&this.logger.info(t,...r)}isWarn(){return this.shouldLog(kfe.Warn)}warn(t,...r){this.isWarn()&&this.logger.warn(t,...r)}isError(){return this.shouldLog(kfe.Error)}error(t,...r){this.isError()&&this.logger.error(t,...r)}},qj0=new gCo({level:kfe.Info,logger:new hCo,silent:!0})});var j$c=h(()=>{"use strict"});var z$c=h(()=>{"use strict";N$c()});var Q$c=h(()=>{"use strict"});var Yl,$S=h(()=>{"use strict";Yl={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",NEVER:"never",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",NULLABLE:"nullable",OPTIONAL:"optional",OPTIONAL_NULLABLE:"optionalNullable"}});function pm(e,t){return`Expected ${t}. Received ${PLd(e)}.`}function PLd(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}var UF=h(()=>{"use strict"});function M1(e){return{...e,json:M$c(e.json),parse:M$c(e.parse)}}function M$c(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(o=>" - "+(o.path.length>0?`${o.path.join(".")}: ${o.message}`:o.message))].join(`
|
|
242
242
|
`)),{ok:!0,value:t}):n}}var Oee=h(()=>{"use strict"});function NNr(e){return e.path.length===0?e.message:`${e.path.join(" -> ")}: ${e.message}`}var ACo=h(()=>{"use strict"});var urt,yCo=h(()=>{"use strict";ACo();urt=class extends Error{errors;constructor(t){super(t.map(NNr).join("; ")),this.errors=t,Object.setPrototypeOf(this,new.target.prototype),this.name=this.constructor.name}}});var prt,bCo=h(()=>{"use strict";ACo();prt=class extends Error{errors;constructor(t){super(t.map(NNr).join("; ")),this.errors=t,Object.setPrototypeOf(this,new.target.prototype),this.name=this.constructor.name}}});function Km(e){return{nullable:()=>BLd(e),optional:()=>ECo(e),optionalNullable:()=>DLd(e),transform:t=>ICo(e,t),parseOrThrow:(t,r)=>{let n=e.parse(t,r);if(n.ok)return n.value;throw new prt(n.errors)},jsonOrThrow:(t,r)=>{let n=e.json(t,r);if(n.ok)return n.value;throw new urt(n.errors)}}}function BLd(e){let t={parse:(r,n)=>r==null?{ok:!0,value:null}:e.parse(r,n),json:(r,n)=>r==null?{ok:!0,value:null}:e.json(r,n),getType:()=>Yl.NULLABLE};return{...t,...Km(t)}}function ECo(e){let t={parse:(r,n)=>r==null?{ok:!0,value:void 0}:e.parse(r,n),json:(r,n)=>n?.omitUndefined&&r===void 0?{ok:!0,value:void 0}:r==null?{ok:!0,value:null}:e.json(r,n),getType:()=>Yl.OPTIONAL};return{...t,...Km(t)}}function DLd(e){let t={parse:(r,n)=>r===void 0?{ok:!0,value:void 0}:r===null?{ok:!0,value:null}:e.parse(r,n),json:(r,n)=>r===void 0?{ok:!0,value:void 0}:r===null?{ok:!0,value:null}:e.json(r,n),getType:()=>Yl.OPTIONAL_NULLABLE};return{...t,...Km(t)}}function ICo(e,t){let r={parse:(n,i)=>{let o=e.parse(n,i);return o.ok?{ok:!0,value:t.transform(o.value)}:o},json:(n,i)=>{let o=t.untransform(n);return e.json(o,i)},getType:()=>e.getType()};return{...r,...Km(r)}}var L$c=h(()=>{"use strict";$S();yCo();bCo()});var Lz=h(()=>{"use strict";L$c();yCo();bCo()});function _$c(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t=="bigint"?{ok:!0,value:t}:typeof t=="number"?{ok:!0,value:BigInt(t)}:{ok:!1,errors:[{path:r,message:pm(t,"bigint | number")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="bigint"?{ok:!1,errors:[{path:r,message:pm(t,"bigint")}]}:{ok:!0,value:t},getType:()=>Yl.BIGINT};return{...M1(e),...Km(e)}}var U$c=h(()=>{"use strict";$S();UF();Oee();Lz()});var V$c=h(()=>{"use strict";U$c()});function G$c(){let e={parse:(t,{breadcrumbsPrefix:r=[]}={})=>typeof t!="string"?{ok:!1,errors:[{path:r,message:pm(t,"string")}]}:RLd.test(t)?{ok:!0,value:new Date(t)}:{ok:!1,errors:[{path:r,message:pm(t,"ISO 8601 date string")}]},json:(t,{breadcrumbsPrefix:r=[]}={})=>t instanceof Date?{ok:!0,value:t.toISOString()}:{ok:!1,errors:[{path:r,message:pm(t,"Date object")}]},getType:()=>Yl.DATE};return{...M1(e),...Km(e)}}var RLd,q$c=h(()=>{"use strict";$S();UF();Oee();Lz();RLd=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/});var W$c=h(()=>{"use strict";q$c()});function L1(e,t){return()=>{let r={parse:t,json:t,getType:()=>e};return{...M1(r),...Km(r)}}}var Pee=h(()=>{"use strict";Lz();Oee()});function jNr(e){let t=new Set(e);return L1(Yl.ENUM,(n,{allowUnrecognizedEnumValues:i,breadcrumbsPrefix:o=[]}={})=>typeof n!="string"?{ok:!1,errors:[{path:o,message:pm(n,"string")}]}:!t.has(n)&&!i?{ok:!1,errors:[{path:o,message:pm(n,"enum")}]}:{ok:!0,value:n})()}var H$c=h(()=>{"use strict";$S();Pee();UF()});var vCo=h(()=>{"use strict";H$c()});function K$c(e){let t=CCo(e);return{...t,...Km(t)}}function CCo(e){return{parse:(t,r)=>frt(e).parse(t,r),json:(t,r)=>frt(e).json(t,r),getType:()=>frt(e).getType()}}function frt(e){let t=e;return t.__zurg_memoized==null&&(t.__zurg_memoized=e()),t.__zurg_memoized}var xCo=h(()=>{"use strict";Lz()});function SCo(e){return Object.entries(e)}var J$c=h(()=>{"use strict"});function G6t(e,t){let r=new Set(t);return Object.entries(e).reduce((n,[i,o])=>(r.has(i)&&(n[i]=o),n),{})}var wCo=h(()=>{"use strict"});function Ffe(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return t===null?!0:Object.getPrototypeOf(t)===null}var q6t=h(()=>{"use strict"});function W6t(e){return Object.keys(e)}var TCo=h(()=>{"use strict"});function Y$c(e,t){let r=[],n=[];for(let i of e)t(i)?r.push(i):n.push(i);return[r,n]}var X$c=h(()=>{"use strict"});function OH(e){return{withParsedProperties:t=>OCo(e,t)}}function OCo(e,t){let r={parse:(n,i)=>{let o=e.parse(n,i);if(!o.ok)return o;let s={};for(let a in t)if(kLd.call(t,a)){let c=t[a];s[a]=typeof c=="function"?c(o.value):c}return{ok:!0,value:{...o.value,...s}}},json:(n,i)=>{if(!Ffe(n))return{ok:!1,errors:[{path:i?.breadcrumbsPrefix??[],message:pm(n,"object")}]};let o=new Set(Object.keys(t)),s=G6t(n,Object.keys(n).filter(a=>!o.has(a)));return e.json(s,i)},getType:()=>e.getType()};return{...r,...Km(r),...OH(r)}}var kLd,Z$c=h(()=>{"use strict";wCo();UF();q6t();Lz();kLd=Object.prototype.hasOwnProperty});var H6t=h(()=>{"use strict";Z$c()});function $$c(e,t){return{rawKey:e,valueSchema:t,isProperty:!0}}function Nfe(e){return e.isProperty}var PCo=h(()=>{"use strict"});function zNr(e){let t;function r(){if(t==null){t={};for(let[d,f]of SCo(e)){let m=Nfe(f)?f.rawKey:d,g=Nfe(f)?f.valueSchema:f;t[m]={rawKey:m,parsedKey:d,valueSchema:g}}}return t}let n,i,o,s;function a(){if(n==null){n=[],i=[];for(let[d,f]of SCo(e)){let m=Nfe(f)?f.rawKey:d,g=Nfe(f)?f.valueSchema:f;NLd(g)&&(n.push(m),i.push(d))}o=new Set(n),s=new Set(i)}return n}function c(){return i==null&&a(),i}function l(){return o==null&&a(),o}function u(){return s==null&&a(),s}let p={_getRawProperties:()=>Object.entries(e).map(([d,f])=>Nfe(f)?f.rawKey:d),_getParsedProperties:()=>W6t(e),parse:(d,f)=>{let m=f?.breadcrumbsPrefix??[];return eel({value:d,requiredKeys:a(),requiredKeysSet:l(),getProperty:g=>{let A=r()[g];if(A!=null)return{transformedKey:A.parsedKey,transform:y=>{let I=[...m,g];return A.valueSchema.parse(y,{...f,breadcrumbsPrefix:I})}}},unrecognizedObjectKeys:f?.unrecognizedObjectKeys,skipValidation:f?.skipValidation,breadcrumbsPrefix:m,omitUndefined:f?.omitUndefined})},json:(d,f)=>{let m=f?.breadcrumbsPrefix??[];return eel({value:d,requiredKeys:c(),requiredKeysSet:u(),getProperty:g=>{let A=e[g];if(A!=null)return Nfe(A)?{transformedKey:A.rawKey,transform:y=>{let I=[...m,g];return A.valueSchema.json(y,{...f,breadcrumbsPrefix:I})}}:{transformedKey:g,transform:y=>{let I=[...m,g];return A.json(y,{...f,breadcrumbsPrefix:I})}}},unrecognizedObjectKeys:f?.unrecognizedObjectKeys,skipValidation:f?.skipValidation,breadcrumbsPrefix:m,omitUndefined:f?.omitUndefined})},getType:()=>Yl.OBJECT};return{...M1(p),...Km(p),...OH(p),...B6e(p)}}function eel({value:e,requiredKeys:t,requiredKeysSet:r,getProperty:n,unrecognizedObjectKeys:i="fail",skipValidation:o=!1,breadcrumbsPrefix:s=[]}){if(!Ffe(e))return{ok:!1,errors:[{path:s,message:pm(e,"object")}]};let a=t.length,c=[],l={};for(let u in e){if(!FLd.call(e,u))continue;let p=e[u],d=n(u);if(d!=null){a>0&&r.has(u)&&a--;let f=d.transform(p);f.ok?l[d.transformedKey]=f.value:(l[u]=p,c.push(...f.errors))}else switch(i){case"fail":c.push({path:[...s,u],message:`Unexpected key "${u}"`});break;case"strip":break;case"passthrough":l[u]=p;break}}if(a>0)for(let u of t)u in e||c.push({path:s,message:`Missing required key "${u}"`});return c.length===0||o?{ok:!0,value:l}:{ok:!1,errors:c}}function B6e(e){return{extend:t=>{let r={_getParsedProperties:()=>[...e._getParsedProperties(),...t._getParsedProperties()],_getRawProperties:()=>[...e._getRawProperties(),...t._getRawProperties()],parse:(n,i)=>tel({extensionKeys:t._getRawProperties(),value:n,transformBase:o=>e.parse(o,i),transformExtension:o=>t.parse(o,i),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>tel({extensionKeys:t._getParsedProperties(),value:n,transformBase:o=>e.json(o,i),transformExtension:o=>t.json(o,i),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>Yl.OBJECT};return{...r,...Km(r),...OH(r),...B6e(r)}},passthrough:()=>{let t=new Set(e._getRawProperties()),r=new Set(e._getParsedProperties()),n={_getParsedProperties:()=>e._getParsedProperties(),_getRawProperties:()=>e._getRawProperties(),parse:(i,o)=>{let s=e.parse(i,{...o,unrecognizedObjectKeys:"passthrough"});if(!s.ok)return s;let a={};if(typeof i=="object"&&i!=null)for(let[c,l]of Object.entries(i))t.has(c)||(a[c]=l);return{ok:!0,value:{...a,...s.value}}},json:(i,o)=>{let s=e.json(i,{...o,unrecognizedObjectKeys:"passthrough"});if(!s.ok)return s;let a={};if(typeof i=="object"&&i!=null)for(let[c,l]of Object.entries(i))r.has(c)||(a[c]=l);return{ok:!0,value:{...a,...s.value}}},getType:()=>Yl.OBJECT};return{...n,...Km(n),...OH(n),...B6e(n)}}}}function tel({extensionKeys:e,value:t,transformBase:r,transformExtension:n,breadcrumbsPrefix:i=[]}){if(!Ffe(t))return{ok:!1,errors:[{path:i,message:pm(t,"object")}]};let o=new Set(e),[s,a]=Y$c(W6t(t),u=>o.has(u)),c=r(G6t(t,a)),l=n(G6t(t,s));return c.ok&&l.ok?{ok:!0,value:{...c.value,...l.value}}:{ok:!1,errors:[...c.ok?[]:c.errors,...l.ok?[]:l.errors]}}function NLd(e){return!jLd(e)}function jLd(e){switch(e.getType()){case Yl.ANY:case Yl.UNKNOWN:case Yl.OPTIONAL:case Yl.OPTIONAL_NULLABLE:return!0;default:return!1}}var FLd,BCo=h(()=>{"use strict";$S();J$c();wCo();UF();q6t();TCo();Oee();X$c();H6t();Lz();PCo();FLd=Object.prototype.hasOwnProperty});function rel(e){return zNr(e)}var nel=h(()=>{"use strict";BCo()});var DCo=h(()=>{"use strict";BCo();nel();PCo()});function iel(e){let t={...CCo(e),_getRawProperties:()=>frt(e)._getRawProperties(),_getParsedProperties:()=>frt(e)._getParsedProperties()};return{...t,...Km(t),...OH(t),...B6e(t)}}var oel=h(()=>{"use strict";DCo();H6t();Lz();xCo()});var sel=h(()=>{"use strict";xCo();oel()});function QNr(e){let t={parse:(r,n)=>ael(r,(i,o)=>e.parse(i,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`[${o}]`]})),json:(r,n)=>ael(r,(i,o)=>e.json(i,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`[${o}]`]})),getType:()=>Yl.LIST};return{...M1(t),...Km(t)}}function ael(e,t){if(!Array.isArray(e))return{ok:!1,errors:[{message:pm(e,"list"),path:[]}]};let r=[],n=[];for(let i=0;i<e.length;i++){let o=t(e[i],i);o.ok?r.push(o.value):n.push(...o.errors)}return n.length===0?{ok:!0,value:r}:{ok:!1,errors:n}}var cel=h(()=>{"use strict";$S();UF();Oee();Lz()});var RCo=h(()=>{"use strict";cel()});function lel(e){return L1(Yl.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:pm(r,`${e.toString()}`)}]})()}var uel=h(()=>{"use strict";$S();Pee();UF()});function pel(e){return L1(Yl.STRING_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===e?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:pm(r,`"${e}"`)}]})()}var fel=h(()=>{"use strict";$S();Pee();UF()});var del=h(()=>{"use strict";uel();fel()});var mel,hel=h(()=>{"use strict";$S();Pee();mel=L1(Yl.ANY,e=>({ok:!0,value:e}))});var gel,Ael=h(()=>{"use strict";$S();Pee();UF();gel=L1(Yl.BOOLEAN,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:pm(e,"boolean")}]})});var yel,bel=h(()=>{"use strict";$S();Pee();yel=L1(Yl.NEVER,(e,{breadcrumbsPrefix:t=[]}={})=>({ok:!1,errors:[{path:t,message:"Expected never"}]}))});var Eel,Iel=h(()=>{"use strict";$S();Pee();UF();Eel=L1(Yl.NUMBER,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:pm(e,"number")}]})});var vel,Cel=h(()=>{"use strict";$S();Pee();UF();vel=L1(Yl.STRING,(e,{breadcrumbsPrefix:t=[]}={})=>typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:t,message:pm(e,"string")}]})});var xel,Sel=h(()=>{"use strict";$S();Pee();xel=L1(Yl.UNKNOWN,e=>({ok:!0,value:e}))});var wel=h(()=>{"use strict";hel();Ael();bel();Iel();Cel();Sel()});function Oel(e,t){let r={parse:(n,i)=>Tel({value:n,isKeyNumeric:e.getType()===Yl.NUMBER,transformKey:o=>e.parse(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o} (key)`]}),transformValue:(o,s)=>t.parse(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),json:(n,i)=>Tel({value:n,isKeyNumeric:e.getType()===Yl.NUMBER,transformKey:o=>e.json(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${o} (key)`]}),transformValue:(o,s)=>t.json(o,{...i,breadcrumbsPrefix:[...i?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:i?.breadcrumbsPrefix}),getType:()=>Yl.RECORD};return{...M1(r),...Km(r)}}function Tel({value:e,isKeyNumeric:t,transformKey:r,transformValue:n,breadcrumbsPrefix:i=[]}){if(!Ffe(e))return{ok:!1,errors:[{path:i,message:pm(e,"object")}]};let o={},s=[];for(let a in e){if(!zLd.call(e,a))continue;let c=e[a];if(c===void 0)continue;let l=a;if(t){let d=a.length>0?Number(a):NaN;Number.isNaN(d)||(l=d)}let u=r(l),p=n(c,l);u.ok&&p.ok?o[u.value]=p.value:(u.ok||s.push(...u.errors),p.ok||s.push(...p.errors))}return s.length===0?{ok:!0,value:o}:{ok:!1,errors:s}}var zLd,Pel=h(()=>{"use strict";$S();UF();q6t();Oee();Lz();zLd=Object.prototype.hasOwnProperty});var Bel=h(()=>{"use strict";Pel()});function Del(e){let t=QNr(e),r={parse:(n,i)=>{let o=t.parse(n,i);return o.ok?{ok:!0,value:new Set(o.value)}:o},json:(n,i)=>n instanceof Set?t.json([...n],i):{ok:!1,errors:[{path:i?.breadcrumbsPrefix??[],message:pm(n,"Set")}]},getType:()=>Yl.SET};return{...M1(r),...Km(r)}}var Rel=h(()=>{"use strict";$S();UF();Oee();RCo();Lz()});var kel=h(()=>{"use strict";Rel()});function Nel(e){let t={parse:(r,n)=>Fel((i,o)=>i.parse(r,o),e,n),json:(r,n)=>Fel((i,o)=>i.json(r,o),e,n),getType:()=>Yl.UNDISCRIMINATED_UNION};return{...M1(t),...Km(t)}}function Fel(e,t,r){let n=[];for(let[i,o]of t.entries()){let s=e(o,{...r,skipValidation:!1});if(s.ok)return s;for(let a of s.errors)n.push({path:a.path,message:`[Variant ${i}] ${a.message}`})}return{ok:!1,errors:n}}var jel=h(()=>{"use strict";$S();Oee();Lz()});var zel=h(()=>{"use strict";jel()});function Qel(e,t){return{parsedDiscriminant:e,rawDiscriminant:t}}var Mel=h(()=>{"use strict"});function _el(e,t){let r=typeof e=="string"?e:e.rawDiscriminant,n=typeof e=="string"?e:e.parsedDiscriminant,i=jNr(W6t(t)),o={parse:(s,a)=>Lel({value:s,discriminant:r,transformedDiscriminant:n,transformDiscriminantValue:c=>i.parse(c,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...a?.breadcrumbsPrefix??[],r]}),getAdditionalPropertiesSchema:c=>t[c],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(c,l)=>l.parse(c,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),json:(s,a)=>Lel({value:s,discriminant:n,transformedDiscriminant:r,transformDiscriminantValue:c=>i.json(c,{allowUnrecognizedEnumValues:a?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...a?.breadcrumbsPrefix??[],n]}),getAdditionalPropertiesSchema:c=>t[c],allowUnrecognizedUnionMembers:a?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(c,l)=>l.json(c,a),breadcrumbsPrefix:a?.breadcrumbsPrefix}),getType:()=>Yl.UNION};return{...M1(o),...Km(o),...OH(o)}}function Lel({value:e,discriminant:t,transformedDiscriminant:r,transformDiscriminantValue:n,getAdditionalPropertiesSchema:i,allowUnrecognizedUnionMembers:o=!1,transformAdditionalProperties:s,breadcrumbsPrefix:a=[]}){if(!Ffe(e))return{ok:!1,errors:[{path:a,message:pm(e,"object")}]};let c=e[t],l={};for(let f in e)QLd.call(e,f)&&f!==t&&(l[f]=e[f]);if(c==null)return{ok:!1,errors:[{path:a,message:`Missing discriminant ("${t}")`}]};let u=n(c);if(!u.ok)return{ok:!1,errors:u.errors};let p=i(u.value);if(p==null)return o?{ok:!0,value:{[r]:u.value,...l}}:{ok:!1,errors:[{path:[...a,t],message:"Unexpected discriminant value"}]};let d=s(l,p);return d.ok?{ok:!0,value:{[r]:c,...d.value}}:d}var QLd,Uel=h(()=>{"use strict";$S();UF();q6t();TCo();Oee();vCo();H6t();Lz();QLd=Object.prototype.hasOwnProperty});var Vel=h(()=>{"use strict";Mel();Uel()});var Gel=h(()=>{"use strict";V$c();W$c();vCo();sel();RCo();del();DCo();H6t();wel();Bel();Lz();kel();zel();Vel()});var ve={};ne(ve,{JsonError:()=>urt,ParseError:()=>prt,any:()=>mel,bigint:()=>_$c,boolean:()=>gel,booleanLiteral:()=>lel,date:()=>G$c,discriminant:()=>Qel,enum_:()=>jNr,getObjectLikeUtils:()=>OH,getObjectUtils:()=>B6e,getSchemaUtils:()=>Km,isProperty:()=>Nfe,lazy:()=>K$c,lazyObject:()=>iel,list:()=>QNr,never:()=>yel,number:()=>Eel,object:()=>zNr,objectWithoutOptionalProperties:()=>rel,optional:()=>ECo,property:()=>$$c,record:()=>Oel,set:()=>Del,string:()=>vel,stringLiteral:()=>pel,transform:()=>ICo,undiscriminatedUnion:()=>Nel,union:()=>_el,unknown:()=>xel,withParsedProperties:()=>OCo});var qel=h(()=>{"use strict";Gel()});var Wel=h(()=>{"use strict"});var Lr=h(()=>{"use strict";j$c();z$c();Q$c();qel();Wel()});var MNr,kCo=h(()=>{"use strict";Lr();MNr=ve.string()});var LNr,FCo=h(()=>{"use strict";Lr();LNr=ve.enum_(["openai","anthropic","aws-bedrock"])});var _Nr,NCo=h(()=>{"use strict";Lr();kCo();FCo();_Nr=ve.object({provider:LNr,model:MNr})});var jCo=h(()=>{"use strict";NCo();kCo();FCo()});var zCo={};ne(zCo,{AiServicesSchema:()=>_Nr,ModelName:()=>MNr,ModelProvider:()=>LNr});var Hel=h(()=>{"use strict";jCo()});var gve,K6t=h(()=>{"use strict";Lr();gve=ve.object({generate:ve.boolean().optional(),upgrade:ve.boolean().optional(),preview:ve.boolean().optional(),verify:ve.boolean().optional()})});var QCo=h(()=>{"use strict";K6t()});var MCo={};ne(MCo,{AutomationSchema:()=>gve});var Kel=h(()=>{"use strict";QCo()});var TE,Y6=h(()=>{"use strict";Lr();TE=ve.object({docs:ve.string().optional()})});var drt,UNr=h(()=>{"use strict";Lr();Y6();drt=ve.object({scheme:ve.string()}).extend(TE)});var VNr,LCo=h(()=>{"use strict";Lr();UNr();VNr=ve.undiscriminatedUnion([ve.string(),drt])});var GNr,_Co=h(()=>{"use strict";Lr();Y6();LCo();GNr=ve.object({any:ve.list(VNr)}).extend(TE)});var qNr,UCo=h(()=>{"use strict";Lr();qNr=ve.object({})});var WNr,VCo=h(()=>{"use strict";Lr();Y6();UCo();WNr=ve.object({"endpoint-security":qNr}).extend(TE)});var mrt,HNr=h(()=>{"use strict";Lr();_Co();UNr();VCo();mrt=ve.undiscriminatedUnion([ve.string(),drt,GNr,WNr])});var Ave,J6t=h(()=>{"use strict";Lr();Ave=ve.object({name:ve.string().optional()})});var hrt,KNr=h(()=>{"use strict";Lr();hrt=ve.object({env:ve.string().optional()})});var D6e,JNr=h(()=>{"use strict";Lr();J6t();KNr();D6e=ve.object({omit:ve.boolean().optional()}).extend(hrt).extend(Ave)});var MV,R6e=h(()=>{"use strict";Lr();MV=ve.object({"playground-docs":ve.string().optional()})});var YNr,GCo=h(()=>{"use strict";Lr();Y6();JNr();R6e();YNr=ve.object({scheme:ve.stringLiteral("basic"),username:D6e.optional(),password:D6e.optional()}).extend(TE).extend(MV)});var XNr,qCo=h(()=>{"use strict";Lr();XNr=ve.enum_(["api-key","refresh-token"])});var ZNr,WCo=h(()=>{"use strict";Lr();ZNr=ve.object({"response-property":ve.string(),"header-name":ve.string(),"value-prefix":ve.string().optional()})});var $Nr,HCo=h(()=>{"use strict";Lr();WCo();$Nr=ve.object({endpoint:ve.string(),"expiry-response-property":ve.string().optional(),"authenticated-request-headers":ve.list(ZNr).optional()})});var ejr,KCo=h(()=>{"use strict";Lr();HCo();ejr=ve.undiscriminatedUnion([ve.string(),$Nr])});var tjr,JCo=h(()=>{"use strict";Lr();Y6();qCo();KCo();R6e();tjr=ve.object({scheme:ve.stringLiteral("bearer"),"get-token":ejr,type:XNr.optional()}).extend(TE).extend(MV)});var rjr,YCo=h(()=>{"use strict";Lr();Y6();JNr();R6e();rjr=ve.object({scheme:ve.stringLiteral("bearer"),token:D6e.optional()}).extend(TE).extend(MV)});var njr,XCo=h(()=>{"use strict";Lr();JCo();YCo();njr=ve.undiscriminatedUnion([rjr,tjr])});var ijr,ZCo=h(()=>{"use strict";Lr();Y6();J6t();KNr();R6e();ijr=ve.object({header:ve.string(),type:ve.string().optional(),prefix:ve.string().optional()}).extend(hrt).extend(Ave).extend(TE).extend(MV)});var ojr,$Co=h(()=>{"use strict";Lr();ojr=ve.string()});var sjr,exo=h(()=>{"use strict";Lr();sjr=ve.enum_(["client-credentials","authorization-code","device-code"])});var ajr,txo=h(()=>{"use strict";Lr();ajr=ve.object({"client-id":ve.string().optional(),"client-secret":ve.string().optional(),scopes:ve.string().optional()})});var cjr,rxo=h(()=>{"use strict";Lr();cjr=ve.object({"access-token":ve.string().optional(),"expires-in":ve.string().optional(),"refresh-token":ve.string().optional()})});var ljr,nxo=h(()=>{"use strict";Lr();txo();rxo();ljr=ve.object({endpoint:ve.string(),"request-properties":ajr.optional(),"response-properties":cjr.optional()})});var ujr,ixo=h(()=>{"use strict";Lr();ujr=ve.object({method:ve.string().optional()})});var pjr,oxo=h(()=>{"use strict";Lr();pjr=ve.object({"refresh-token":ve.string()})});var fjr,sxo=h(()=>{"use strict";Lr();fjr=ve.object({"access-token":ve.string().optional(),"expires-in":ve.string().optional(),"refresh-token":ve.string().optional()})});var djr,axo=h(()=>{"use strict";Lr();oxo();sxo();djr=ve.object({endpoint:ve.string(),"request-properties":pjr.optional(),"response-properties":fjr.optional()})});var mjr,cxo=h(()=>{"use strict";Lr();mjr=ve.object({url:ve.string(),ports:ve.list(ve.number()).optional()})});var hjr,lxo=h(()=>{"use strict";Lr();cxo();hjr=ve.undiscriminatedUnion([ve.string(),mjr])});var gjr,uxo=h(()=>{"use strict";Lr();Y6();$Co();exo();nxo();ixo();axo();lxo();R6e();gjr=ve.object({scheme:ve.stringLiteral("oauth"),type:sjr,scopes:ve.list(ojr).optional(),"token-prefix":ve.string().optional(),"token-header":ve.string().optional(),"client-id-env":ve.string().optional(),"client-secret-env":ve.string().optional(),"get-token":ljr.optional(),"refresh-token":djr.optional(),"client-id":ve.string().optional(),"authorization-url":ve.string().optional(),"device-authorization-url":ve.string().optional(),"token-url":ve.string().optional(),"refresh-url":ve.string().optional(),"redirect-uri":hjr.optional(),"success-redirect-url":ve.string().optional(),"error-redirect-url":ve.string().optional(),pkce:ujr.optional(),"authorization-parameters":ve.record(ve.string(),ve.string()).optional(),"device-authorization-parameters":ve.record(ve.string(),ve.string()).optional(),"token-parameters":ve.record(ve.string(),ve.string()).optional(),"refresh-parameters":ve.record(ve.string(),ve.string()).optional()}).extend(TE).extend(MV)});var yve,Y6t=h(()=>{"use strict";Lr();GCo();XCo();ZCo();uxo();yve=ve.undiscriminatedUnion([gjr,ijr,YNr,njr])});var pxo=h(()=>{"use strict";LCo();_Co();HNr();Y6t();UNr();$Co();JNr();GCo();XCo();VCo();UCo();ZCo();WCo();qCo();JCo();KCo();HCo();txo();rxo();exo();nxo();ixo();axo();oxo();sxo();uxo();lxo();cxo();YCo();KNr();R6e()});var fxo={};ne(fxo,{AnyAuthItem:()=>VNr,AnyAuthSchemesSchema:()=>GNr,ApiAuthSchema:()=>mrt,AuthSchemeDeclarationSchema:()=>yve,AuthSchemeReferenceSchema:()=>drt,AuthScope:()=>ojr,AuthVariable:()=>D6e,BasicAuthSchemeSchema:()=>YNr,BearerAuthSchemeSchema:()=>njr,EndpointSecuritySchema:()=>WNr,EndpointSecuritySchemaDetails:()=>qNr,HeaderAuthSchemeSchema:()=>ijr,InferredAuthTypeSchema:()=>XNr,InferredAuthenticatedRequestHeader:()=>ZNr,InferredBearerAuthSchema:()=>tjr,InferredGetTokenEndpointSchema:()=>ejr,InferredGetTokenEndpointSchemaObject:()=>$Nr,OAuthAccessTokenRequestPropertiesSchema:()=>ajr,OAuthAccessTokenResponsePropertiesSchema:()=>cjr,OAuthFlowTypeSchema:()=>sjr,OAuthGetTokenEndpointSchema:()=>ljr,OAuthPkceSchema:()=>ujr,OAuthRefreshTokenEndpointSchema:()=>djr,OAuthRefreshTokenRequestPropertiesSchema:()=>pjr,OAuthRefreshTokenResponsePropertiesSchema:()=>fjr,OAuthSchemeSchema:()=>gjr,RedirectUriSchema:()=>hjr,RedirectUriWithBackupPortsSchema:()=>mjr,TokenBearerAuthSchema:()=>rjr,WithEnvironmentVariable:()=>hrt,WithPlaygroundDocsSchema:()=>MV});var Jel=h(()=>{"use strict";pxo()});var grt,Ajr=h(()=>{"use strict";Lr();grt=ve.enum_(["in-development","pre-release","deprecated","generally-available"])});var yjr,dxo=h(()=>{"use strict";Lr();Ajr();yjr=ve.object({status:grt,message:ve.string().optional()})});var bjr,mxo=h(()=>{"use strict";Lr();dxo();Ajr();bjr=ve.undiscriminatedUnion([grt,yjr])});var hxo=h(()=>{"use strict";dxo();Ajr();mxo()});var gxo={};ne(gxo,{AvailabilitySchema:()=>yjr,AvailabilityStatusSchema:()=>grt,AvailabilityUnionSchema:()=>bjr});var Yel=h(()=>{"use strict";hxo()});var bve,X6t=h(()=>{"use strict";Lr();bve=ve.object({audiences:ve.list(ve.string()).optional()})});var Ejr,Axo=h(()=>{"use strict";Lr();mxo();Ejr=ve.object({availability:bjr.optional()})});var yxo=h(()=>{"use strict";X6t();Axo();Y6();J6t()});var bxo={};ne(bxo,{WithAudiences:()=>bve,WithAvailability:()=>Ejr,WithDocsSchema:()=>TE,WithName:()=>Ave});var Xel=h(()=>{"use strict";yxo()});var Ijr,Exo=h(()=>{"use strict";Lr();Ijr=ve.object({type:ve.string()})});var vjr,Ixo=h(()=>{"use strict";Lr();Exo();vjr=ve.object({proto:Ijr.optional()})});var vxo=h(()=>{"use strict";Ixo();Exo()});var Cxo={};ne(Cxo,{EncodingSchema:()=>vjr,ProtobufTypeSchema:()=>Ijr});var Zel=h(()=>{"use strict";vxo()});var Art,Cjr=h(()=>{"use strict";Lr();Art=ve.object({id:ve.string(),default:ve.string().optional(),values:ve.list(ve.string()).optional()})});var xjr,xxo=h(()=>{"use strict";Lr();X6t();Y6();Cjr();xjr=ve.object({urls:ve.record(ve.string(),ve.string()),"url-templates":ve.record(ve.string(),ve.string()).optional(),"default-urls":ve.record(ve.string(),ve.string()).optional(),variables:ve.record(ve.string(),ve.list(Art)).optional()}).extend(bve).extend(TE)});var Sjr,Sxo=h(()=>{"use strict";Lr();X6t();Y6();Cjr();Sjr=ve.object({url:ve.string(),"default-url":ve.string().optional(),"url-template":ve.string().optional(),variables:ve.list(Art).optional()}).extend(bve).extend(TE)});var wjr,wxo=h(()=>{"use strict";Lr();xxo();Sxo();wjr=ve.undiscriminatedUnion([ve.string(),Sjr,xjr])});var Tjr,Txo=h(()=>{"use strict";Lr();wxo();Tjr=ve.object({"default-url":ve.string().optional(),"default-environment":ve.string().optional(),"base-url-env":ve.string().optional(),environments:ve.record(ve.string(),wjr).optional()})});var Oxo=h(()=>{"use strict";wxo();xxo();Cjr();Sxo();Txo()});var Pxo={};ne(Pxo,{EnvironmentSchema:()=>wjr,MultipleBaseUrlsEnvironmentSchema:()=>xjr,ServerVariableSchema:()=>Art,SingleBaseUrlEnvironmentSchema:()=>Sjr,WithEnvironmentsSchema:()=>Tjr});var $el=h(()=>{"use strict";Oxo()});var Ojr,Bxo=h(()=>{"use strict";Lr();Ojr=ve.object({minItems:ve.number().optional(),maxItems:ve.number().optional()})});var Pjr,Dxo=h(()=>{"use strict";Lr();Pjr=ve.object({minProperties:ve.number().optional(),maxProperties:ve.number().optional()})});var Bjr,Rxo=h(()=>{"use strict";Lr();Bjr=ve.object({min:ve.number().optional(),max:ve.number().optional(),exclusiveMin:ve.boolean().optional(),exclusiveMax:ve.boolean().optional(),multipleOf:ve.number().optional()})});var Djr,kxo=h(()=>{"use strict";Lr();Djr=ve.object({minLength:ve.number().optional(),maxLength:ve.number().optional(),pattern:ve.string().optional(),format:ve.string().optional()})});var Rjr,Fxo=h(()=>{"use strict";Lr();Bxo();Dxo();Rxo();kxo();Rjr=ve.undiscriminatedUnion([Djr,Bjr,Ojr,Pjr])});var kjr,Nxo=h(()=>{"use strict";Lr();Axo();Y6();Ixo();Fxo();kjr=ve.object({default:ve.unknown().optional(),"client-default":ve.unknown().optional(),encoding:vjr.optional(),validation:Rjr.optional()}).extend(TE).extend(Ejr)});var Fjr,jxo=h(()=>{"use strict";Lr();X6t();J6t();Nxo();Fjr=ve.object({type:ve.string()}).extend(kjr).extend(Ave).extend(bve)});var Njr,zxo=h(()=>{"use strict";Lr();jxo();Njr=ve.object({env:ve.string().optional()}).extend(Fjr)});var jjr,Qxo=h(()=>{"use strict";Lr();zxo();jjr=ve.undiscriminatedUnion([ve.string(),Njr])});var yrt,zjr=h(()=>{"use strict";Qxo();yrt=jjr});var Qjr,Mxo=h(()=>{"use strict";Lr();zjr();Qjr=ve.object({headers:ve.record(ve.string(),yrt).optional()})});var Lxo=h(()=>{"use strict";Mxo()});var _xo={};ne(_xo,{WithHeadersSchema:()=>Qjr});var etl=h(()=>{"use strict";Lxo()});var Uxo=h(()=>{"use strict";zjr();Qxo();zxo()});var Vxo={};ne(Vxo,{HttpHeaderSchema:()=>yrt,TypeReferenceDeclarationWithEnvOverride:()=>jjr,TypeReferenceDeclarationWithEnvOverrideSchema:()=>Njr});var ttl=h(()=>{"use strict";Uxo()});var Gxo=h(()=>{"use strict";Nxo();jxo()});var qxo={};ne(qxo,{BaseTypeReferenceSchema:()=>kjr,TypeReferenceDeclarationWithName:()=>Fjr});var rtl=h(()=>{"use strict";Gxo()});var Wxo=h(()=>{"use strict";Bxo();Dxo();Rxo();kxo();Fxo()});var Hxo={};ne(Hxo,{ListValidationSchema:()=>Ojr,MapValidationSchema:()=>Pjr,NumberValidationSchema:()=>Bjr,StringValidationSchema:()=>Djr,ValidationSchema:()=>Rjr});var ntl=h(()=>{"use strict";Wxo()});var itl=h(()=>{"use strict";Jel();pxo();Yel();hxo();Xel();yxo();Zel();vxo();$el();Oxo();etl();Lxo();ttl();Uxo();rtl();Gxo();ntl();Wxo()});var Kxo={};ne(Kxo,{AnyAuthItem:()=>VNr,AnyAuthSchemesSchema:()=>GNr,ApiAuthSchema:()=>mrt,AuthSchemeDeclarationSchema:()=>yve,AuthSchemeReferenceSchema:()=>drt,AuthScope:()=>ojr,AuthVariable:()=>D6e,AvailabilitySchema:()=>yjr,AvailabilityStatusSchema:()=>grt,AvailabilityUnionSchema:()=>bjr,BaseTypeReferenceSchema:()=>kjr,BasicAuthSchemeSchema:()=>YNr,BearerAuthSchemeSchema:()=>njr,EncodingSchema:()=>vjr,EndpointSecuritySchema:()=>WNr,EndpointSecuritySchemaDetails:()=>qNr,EnvironmentSchema:()=>wjr,HeaderAuthSchemeSchema:()=>ijr,HttpHeaderSchema:()=>yrt,InferredAuthTypeSchema:()=>XNr,InferredAuthenticatedRequestHeader:()=>ZNr,InferredBearerAuthSchema:()=>tjr,InferredGetTokenEndpointSchema:()=>ejr,InferredGetTokenEndpointSchemaObject:()=>$Nr,ListValidationSchema:()=>Ojr,MapValidationSchema:()=>Pjr,MultipleBaseUrlsEnvironmentSchema:()=>xjr,NumberValidationSchema:()=>Bjr,OAuthAccessTokenRequestPropertiesSchema:()=>ajr,OAuthAccessTokenResponsePropertiesSchema:()=>cjr,OAuthFlowTypeSchema:()=>sjr,OAuthGetTokenEndpointSchema:()=>ljr,OAuthPkceSchema:()=>ujr,OAuthRefreshTokenEndpointSchema:()=>djr,OAuthRefreshTokenRequestPropertiesSchema:()=>pjr,OAuthRefreshTokenResponsePropertiesSchema:()=>fjr,OAuthSchemeSchema:()=>gjr,ProtobufTypeSchema:()=>Ijr,RedirectUriSchema:()=>hjr,RedirectUriWithBackupPortsSchema:()=>mjr,ServerVariableSchema:()=>Art,SingleBaseUrlEnvironmentSchema:()=>Sjr,StringValidationSchema:()=>Djr,TokenBearerAuthSchema:()=>rjr,TypeReferenceDeclarationWithEnvOverride:()=>jjr,TypeReferenceDeclarationWithEnvOverrideSchema:()=>Njr,TypeReferenceDeclarationWithName:()=>Fjr,ValidationSchema:()=>Rjr,WithAudiences:()=>bve,WithAvailability:()=>Ejr,WithDocsSchema:()=>TE,WithEnvironmentVariable:()=>hrt,WithEnvironmentsSchema:()=>Tjr,WithHeadersSchema:()=>Qjr,WithName:()=>Ave,WithPlaygroundDocsSchema:()=>MV,auth:()=>fxo,availability:()=>gxo,commons:()=>bxo,encoding:()=>Cxo,environments:()=>Pxo,file:()=>_xo,service:()=>Vxo,types:()=>qxo,validation:()=>Hxo});var otl=h(()=>{"use strict";itl()});var Eve,Z6t=h(()=>{"use strict";Lr();Eve=ve.string()});var brt,Mjr=h(()=>{"use strict";Lr();brt=ve.enum_(["v1","v2"])});var Ert,Ljr=h(()=>{"use strict";Lr();Ert=ve.enum_(["environment-per-server","urls-per-environment"])});var Irt,_jr=h(()=>{"use strict";Lr();Irt=ve.enum_(["url-order","spec-order"])});var vrt,Ujr=h(()=>{"use strict";Lr();vrt=ve.enum_(["always","never"])});var Vjr,Jxo=h(()=>{"use strict";Lr();Vjr=ve.enum_(["v1"])});var Crt,Gjr=h(()=>{"use strict";Lr();Mjr();Ljr();_jr();Ujr();Jxo();Crt=ve.object({"use-title":ve.boolean().optional(),unions:Vjr.optional(),"message-naming":brt.optional(),"respect-nullable-schemas":ve.boolean().optional(),"only-include-referenced-schemas":ve.boolean().optional(),"inline-path-parameters":ve.boolean().optional(),"idiomatic-request-names":ve.boolean().optional(),"wrap-references-to-nullable-in-optional":ve.boolean().optional(),"coerce-optional-schemas-to-nullable":ve.boolean().optional(),"group-environments-by-host":ve.boolean().optional(),"multi-server-strategy":Ert.optional(),"remove-discriminants-from-schemas":vrt.optional(),"path-parameter-order":Irt.optional()})});var LV,k6e=h(()=>{"use strict";Lr();LV=ve.undiscriminatedUnion([ve.string(),ve.list(ve.string())])});var xrt,qjr=h(()=>{"use strict";Lr();Z6t();Gjr();k6e();xrt=ve.object({path:Eve,origin:ve.string().optional(),overrides:LV.optional(),audiences:ve.list(ve.string()).optional(),settings:Crt.optional()})});var Wjr,Yxo=h(()=>{"use strict";Lr();Wjr=ve.object({repo:ve.string(),ref:ve.string().optional(),path:ve.string()})});var Hjr,Xxo=h(()=>{"use strict";Lr();Yxo();Hjr=ve.object({git:Wjr})});var Ive,$6t=h(()=>{"use strict";Lr();Xxo();Ive=ve.undiscriminatedUnion([ve.string(),Hjr])});var Srt,Kjr=h(()=>{"use strict";Lr();k6e();$6t();Srt=ve.object({target:ve.string().optional(),root:Ive,overrides:LV.optional(),"local-generation":ve.boolean().optional(),"from-openapi":ve.boolean().optional(),dependencies:ve.list(ve.string()).optional()})});var wrt,Jjr=h(()=>{"use strict";Lr();Kjr();wrt=ve.object({proto:Srt})});var Yjr,Zxo=h(()=>{"use strict";Lr();Z6t();qjr();Jjr();Yjr=ve.undiscriminatedUnion([Eve,xrt,wrt])});var Xjr,$xo=h(()=>{"use strict";Lr();Zxo();Xjr=ve.list(Yjr)});var Trt,Zjr=h(()=>{"use strict";Lr();$xo();Z6t();qjr();Jjr();Trt=ve.undiscriminatedUnion([Eve,xrt,Xjr,wrt])});var $jr,eSo=h(()=>{"use strict";Lr();$jr=ve.enum_(["literals","enums","enums-coerceable-to-literals"])});var Ort,ezr=h(()=>{"use strict";Lr();eSo();Ljr();_jr();Ujr();Ort=ve.object({"respect-nullable-schemas":ve.boolean().optional(),"title-as-schema-name":ve.boolean().optional(),"optional-additional-properties":ve.boolean().optional(),"coerce-enums-to-literals":ve.boolean().optional(),"idiomatic-request-names":ve.boolean().optional(),"wrap-references-to-nullable-in-optional":ve.boolean().optional(),"coerce-optional-schemas-to-nullable":ve.boolean().optional(),"group-environments-by-host":ve.boolean().optional(),"multi-server-strategy":Ert.optional(),"remove-discriminants-from-schemas":vrt.optional(),"path-parameter-order":Irt.optional(),"resolve-schema-collisions":ve.boolean().optional(),"infer-forward-compatible":ve.boolean().optional(),"infer-default-environment":ve.boolean().optional(),"coerce-consts-to":$jr.optional()})});var Prt,tzr=h(()=>{"use strict";Lr();ezr();Mjr();Prt=ve.object({"message-naming":brt.optional()}).extend(Ort)});var rzr,tSo=h(()=>{"use strict";Lr();rzr=ve.enum_(["int32","int64","uint32","uint64"])});var nzr,rSo=h(()=>{"use strict";Lr();nzr=ve.enum_(["form","json"])});var izr,nSo=h(()=>{"use strict";Lr();izr=ve.enum_(["all","untyped"])});var ozr,iSo=h(()=>{"use strict";Lr();ozr=ve.enum_(["get","post","put","patch","delete","head","options","trace"])});var szr,oSo=h(()=>{"use strict";Lr();iSo();szr=ve.object({"status-code":ve.number(),methods:ve.list(ozr).optional()})});var azr,sSo=h(()=>{"use strict";Lr();azr=ve.undiscriminatedUnion([ve.string(),ve.record(ve.string(),ve.unknown())])});var czr,aSo=h(()=>{"use strict";Lr();nSo();oSo();sSo();czr=ve.object({schema:azr,name:ve.string().optional(),"apply-to":izr.optional(),ensure:ve.list(szr).optional()})});var e3t,cSo=h(()=>{"use strict";Lr();e3t=ve.object({"max-depth":ve.number().optional()})});var lzr,lSo=h(()=>{"use strict";Lr();cSo();lzr=ve.object({request:e3t.optional(),response:e3t.optional()})});var uzr,uSo=h(()=>{"use strict";Lr();uzr=ve.object({endpoints:ve.list(ve.string()).optional()})});var pzr,pSo=h(()=>{"use strict";Lr();pzr=ve.object({except:ve.list(ve.string()).optional()})});var fzr,fSo=h(()=>{"use strict";Lr();pSo();fzr=ve.undiscriminatedUnion([ve.boolean(),pzr])});var vve,t3t=h(()=>{"use strict";Lr();ezr();tSo();rSo();aSo();lSo();uSo();fSo();vve=ve.object({"only-include-referenced-schemas":ve.boolean().optional(),"inline-path-parameters":ve.boolean().optional(),"prefer-undiscriminated-unions-with-literals":ve.boolean().optional(),"object-query-parameters":ve.boolean().optional(),"respect-readonly-schemas":ve.boolean().optional(),"use-read-variant-for-responses":ve.boolean().optional(),"respect-forward-compatible-enums":ve.boolean().optional(),"respect-optional-request-body":ve.boolean().optional(),"use-bytes-for-binary-response":ve.boolean().optional(),"default-form-parameter-encoding":nzr.optional(),filter:uzr.optional(),"example-generation":lzr.optional(),"additional-properties-defaults-to":ve.boolean().optional(),"type-dates-as-strings":ve.boolean().optional(),"preserve-single-schema-oneof":ve.boolean().optional(),"preserve-one-of-in-all-of":ve.boolean().optional(),"any-of-sibling-properties-as-object":ve.boolean().optional(),"inline-all-of-schemas":ve.boolean().optional(),"resolve-aliases":fzr.optional(),"group-multi-api-environments":ve.boolean().optional(),"default-integer-format":rzr.optional(),"infer-discriminated-union-base-properties":ve.boolean().optional(),"disambiguate-request-names":ve.boolean().optional(),"ignore-tags":ve.boolean().optional(),"respect-parameter-content":ve.boolean().optional(),"respect-per-spec-base-path":ve.boolean().optional(),"respect-operation-id-word-boundaries":ve.boolean().optional(),"namespaced-errors":ve.boolean().optional(),"error-responses":czr.optional()}).extend(Ort)});var Brt,dzr=h(()=>{"use strict";Lr();tzr();t3t();Brt=ve.object({"auto-generate-idempotency-key":ve.unknown().optional(),"webhook-signature":ve.unknown().optional()}).extend(vve).extend(Prt)});var mzr,dSo=h(()=>{"use strict";Lr();mzr=ve.object({conjure:ve.string()})});var hzr,mSo=h(()=>{"use strict";Lr();tzr();k6e();$6t();hzr=ve.object({asyncapi:Ive,origin:ve.string().optional(),overrides:LV.optional(),namespace:ve.string().optional(),settings:Prt.optional()})});var gzr,hSo=h(()=>{"use strict";Lr();gzr=ve.object({graphql:ve.string(),origin:ve.string().optional(),overrides:ve.string().optional(),examples:ve.string().optional(),name:ve.string().optional()})});var Azr,gSo=h(()=>{"use strict";Lr();t3t();k6e();$6t();Azr=ve.object({openapi:Ive,origin:ve.string().optional(),overrides:LV.optional(),overlays:ve.string().optional(),namespace:ve.string().optional(),settings:vve.optional()})});var yzr,ASo=h(()=>{"use strict";Lr();k6e();yzr=ve.object({openrpc:ve.string(),overrides:LV.optional(),namespace:ve.string().optional()})});var bzr,ySo=h(()=>{"use strict";Lr();Kjr();bzr=ve.object({proto:Srt})});var Ezr,bSo=h(()=>{"use strict";Lr();mSo();hSo();gSo();ASo();ySo();Ezr=ve.undiscriminatedUnion([Azr,hzr,bzr,yzr,gzr])});var Drt,Izr=h(()=>{"use strict";Lr();dSo();bSo();Drt=ve.undiscriminatedUnion([ve.list(Ezr),mzr])});var vzr,ESo=h(()=>{"use strict";Lr();HNr();Y6t();Txo();Mxo();dzr();Izr();vzr=ve.object({auth:mrt.optional(),"auth-schemes":ve.record(ve.string(),yve).optional(),specs:Drt,settings:Brt.optional()}).extend(Qjr).extend(Tjr)});var Czr,ISo=h(()=>{"use strict";Lr();Zjr();Czr=ve.object({namespaces:ve.record(ve.string(),Trt)})});var xzr,vSo=h(()=>{"use strict";Lr();Zjr();ESo();ISo();xzr=ve.undiscriminatedUnion([Trt,Czr,vzr])});var Szr,CSo=h(()=>{"use strict";Lr();Szr=ve.enum_(["minimal","comprehensive"])});var wzr,xSo=h(()=>{"use strict";Lr();wzr=ve.object({name:ve.string(),registry:ve.string()})});var Tzr,SSo=h(()=>{"use strict";Lr();Tzr=ve.object({name:ve.string(),email:ve.string()})});var Cve,r3t=h(()=>{"use strict";Lr();SSo();Cve=ve.object({description:ve.string().optional(),authors:ve.list(Tzr).optional()})});var n3t,wSo=h(()=>{"use strict";Lr();n3t=ve.object({name:ve.string()})});var xve,i3t=h(()=>{"use strict";Lr();wSo();xve=ve.object({teams:ve.list(n3t).optional(),users:ve.list(n3t).optional()})});var Ozr,TSo=h(()=>{"use strict";Lr();HNr();Y6t();zjr();dzr();Izr();Ozr=ve.object({auth:mrt.optional(),"auth-schemes":ve.record(ve.string(),yve).optional(),headers:ve.record(ve.string(),yrt).optional(),settings:Brt.optional(),specs:Drt.optional()})});var Pzr,OSo=h(()=>{"use strict";Lr();Pzr=ve.object({url:ve.string().optional(),"package-name":ve.string(),token:ve.string().optional()})});var Bzr,PSo=h(()=>{"use strict";Lr();Bzr=ve.object({slug:ve.string().optional()})});var Dzr,BSo=h(()=>{"use strict";Lr();Dzr=ve.object({path:ve.string()})});var Rzr,DSo=h(()=>{"use strict";Lr();Rzr=ve.object({keyId:ve.string(),password:ve.string(),secretKey:ve.string()})});var kzr,RSo=h(()=>{"use strict";Lr();DSo();kzr=ve.object({url:ve.string().optional(),coordinate:ve.string(),username:ve.string().optional(),password:ve.string().optional(),signature:Rzr.optional()})});var Fzr,kSo=h(()=>{"use strict";Lr();Fzr=ve.object({url:ve.string().optional(),"package-name":ve.string(),token:ve.string().optional()})});var Nzr,FSo=h(()=>{"use strict";Lr();Nzr=ve.object({url:ve.string().optional(),"package-name":ve.string(),"api-key":ve.string().optional()})});var jzr,NSo=h(()=>{"use strict";Lr();jzr=ve.object({"api-key":ve.string(),"workspace-id":ve.string(),"collection-id":ve.string().optional()})});var zzr,jSo=h(()=>{"use strict";Lr();r3t();zzr=ve.object({keywords:ve.list(ve.string()).optional(),"documentation-link":ve.string().optional(),"homepage-link":ve.string().optional()}).extend(Cve)});var Qzr,zSo=h(()=>{"use strict";Lr();jSo();Qzr=ve.object({url:ve.string().optional(),"package-name":ve.string(),token:ve.string().optional(),username:ve.string().optional(),password:ve.string().optional(),metadata:zzr.optional()})});var Mzr,QSo=h(()=>{"use strict";Lr();Mzr=ve.object({url:ve.string().optional(),"package-name":ve.string(),"api-key":ve.string().optional()})});var Lzr,MSo=h(()=>{"use strict";Lr();OSo();PSo();BSo();RSo();kSo();FSo();NSo();zSo();QSo();Lzr=ve.union("location",{npm:Fzr,maven:kzr,pypi:Qzr,postman:jzr,"local-file-system":Dzr,"fern-hosted":Bzr,nuget:Nzr,rubygems:Mzr,crates:Pzr}).transform({transform:e=>e,untransform:e=>e})});var _zr,LSo=h(()=>{"use strict";Lr();_zr=ve.object({custom:ve.string()})});var Uzr,_So=h(()=>{"use strict";Lr();Uzr=ve.enum_(["MIT","Apache-2.0"])});var _V,F6e=h(()=>{"use strict";Lr();LSo();_So();_V=ve.undiscriminatedUnion([Uzr,_zr])});var o3t,USo=h(()=>{"use strict";Lr();F6e();o3t=ve.object({"package-description":ve.string().optional(),email:ve.string().optional(),"reference-url":ve.string().optional(),author:ve.string().optional(),license:_V.optional()})});var Vzr,VSo=h(()=>{"use strict";Lr();Vzr=ve.object({path:ve.string()})});var Gzr,GSo=h(()=>{"use strict";Lr();Gzr=ve.enum_(["commit","release"])});var qzr,qSo=h(()=>{"use strict";Lr();F6e();GSo();qzr=ve.object({repository:ve.string(),branch:ve.string().optional(),license:_V.optional(),mode:Gzr.optional(),workflows:ve.boolean().optional()})});var Wzr,WSo=h(()=>{"use strict";Lr();F6e();i3t();Wzr=ve.object({repository:ve.string(),branch:ve.string().optional(),license:_V.optional(),mode:ve.stringLiteral("pull-request"),reviewers:xve.optional(),workflows:ve.boolean().optional(),"auto-merge":ve.boolean().optional()})});var Hzr,HSo=h(()=>{"use strict";Lr();F6e();Hzr=ve.object({repository:ve.string(),license:_V.optional(),mode:ve.stringLiteral("push"),branch:ve.string().optional(),workflows:ve.boolean().optional()})});var Kzr,KSo=h(()=>{"use strict";Lr();Kzr=ve.enum_(["pull-request","push","commit-and-release"])});var Jzr,JSo=h(()=>{"use strict";Lr();F6e();KSo();Jzr=ve.object({uri:ve.string(),token:ve.string(),mode:Kzr.optional(),branch:ve.string().optional(),license:_V.optional(),workflows:ve.boolean().optional(),"auto-merge":ve.boolean().optional()})});var Yzr,YSo=h(()=>{"use strict";Lr();qSo();WSo();HSo();JSo();Yzr=ve.undiscriminatedUnion([Jzr,qzr,Wzr,Hzr])});var Rrt,Xzr=h(()=>{"use strict";Lr();K6t();TSo();MSo();USo();VSo();YSo();Rrt=ve.object({version:ve.string(),output:Lzr.optional(),github:Yzr.optional(),config:ve.unknown().optional(),metadata:o3t.optional(),keywords:ve.list(ve.string()).optional(),snippets:Vzr.optional(),"ir-version":ve.string().optional(),"smart-casing":ve.boolean().optional(),"smart-casing-digit-word-boundary":ve.boolean().optional(),api:Ozr.optional(),"disable-examples":ve.boolean().optional(),"publish-metadata":o3t.optional(),autorelease:ve.boolean().optional(),automation:gve.optional()})});var Zzr,XSo=h(()=>{"use strict";Lr();xSo();Xzr();Zzr=ve.object({image:wzr}).extend(Rrt)});var $zr,ZSo=h(()=>{"use strict";Lr();Xzr();$zr=ve.object({name:ve.string()}).extend(Rrt)});var eQr,$So=h(()=>{"use strict";Lr();XSo();ZSo();eQr=ve.undiscriminatedUnion([$zr,Zzr])});var tQr,ewo=h(()=>{"use strict";Lr();K6t();r3t();i3t();$So();tQr=ve.object({audiences:ve.list(ve.string()).optional(),generators:ve.list(eQr),metadata:Cve.optional(),reviewers:xve.optional(),automation:gve.optional()})});var rQr,two=h(()=>{"use strict";Lr();rQr=ve.object({enabled:ve.boolean()})});var nQr,rwo=h(()=>{"use strict";Lr();t3t();nQr=ve.object({path:ve.string(),origin:ve.string().optional(),overrides:ve.string().optional(),"disable-examples":ve.boolean().optional(),settings:vve})});var iQr,nwo=h(()=>{"use strict";Lr();rwo();iQr=ve.undiscriminatedUnion([nQr,ve.string()])});var oQr,iwo=h(()=>{"use strict";Lr();oQr=ve.enum_(["java","python","go","ruby","csharp","typescript","php","rust","swift"])});var sQr,owo=h(()=>{"use strict";Lr();iwo();sQr=ve.object({title:ve.string(),language:oQr,content:ve.string()})});var aQr,swo=h(()=>{"use strict";Lr();aQr=ve.object({method:ve.string(),path:ve.string(),stream:ve.boolean().optional()})});var s3t,awo=h(()=>{"use strict";Lr();swo();s3t=ve.undiscriminatedUnion([ve.string(),aQr])});var cQr,cwo=h(()=>{"use strict";Lr();CSo();owo();awo();cQr=ve.object({bannerLink:ve.string().optional(),introduction:ve.string().optional(),apiReferenceLink:ve.string().optional(),apiName:ve.string().optional(),disabledSections:ve.list(ve.string()).optional(),defaultEndpoint:s3t.optional(),features:ve.record(ve.string(),ve.list(s3t)).optional(),customSections:ve.list(sQr).optional(),exampleStyle:Szr.optional()})});var lQr,lwo=h(()=>{"use strict";Lr();lQr=ve.object({username:ve.string(),email:ve.string(),token:ve.string()})});var uQr,uwo=h(()=>{"use strict";Lr();lwo();uQr=ve.object({github:lQr.optional()})});var stl,atl=h(()=>{"use strict";Lr();NCo();K6t();Y6t();ewo();two();i3t();vSo();Gjr();nwo();r3t();cwo();uwo();stl=ve.object({"auth-schemes":ve.record(ve.string(),yve).optional(),api:xzr.optional(),whitelabel:uQr.optional(),metadata:Cve.optional(),readme:cQr.optional(),"default-group":ve.string().optional(),aliases:ve.record(ve.string(),ve.list(ve.string())).optional(),groups:ve.record(ve.string(),tQr).optional(),reviewers:xve.optional(),replay:rQr.optional(),ai:_Nr.optional(),autorelease:ve.boolean().optional(),automation:gve.optional(),openapi:iQr.optional(),"openapi-overrides":ve.string().optional(),"spec-origin":ve.string().optional(),"async-api":ve.string().optional(),"api-settings":Crt.optional()})});var pwo=h(()=>{"use strict";vSo();Zjr();ESo();dzr();Izr();$xo();Z6t();Zxo();Gjr();qjr();tzr();mSo();ezr();eSo();dSo();tSo();CSo();rSo();xSo();atl();Yxo();rwo();nwo();hSo();iwo();Mjr();Ljr();ISo();nSo();oSo();iSo();aSo();sSo();lSo();uSo();t3t();gSo();ASo();SSo();r3t();k6e();_jr();Jjr();Kjr();ySo();owo();swo();awo();cwo();Ujr();cSo();fSo();pSo();bSo();Xxo();$6t();Jxo();uwo();lwo()});var fwo={};ne(fwo,{ApiConfigurationSchema:()=>xzr,ApiConfigurationSchemaInternal:()=>Trt,ApiConfigurationV2Schema:()=>vzr,ApiConfigurationV2SettingsSchema:()=>Brt,ApiConfigurationV2SpecsSchema:()=>Drt,ApiDefinitionList:()=>Xjr,ApiDefinitionPathSchema:()=>Eve,ApiDefinitionSchema:()=>Yjr,ApiDefinitionSettingsSchema:()=>Crt,ApiDefinitionWithOverridesSchema:()=>xrt,AsyncApiSettingsSchema:()=>Prt,AsyncApiSpecSchema:()=>hzr,BaseApiSettingsSchema:()=>Ort,CoerceConstsTo:()=>$jr,ConjureSchema:()=>mzr,DefaultIntegerFormat:()=>rzr,ExampleStyle:()=>Szr,FormParameterEncoding:()=>nzr,GeneratorImageObjectSchema:()=>wzr,GeneratorsConfigurationSchema:()=>stl,GeneratorsOpenApiObjectSchema:()=>nQr,GeneratorsOpenApiSchema:()=>iQr,GitRemoteSchema:()=>Wjr,GraphQlSpecSchema:()=>gzr,Language:()=>oQr,MessageNamingSettingsSchema:()=>brt,MultiServerStrategy:()=>Ert,NamespacedApiConfigurationSchema:()=>Czr,OpenApiErrorResponsesApplyTo:()=>izr,OpenApiErrorResponsesEnsureSchema:()=>szr,OpenApiErrorResponsesHttpMethod:()=>ozr,OpenApiErrorResponsesSchema:()=>czr,OpenApiErrorResponsesSchemaSource:()=>azr,OpenApiExampleGenerationSchema:()=>lzr,OpenApiFilterSchema:()=>uzr,OpenApiSettingsSchema:()=>vve,OpenApiSpecSchema:()=>Azr,OpenRpcSpecSchema:()=>yzr,OutputMetadataAuthor:()=>Tzr,OutputMetadataSchema:()=>Cve,OverridesSchema:()=>LV,PathParameterOrder:()=>Irt,ProtobufApiDefinitionSchema:()=>wrt,ProtobufDefinitionSchema:()=>Srt,ProtobufSpecSchema:()=>bzr,ReadmeCustomSectionSchema:()=>sQr,ReadmeEndpointObjectSchema:()=>aQr,ReadmeEndpointSchema:()=>s3t,ReadmeSchema:()=>cQr,RemoveDiscriminantsFromSchemas:()=>vrt,RequestOrResponseExampleGenerationSchema:()=>e3t,ResolveAliases:()=>fzr,ResolveAliasesSchema:()=>pzr,SpecGitSourceSchema:()=>Hjr,SpecSchema:()=>Ezr,SpecSourceSchema:()=>Ive,UnionSettingsSchema:()=>Vjr,WhitelabelConfigurationSchema:()=>uQr,WhitelabelGithubConfigurationSchema:()=>lQr});var ctl=h(()=>{"use strict";pwo()});var dwo=h(()=>{"use strict";Xzr();OSo();XSo();ZSo();PSo();TSo();ewo();$So();MSo();USo();VSo();GSo();qSo();YSo();WSo();HSo();KSo();JSo();BSo();RSo();DSo();kSo();FSo();NSo();zSo();jSo();QSo()});var mwo={};ne(mwo,{BaseGeneratorInvocationSchema:()=>Rrt,CratesOutputLocationSchema:()=>Pzr,CustomGeneratorInvocationSchema:()=>Zzr,DefaultGeneratorInvocationSchema:()=>$zr,FernHostedOutputLocationSchema:()=>Bzr,GeneratorApiSettingsSchema:()=>Ozr,GeneratorGroupSchema:()=>tQr,GeneratorInvocationSchema:()=>eQr,GeneratorOutputSchema:()=>Lzr,GeneratorPublishMetadataSchema:()=>o3t,GeneratorSnippetsSchema:()=>Vzr,GithubCommitAndReleaseMode:()=>Gzr,GithubCommitAndReleaseSchema:()=>qzr,GithubConfigurationSchema:()=>Yzr,GithubPullRequestSchema:()=>Wzr,GithubPushSchema:()=>Hzr,GithubSelfhostedMode:()=>Kzr,GithubSelfhostedSchema:()=>Jzr,LocalFileSystemOutputLocationSchema:()=>Dzr,MavenOutputLocationSchema:()=>kzr,MavenOutputSignatureSchema:()=>Rzr,NpmOutputLocationSchema:()=>Fzr,NugetOutputLocationSchema:()=>Nzr,PostmanOutputLocationSchema:()=>jzr,PypiOutputLocationSchema:()=>Qzr,PypiOutputMetadataSchema:()=>zzr,RubyGemsOutputLocationSchema:()=>Mzr});var ltl=h(()=>{"use strict";dwo()});var hwo=h(()=>{"use strict";LSo();F6e();_So()});var gwo={};ne(gwo,{GithubLicenseCustomSchema:()=>_zr,GithubLicenseSchema:()=>_V,GithubLicenseType:()=>Uzr});var utl=h(()=>{"use strict";hwo()});var Awo=h(()=>{"use strict";two()});var ywo={};ne(ywo,{ReplayConfigSchema:()=>rQr});var ptl=h(()=>{"use strict";Awo()});var bwo=h(()=>{"use strict";wSo();i3t()});var Ewo={};ne(Ewo,{ReviewerSchema:()=>n3t,ReviewersSchema:()=>xve});var ftl=h(()=>{"use strict";bwo()});var dtl=h(()=>{"use strict";Hel();jCo();Kel();QCo();otl();ctl();pwo();ltl();dwo();utl();hwo();ptl();Awo();ftl();bwo()});var Iwo={};ne(Iwo,{AiServicesSchema:()=>_Nr,ApiConfigurationSchema:()=>xzr,ApiConfigurationSchemaInternal:()=>Trt,ApiConfigurationV2Schema:()=>vzr,ApiConfigurationV2SettingsSchema:()=>Brt,ApiConfigurationV2SpecsSchema:()=>Drt,ApiDefinitionList:()=>Xjr,ApiDefinitionPathSchema:()=>Eve,ApiDefinitionSchema:()=>Yjr,ApiDefinitionSettingsSchema:()=>Crt,ApiDefinitionWithOverridesSchema:()=>xrt,AsyncApiSettingsSchema:()=>Prt,AsyncApiSpecSchema:()=>hzr,AutomationSchema:()=>gve,BaseApiSettingsSchema:()=>Ort,BaseGeneratorInvocationSchema:()=>Rrt,CoerceConstsTo:()=>$jr,ConjureSchema:()=>mzr,CratesOutputLocationSchema:()=>Pzr,CustomGeneratorInvocationSchema:()=>Zzr,DefaultGeneratorInvocationSchema:()=>$zr,DefaultIntegerFormat:()=>rzr,ExampleStyle:()=>Szr,FernHostedOutputLocationSchema:()=>Bzr,FormParameterEncoding:()=>nzr,GeneratorApiSettingsSchema:()=>Ozr,GeneratorGroupSchema:()=>tQr,GeneratorImageObjectSchema:()=>wzr,GeneratorInvocationSchema:()=>eQr,GeneratorOutputSchema:()=>Lzr,GeneratorPublishMetadataSchema:()=>o3t,GeneratorSnippetsSchema:()=>Vzr,GeneratorsConfigurationSchema:()=>stl,GeneratorsOpenApiObjectSchema:()=>nQr,GeneratorsOpenApiSchema:()=>iQr,GitRemoteSchema:()=>Wjr,GithubCommitAndReleaseMode:()=>Gzr,GithubCommitAndReleaseSchema:()=>qzr,GithubConfigurationSchema:()=>Yzr,GithubLicenseCustomSchema:()=>_zr,GithubLicenseSchema:()=>_V,GithubLicenseType:()=>Uzr,GithubPullRequestSchema:()=>Wzr,GithubPushSchema:()=>Hzr,GithubSelfhostedMode:()=>Kzr,GithubSelfhostedSchema:()=>Jzr,GraphQlSpecSchema:()=>gzr,Language:()=>oQr,LocalFileSystemOutputLocationSchema:()=>Dzr,MavenOutputLocationSchema:()=>kzr,MavenOutputSignatureSchema:()=>Rzr,MessageNamingSettingsSchema:()=>brt,ModelName:()=>MNr,ModelProvider:()=>LNr,MultiServerStrategy:()=>Ert,NamespacedApiConfigurationSchema:()=>Czr,NpmOutputLocationSchema:()=>Fzr,NugetOutputLocationSchema:()=>Nzr,OpenApiErrorResponsesApplyTo:()=>izr,OpenApiErrorResponsesEnsureSchema:()=>szr,OpenApiErrorResponsesHttpMethod:()=>ozr,OpenApiErrorResponsesSchema:()=>czr,OpenApiErrorResponsesSchemaSource:()=>azr,OpenApiExampleGenerationSchema:()=>lzr,OpenApiFilterSchema:()=>uzr,OpenApiSettingsSchema:()=>vve,OpenApiSpecSchema:()=>Azr,OpenRpcSpecSchema:()=>yzr,OutputMetadataAuthor:()=>Tzr,OutputMetadataSchema:()=>Cve,OverridesSchema:()=>LV,PathParameterOrder:()=>Irt,PostmanOutputLocationSchema:()=>jzr,ProtobufApiDefinitionSchema:()=>wrt,ProtobufDefinitionSchema:()=>Srt,ProtobufSpecSchema:()=>bzr,PypiOutputLocationSchema:()=>Qzr,PypiOutputMetadataSchema:()=>zzr,ReadmeCustomSectionSchema:()=>sQr,ReadmeEndpointObjectSchema:()=>aQr,ReadmeEndpointSchema:()=>s3t,ReadmeSchema:()=>cQr,RemoveDiscriminantsFromSchemas:()=>vrt,ReplayConfigSchema:()=>rQr,RequestOrResponseExampleGenerationSchema:()=>e3t,ResolveAliases:()=>fzr,ResolveAliasesSchema:()=>pzr,ReviewerSchema:()=>n3t,ReviewersSchema:()=>xve,RubyGemsOutputLocationSchema:()=>Mzr,SpecGitSourceSchema:()=>Hjr,SpecSchema:()=>Ezr,SpecSourceSchema:()=>Ive,UnionSettingsSchema:()=>Vjr,WhitelabelConfigurationSchema:()=>uQr,WhitelabelGithubConfigurationSchema:()=>lQr,ai:()=>zCo,automation:()=>MCo,fernDefinition:()=>Kxo,generators:()=>fwo,group:()=>mwo,license:()=>gwo,replay:()=>ywo,reviewers:()=>Ewo});var mtl=h(()=>{"use strict";dtl()});var htl=h(()=>{"use strict";k$c();mtl()});function gtl(e){let t=e.output;return t?.location==="maven"&&t.signature==null&&t.url==null}function Atl(e){return`Maven output for ${e} has no \`signature\` and no \`url\`. Maven Central requires signed artifacts, so this publish will be uploaded to the Central Portal staging service but never released. Add \`signature\` to publish to Maven Central, or set \`url\` to publish to another registry.`}var ytl=h(()=>{"use strict"});function btl(e){return e?.specs!=null}var Etl=h(()=>{"use strict"});function Itl(e){return e?.asyncapi!=null}var vtl=h(()=>{"use strict"});function Ctl(e){return e?.conjure!=null}var xtl=h(()=>{"use strict"});function Stl(e){return e?.graphql!=null}var wtl=h(()=>{"use strict"});function Ttl(e){return e?.namespaces!=null}var Otl=h(()=>{"use strict"});function Ptl(e){return e?.openapi!=null}var Btl=h(()=>{"use strict"});function Dtl(e){return e?.openrpc!=null}var Rtl=h(()=>{"use strict"});function ktl(e){return e?.proto!=null}var Ftl=h(()=>{"use strict"});var Ntl=h(()=>{"use strict";Etl();vtl();xtl();wtl();Otl();Btl();Rtl();Ftl()});var zr={};ne(zr,{API_ORIGIN_LOCATION_KEY:()=>EUc,API_SETTINGS_KEY:()=>xUc,ASYNC_API_LOCATION_KEY:()=>IUc,CoerceConstsTo:()=>MXc,DEFAULT_GROUP_GENERATORS_CONFIG_KEY:()=>eve,DEFAULT_GROUP_NAME:()=>jLt,DIRECT_RUBYGEMS_PUBLISHING_UNSUPPORTED_MESSAGE:()=>zJc,DefaultIntegerFormat:()=>UXc,ExampleStyle:()=>GXc,FormParameterEncoding:()=>WXc,GenerationLanguage:()=>LJc,GithubCommitAndReleaseMode:()=>t$c,GithubLicenseType:()=>v$c,GithubSelfhostedMode:()=>a$c,Language:()=>eZc,MessageNamingSettingsSchema:()=>rZc,ModelProvider:()=>XJc,MultiServerStrategy:()=>iZc,OPENAPI_LOCATION_KEY:()=>vUc,OPENAPI_OVERRIDES_LOCATION_KEY:()=>CUc,OpenApiErrorResponsesApplyTo:()=>aZc,OpenApiErrorResponsesHttpMethod:()=>uZc,PathParameterOrder:()=>vZc,RemoveDiscriminantsFromSchemas:()=>DZc,UnionSettingsSchema:()=>MZc,ai:()=>Hvo,automation:()=>tYc,fernDefinition:()=>sCo,generators:()=>cCo,getPackageName:()=>_Jc,getUnsignedMavenPublishingWithoutUrlMessage:()=>Atl,group:()=>uCo,isApiConfigurationV2Schema:()=>btl,isAsyncApiSpecSchema:()=>Itl,isConjureSchema:()=>Ctl,isDirectRubyGemsPublishing:()=>QJc,isGithubAutoMergeEnabled:()=>VJc,isGraphQLSpecSchema:()=>Stl,isNamespacedApiConfiguration:()=>Ttl,isOpenApiSpecSchema:()=>Ptl,isOpenRpcSpecSchema:()=>Dtl,isProtoSpecSchema:()=>ktl,isRawProtobufAPIDefinitionSchema:()=>qJc,isUnsignedMavenPublishingWithoutUrl:()=>gtl,license:()=>fCo,replay:()=>w$c,resolveAutomationConfig:()=>HJc,reviewers:()=>B$c,serialization:()=>Iwo});var jtl=h(()=>{"use strict";YDr();MJc();UJc();GJc();WJc();KJc();htl();ytl();Ntl()});var Uo=h(()=>{"use strict";gUc();YDr();fGc();RJc();kJc();jJc();jtl()});function Bee(e){if(typeof e.raw?.output=="object"&&e.raw?.output!==null){let r=e.raw.output["package-name"];if(r!=null)return r;let n=e.raw.output.coordinate;if(n!=null)return n}let t=e.config??e.raw?.config;if(typeof t=="object"&&t!==null){let r=t.package_name;if(typeof r=="string")return r;let n=t["package-name"];if(typeof n=="string")return n;let i=t.module?.path;if(typeof i=="string")return i;let o=t.packageName;if(typeof o=="string")return o}}function Sve(e){if(typeof e.raw?.config=="object"&&e.raw?.config!==null){let t=e.raw.config["user-agent"];if(t!=null)return t}}function _Ld(e){if(!Array.isArray(e))return Cwo;let t=e.filter(r=>typeof r=="string").map(r=>r.toUpperCase()).filter(r=>LLd.has(r));return t.length>0?t:Cwo}function wve(e){let t=e.idempotencyKeyGenerationConfig??ULd(e);return VLd(t)}function ULd(e){let t=typeof e.raw?.config=="object"&&e.raw?.config!==null?e.raw.config:typeof e.config=="object"&&e.config!==null?e.config:void 0;if(t!=null)return t["auto-generate-idempotency-key"]}function VLd(e){if(e===!0)return{headerName:ztl,methods:Cwo};if(typeof e=="object"&&e!==null){let t=e["header-name"];return{headerName:typeof t=="string"?t:ztl,methods:_Ld(e.methods)}}}function Tve(e,t){return Mtl(e.webhookSignatureConfig,t)}function Qtl(e,t){let r=e?.rawConfiguration.api;if(!(r==null||!zr.isApiConfigurationV2Schema(r)))return Mtl(r.settings?.["webhook-signature"],t)}function Mtl(e,t){if(e==null)return;let r=Pd.serialization.WebhookSignatureSchema.parse(e,{unrecognizedObjectKeys:"fail"});if(!r.ok){let n=r.errors.map(i=>`${i.path.join(".")||"<root>"}: ${i.message}`).join("; ");return t.failAndThrow(`Invalid api.settings.webhook-signature in generators.yml: ${n}`)}return r.value}function Dee(e){if(typeof e!="object"||e===null)return e;let t={};for(let[r,n]of Object.entries(e))GLd.has(r)||(t[r]=n);return t}async function pQr({version:e,packageName:t,generatorInvocation:r,context:n}){if(e==null||r.outputMode.type==="downloadFiles")return;let i=r.outputMode.type==="publishV2"||r.outputMode.type==="publish",o=t??Bee(r);if(r.language==null||o==null)return;let s=r.language,a;try{a=await qLd({packageName:o,version:e,language:s})}catch(c){n.logger.debug(`Could not verify version availability on ${vwo(s)}: ${tn(c)}`);return}a&&(i?n.failAndThrow(`Version ${e} of ${o} already exists on the ${vwo(s)} registry. Please use a different version number. If you want to automatically increment the version, omit the --version flag.`,void 0,{code:w.Code.VersionError}):n.logger.warn(`Version ${e} of ${o} already exists on the ${vwo(s)} registry. If your CI pipeline publishes this version, it may fail.`))}async function qLd({packageName:e,version:t,language:r}){switch(r){case"typescript":return await WLd(e,t);case"python":return await HLd(e,t);case"java":return await KLd(e,t);case"csharp":return await JLd(e,t);case"ruby":return await YLd(e,t);case"go":return await XLd(e,t);case"rust":return await ZLd(e,t);default:return!1}}async function WLd(e,t){let r=encodeURIComponent(e).replace(/^%40/,"@"),n={accept:"application/json"},i=process.env.NPM_TOKEN;i!=null&&(n.authorization=`Bearer ${i}`);let o=await fetch(`https://registry.npmjs.org/${r}/${t}`,{headers:n,signal:AbortSignal.timeout(N6e)});return o.ok?(await o.json()).version===t:!1}async function HLd(e,t){return(await fetch(`https://pypi.org/pypi/${e}/${t}/json`,{signal:AbortSignal.timeout(N6e)})).ok}async function KLd(e,t){let r=e.split(":");if(r.length<2||!r[0]||!r[1])return!1;let n=r[0],i=r[1],o=await fetch(`https://search.maven.org/solrsearch/select?q=g:${encodeURIComponent(n)}+AND+a:${encodeURIComponent(i)}+AND+v:${encodeURIComponent(t)}&rows=1&wt=json`,{signal:AbortSignal.timeout(N6e)});return o.ok?((await o.json()).response?.numFound??0)>0:!1}async function JLd(e,t){let r=await fetch(`https://api.nuget.org/v3-flatcontainer/${e.toLowerCase()}/index.json`,{signal:AbortSignal.timeout(N6e)});return r.ok?((await r.json()).versions??[]).some(o=>o.toLowerCase()===t.toLowerCase()):!1}async function YLd(e,t){return(await fetch(`https://rubygems.org/api/v2/rubygems/${e}/versions/${t}.json`,{signal:AbortSignal.timeout(N6e)})).ok}async function XLd(e,t){let r=e.replace(/[A-Z]/g,s=>"!"+s.toLowerCase()),n=t.startsWith("v")?t:`v${t}`,i=await fetch(`https://proxy.golang.org/${r}/@v/${n}.info`,{signal:AbortSignal.timeout(N6e)});return i.ok?(await i.json()).Version!=null:!1}async function ZLd(e,t){let r=await fetch(`https://crates.io/api/v1/crates/${e}/${t}`,{headers:{"user-agent":"fern-cli (https://buildwithfern.com)"},signal:AbortSignal.timeout(N6e)});return r.ok?(await r.json()).version?.num===t:!1}function vwo(e){switch(e){case"typescript":return"npm";case"python":return"PyPI";case"java":return"Maven Central";case"csharp":return"NuGet";case"ruby":return"RubyGems";case"go":return"Go Module Proxy";case"rust":return"crates.io";default:return e}}var ztl,Cwo,LLd,GLd,N6e,xwo=h(()=>{"use strict";Uo();It();so();Dt();ztl="Idempotency-Key",Cwo=["POST","PUT"],LLd=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD"]);GLd=new Set(["user-agent","auto-generate-idempotency-key"]);N6e=5e3});var Ltl=E(X6=>{"use strict";var $Ld=X6&&X6.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(X6,"__esModule",{value:!0});var e6d=require("fs"),t6d=$Ld(RA()),krt=t6d.default("@kwsites/file-exists");function r6d(e,t,r){krt("checking %s",e);try{let n=e6d.statSync(e);return n.isFile()&&t?(krt("[OK] path represents a file"),!0):n.isDirectory()&&r?(krt("[OK] path represents a directory"),!0):(krt("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return krt("[FAIL] path is not accessible: %o",n),!1;throw krt("[FATAL] %o",n),n}}function n6d(e,t=X6.READABLE){return r6d(e,(t&X6.FILE)>0,(t&X6.FOLDER)>0)}X6.exists=n6d;X6.FILE=1;X6.FOLDER=2;X6.READABLE=X6.FILE+X6.FOLDER});var Swo=E(fQr=>{"use strict";function i6d(e){for(var t in e)fQr.hasOwnProperty(t)||(fQr[t]=e[t])}Object.defineProperty(fQr,"__esModule",{value:!0});i6d(Ltl())});function Frt(...e){let t=new String(e);return wwo.set(t,e),t}function UV(e){return e instanceof String&&wwo.has(e)}function Nrt(e){return wwo.get(e)??[]}var wwo,Ove=h(()=>{"use strict";wwo=new WeakMap});var a3t=E(j6e=>{"use strict";Object.defineProperty(j6e,"__esModule",{value:!0});j6e.createDeferred=j6e.deferred=void 0;function Two(){let e,t,r="pending";return{promise:new Promise((i,o)=>{e=i,t=o}),done(i){r==="pending"&&(r="resolved",e(i))},fail(i){r==="pending"&&(r="rejected",t(i))},get fulfilled(){return r!=="pending"},get status(){return r}}}j6e.deferred=Two;j6e.createDeferred=Two;j6e.default=Two});function*_tl(e,t){let r=t==="global";for(let n of e)n.isGlobal===r&&(yield n)}function l6d(e,t){for(let{name:n}of _tl(e,"task")){if(o6d.has(n))return jrt(!0,t);if(s6d.has(n))return jrt(!1,t)}let r=t.at(0)?.toLowerCase();return r===void 0?null:a6d.has(r)?jrt(!0,t.slice(1)):c6d.has(r)?jrt(!1,t.slice(1)):t.length===1?jrt(!1,t):jrt(!0,t)}function jrt(e=!1,t=[]){let r=t.at(0)?.toLowerCase();return r===void 0?null:{isWrite:e,isRead:!e,key:r,value:t.at(1)}}function u6d(e,t){return t.isWrite&&t.value!==void 0?{key:t.key,value:t.value,scope:e}:{key:t.key,scope:e}}function p6d(e){let t=e?.indexOf("=")||-1;return!e||t<0?null:{key:e.slice(0,t).trim().toLowerCase(),value:e.slice(t+1)}}function f6d(e){for(let{name:t}of _tl(e,"task"))switch(t){case"--global":return"global";case"--system":return"system";case"--worktree":return"worktree";case"--local":return"local";case"--file":case"-f":return"file"}return"local"}function d6d({name:e}){if(e==="-c"||e==="--config")return"inline";if(e==="--config-env")return"env"}function*m6d(e){for(let t of e){let r=d6d(t),n=r&&p6d(t.value);n&&(yield{...n,scope:r})}}function h6d(e,t,r){let n={read:[],write:[...m6d(t)]};return e==="config"&&g6d(n,f6d(t),l6d(t,r)),n}function g6d(e,t,r){if(r===null)return;let n=u6d(t,r);r.isWrite?e.write.push(n):e.read.push(n)}function E6d(e){let t=y6d[e??""]??b6d;return{short:new Map([...Utl.short.entries(),...t.short.entries()]),long:t.long}}function Vtl(e,t=A6d){if(e.startsWith("--")){let r=e.indexOf("=");if(r>2)return[{name:e.slice(0,r),value:e.slice(r+1),needsNext:!1}];let n=e.slice(2);return[{name:e,needsNext:t.long.has(n)}]}if(e.length===2){let r=e.charAt(1),n=t.short.get(r);return[{name:e,needsNext:n===!0}]}return I6d(e,t.short)}function I6d(e,t){let r=e.slice(1).split(""),n=[];for(let i=0;i<r.length;i++){let o=r[i],s=t.get(o);if(s===void 0)return[{name:e,needsNext:!1}];if(s){let a=r.slice(i+1).join("");if(a&&![...a].every(c=>t.has(c)))return n.push({name:`-${o}`,value:a,needsNext:!1}),n}n.push({name:`-${o}`,needsNext:s})}return n}function v6d(e,t=[]){let r=0;for(;r<e.length;){let n=String(e[r]);if(!n.startsWith("-")||n.length<2)break;let i=Vtl(n),o=r+1;for(let s of i){let a={name:s.name,value:s.value,absorbedNext:!1,isGlobal:!0};s.needsNext&&a.value===void 0&&o<e.length&&(a.value=String(e[o]),a.absorbedNext=!0,o++),t.push(a)}r=o}return{flags:t,taskIndex:r}}function C6d(e,t,r=[]){let n=E6d(t),i=[],o=[],s=0;for(;s<e.length;){let a=e[s];if(UV(a)){o.push(...Nrt(a)),s++;continue}let c=String(a);if(c==="--"){for(let p=s+1;p<e.length;p++){let d=e[p];UV(d)?o.push(...Nrt(d)):o.push(String(d))}break}if(!c.startsWith("-")||c.length<2){i.push(c),s++;continue}let l=Vtl(c,n),u=s+1;for(let p of l){let d={name:p.name,value:p.value,absorbedNext:!1,isGlobal:!1};p.needsNext&&d.value===void 0&&u<e.length&&!UV(e[u])&&(d.value=String(e[u]),d.absorbedNext=!0,u++),r.push(d)}s=u}return{flags:r,positionals:i,pathspecs:o}}function*x6d({write:e}){for(let t of e)for(let r of S6d){let n=r(t.key);n&&(yield n)}}function GV(e,t,r=String(e)){let n=typeof e=="string"?new RegExp(`\\s*${e.toLowerCase()}`):e;return function(i){if(n.test(i))return{category:t,message:`Configuring ${r} is not permitted without enabling ${t}`}}}function VV(e,t){let r=new RegExp(`\\s*${e.toLowerCase().replace(/\./g,"(..+)?.")}`);return GV(r,t,e)}function*w6d(e,t){for(let r of t)for(let n of T6d){let i=n(e,r.name);i&&(yield i)}}function c3t(e,t,r,n=String(t)){let i=typeof t=="string"?new RegExp(`\\s*${t.toLowerCase()}`):t,o=`Use of ${e?`${e} with option `:""}${n} is not permitted without enabling ${r}`;return function(s,a){if((!e||s===e)&&i.test(a))return{category:r,message:o}}}function Gtl(e,t,r){return[...w6d(e,t),...x6d(r)]}function O6d(...e){let{flags:t,taskIndex:r}=v6d(e),n=r<e.length?String(e[r]).toLowerCase():null,i=n!==null?e.slice(r+1):[],{positionals:o,pathspecs:s}=C6d(i,n,t),a=h6d(n,t,o);return{task:n,flags:t.map(B6d),paths:s,config:a,vulnerabilities:P6d(Gtl(n,t,a))}}function P6d(e){return Object.defineProperty(e,"vulnerabilities",{value:e})}function B6d({value:e,name:t}){return e!==void 0?{name:t,value:e}:{name:t}}function*D6d(e){let t=parseInt(e.git_config_count??"0",10);for(let r=0;r<t;r++){let n=e[`git_config_key_${r}`],i=e[`git_config_value_${r}`];n!==void 0&&(yield{key:n.toLowerCase().trim(),value:i,scope:"env"})}}function*R6d(e){for(let t of Object.keys(e))if(Wtl(t)){let r=qtl[t];yield{category:r,message:`Use of "${t.toUpperCase()}" is not permitted without enabling ${r}`}}}function Wtl(e){return Object.hasOwn(qtl,e)}function k6d(e){let t={};for(let[r,n]of Object.entries(e)){let i=r.toLowerCase().trim();(Wtl(i)||i.startsWith("git"))&&(t[i]=String(n))}return t}function F6d(e){let t=k6d(e),r={read:[],write:[...D6d(t)]},n=[...R6d(t),...Gtl(null,[],r)];return{config:r,vulnerabilities:n}}function Htl(e,t){return[...O6d(...e).vulnerabilities,...F6d(t).vulnerabilities]}var o6d,s6d,a6d,c6d,Utl,A6d,y6d,b6d,S6d,T6d,qtl,Ktl=h(()=>{"use strict";Ove();o6d=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),s6d=new Set(["--get","--get-all","--get-color","--get-colorbool","--get-regexp","--get-urlmatch","--list","-l"]),a6d=new Set(["edit","remove-section","rename-section","set","unset"]),c6d=new Set(["get","get-color","get-colorbool","list"]);Utl={short:new Map([["c",!0]])},A6d={short:new Map([["C",!0],["P",!1],["h",!1],["p",!1],["v",!1],...Utl.short.entries()]),long:new Set(["attr-source","config-env","exec-path","git-dir","list-cmds","namespace","super-prefix","work-tree"])},y6d={clone:{short:new Map([["b",!0],["j",!0],["l",!1],["n",!1],["o",!0],["q",!1],["s",!1],["u",!0]]),long:new Set(["branch","config","jobs","origin","upload-pack","u","template"])},commit:{short:new Map([["C",!0],["F",!0],["c",!0],["m",!0],["t",!0]]),long:new Set(["file","message","reedit-message","reuse-message","template"])},config:{short:new Map([["e",!1],["f",!0],["l",!1]]),long:new Set(["blob","comment","default","file","type","value"])},fetch:{short:new Map,long:new Set(["upload-pack"])},init:{short:new Map,long:new Set(["template"])},pull:{short:new Map,long:new Set(["upload-pack"])},push:{short:new Map,long:new Set(["exec","receive-pack"])}},b6d={short:new Map,long:new Set};S6d=[GV("alias","allowUnsafeAlias"),GV("core.askPass","allowUnsafeAskPass"),GV("core.editor","allowUnsafeEditor"),GV("core.fsmonitor","allowUnsafeFsMonitor"),GV("core.gitProxy","allowUnsafeGitProxy"),GV("core.hooksPath","allowUnsafeHooksPath"),GV("core.pager","allowUnsafePager"),GV("core.sshCommand","allowUnsafeSshCommand"),VV("credential.helper","allowUnsafeCredentialHelper"),VV("diff.command","allowUnsafeDiffExternal"),GV("diff.external","allowUnsafeDiffExternal"),VV("diff.textconv","allowUnsafeDiffTextConv"),VV("filter.clean","allowUnsafeFilter"),VV("filter.smudge","allowUnsafeFilter"),VV("gpg.program","allowUnsafeGpgProgram"),GV("init.templateDir","allowUnsafeTemplateDir"),VV("merge.driver","allowUnsafeMergeDriver"),VV("mergetool.path","allowUnsafeMergeDriver"),VV("mergetool.cmd","allowUnsafeMergeDriver"),VV("protocol.allow","allowUnsafeProtocolOverride"),VV("remote.receivepack","allowUnsafePack"),VV("remote.uploadpack","allowUnsafePack"),GV("sequence.editor","allowUnsafeEditor")];T6d=[c3t(null,/--(upload|receive)-pack/,"allowUnsafePack","--upload-pack or --receive-pack"),c3t("clone",/^-\w*u/,"allowUnsafePack"),c3t("clone","--u","allowUnsafePack"),c3t("push","--exec","allowUnsafePack"),c3t(null,"--template","allowUnsafeTemplateDir")];qtl={editor:"allowUnsafeEditor",git_askpass:"allowUnsafeAskPass",git_config_global:"allowUnsafeConfigPaths",git_config_system:"allowUnsafeConfigPaths",git_config_count:"allowUnsafeConfigEnvCount",git_config:"allowUnsafeConfigPaths",git_editor:"allowUnsafeEditor",git_exec_path:"allowUnsafeConfigPaths",git_external_diff:"allowUnsafeDiffExternal",git_pager:"allowUnsafePager",git_proxy_command:"allowUnsafeGitProxy",git_template_dir:"allowUnsafeTemplateDir",git_sequence_editor:"allowUnsafeEditor",git_ssh:"allowUnsafeSshCommand",git_ssh_command:"allowUnsafeSshCommand",pager:"allowUnsafePager",prefix:"allowUnsafeConfigPaths",ssh_askpass:"allowUnsafeAskPass"}});function Orl(e){return typeof e!="function"?M6e:e}function Prl(e){return typeof e=="function"&&e!==M6e}function Brl(e,t){let r=e.indexOf(t);return r<=0?[e,""]:[e.substr(0,r),e.substr(r+1)]}function Drl(e,t=0){return Rrl(e)&&e.length>t?e[t]:void 0}function Q6e(e,t=0){if(Rrl(e)&&e.length>t)return e[e.length-1-t]}function Rrl(e){return wQr(e)}function d3t(e="",t=!0,r=`
|
|
243
243
|
`){return e.split(r).reduce((n,i)=>{let o=t?i.trim():i;return o&&n.push(o),n},[])}function Xwo(e,t){return d3t(e,!0).map(r=>t(r))}function Zwo(e){return(0,vQr.exists)(e,vQr.FOLDER)}function qV(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function krl(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function CQr(e,t){if(Array.isArray(e)){let r=e.indexOf(t);r>=0&&e.splice(r,1)}else e.delete(t);return t}function Ree(e){return Array.isArray(e)?e:[e]}function Frl(e){return e.replace(/[\s-]+(.)/g,(t,r)=>r.toUpperCase())}function _rt(e){return Ree(e).map(t=>t instanceof String?t:String(t))}function vy(e,t=0){if(e==null)return t;let r=parseInt(e,10);return Number.isNaN(r)?t:r}function u3t(e,t){let r=[];for(let n=0,i=e.length;n<i;n++)r.push(t,e[n]);return r}function p3t(e){return(Array.isArray(e)?Buffer.concat(e):e).toString("utf-8")}function Nrl(e,t){let r={};return t.forEach(n=>{e[n]!==void 0&&(r[n]=e[n])}),r}function Fwo(e=0){return new Promise(t=>setTimeout(t,e))}function Nwo(e){if(e!==!1)return e}function DD(e,t,r){return t(e)?e:arguments.length>2?r:void 0}function jwo(e,t){let r=UV(e)?"string":typeof e;return/number|string|boolean/.test(r)&&(!t||!t.includes(r))}function SQr(e){return!!e&&m3t(e)==="[object Object]"}function jrl(e){return typeof e=="function"}function _6d(){throw new Error("LineParser:useMatches not implemented")}function Mrl(...e){let t=process.cwd(),r=Object.assign({baseDir:t,...Lrl},...e.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||t,r.trimmed=r.trimmed===!0,r}function e1o(e,t=[]){return SQr(e)?Object.keys(e).reduce((r,n)=>{let i=e[n];if(UV(i))r.push(i);else if(jwo(i,["boolean"]))r.push(n+"="+i);else if(Array.isArray(i))for(let o of i)jwo(o,["string","number"])||r.push(n+"="+o);else r.push(n);return r},t):t}function VF(e,t=0,r=!1){let n=[];for(let i=0,o=t<0?e.length:t;i<o;i++)"string|number".includes(typeof e[i])&&n.push(String(e[i]));return e1o(t1o(e),n),r||n.push(...G6d(e)),n}function G6d(e){let t=typeof Q6e(e)=="function";return _rt(DD(Q6e(e,t?1:0),h3t,[]))}function t1o(e){let t=jrl(Q6e(e));return DD(Q6e(e,t?1:0),SQr)}function OE(e,t=!0){let r=Orl(Q6e(e));return t||Prl(r)?r:void 0}function Qwo(e,t){return e(t.stdOut,t.stdErr)}function Uz(e,t,r,n=!0){return Ree(r).forEach(i=>{for(let o=d3t(i,n),s=0,a=o.length;s<a;s++){let c=(l=0)=>{if(!(s+l>=a))return o[s+l]};t.some(({parse:l})=>l(c,e))}}),e}function H6d(e){switch(e){case"bare":return Grl();case"root":return Vrl()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:TQr,parser:r1o}}function Vrl(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:TQr,parser(t){return/^\.(git)?$/.test(t.trim())}}}function Grl(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:TQr,parser:r1o}}function K6d(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}function J6d(e,t){let r=new Wrl(e),n=e?Krl:Hrl;return d3t(t).forEach(i=>{let o=i.replace(n,"");r.paths.push(o),(Jrl.test(o)?r.folders:r.files).push(o)}),r}function Yrl(e){return{commands:OQr,format:"empty",parser:e}}function _z(e){return{commands:OQr,format:"empty",parser(){throw typeof e=="string"?new wrl(e):e}}}function GF(e,t=!1){return{commands:e,format:"utf-8",parser(r){return t?String(r).trim():r}}}function Xrl(e){return{commands:e,format:"buffer",parser(t){return t}}}function Zrl(e){return e.format==="buffer"}function $rl(e){return e.format==="empty"||!e.commands.length}function X6d(e,t){let{cleanMode:r,options:n,valid:i}=$6d(e);return r?i.options?(n.push(...t),n.some(r3d)?_z(n1o):tnl(r,n)):_z(o1o+JSON.stringify(e)):_z(i1o)}function tnl(e,t){return{commands:["clean",`-${e}`,...t],format:"utf-8",parser(n){return J6d(e==="n",n)}}}function Z6d(e){return Array.isArray(e)&&e.every(t=>s1o.has(t))}function $6d(e){let t,r=[],n={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,"").split("").forEach(i=>{e3d(i)?(t=i,n.cleanMode=!0):n.options=n.options&&t3d(r[r.length]=`-${i}`)}),{cleanMode:t,options:r,valid:n}}function e3d(e){return e==="f"||e==="n"}function t3d(e){return/^-[a-z]$/i.test(e)&&s1o.has(e.charAt(1))}function r3d(e){return/^-[^\-]/.test(e)?e.indexOf("i")>0:e==="--interactive"}function n3d(e){let t=new inl;for(let r of nnl(e))t.addValue(r.file,String(r.key),r.value);return t}function i3d(e,t){let r=null,n=[],i=new Map;for(let o of nnl(e,t))o.key===t&&(n.push(r=o.value),i.has(o.file)||i.set(o.file,[]),i.get(o.file).push(r));return{key:t,paths:Array.from(i.keys()),scopes:i,value:r,values:n}}function o3d(e){return e.replace(/^(file):/,"")}function*nnl(e,t=null){let r=e.split("\0");for(let n=0,i=r.length-1;n<i;){let o=o3d(r[n++]),s=r[n++],a=t;if(s.includes(`
|
|
244
244
|
`)){let c=Brl(s,`
|
|
@@ -1662,7 +1662,8 @@ like "en", "es", "ja" are accepted, as well as regional variants such as
|
|
|
1662
1662
|
grammar.`},"docs.TranslationConfigObject":{type:"object",properties:{lang:{$ref:"#/definitions/docs.Language"},default:{oneOf:[{type:"boolean"},{type:"null"}],description:"Whether this language is the default. At most one entry should be marked as default."}},required:["lang"],additionalProperties:!1},"docs.TranslationConfig":{anyOf:[{$ref:"#/definitions/docs.Language"},{$ref:"#/definitions/docs.TranslationConfigObject"}],description:"Translation configuration can be either a language code string or an object with additional options.\nWhen using a string, it's equivalent to `{ lang: <string> }`."},"docs.AIChatModel":{type:"string",enum:["claude-3.7","claude-4","command-a"]},"docs.AIChatLocation":{type:"string",enum:["docs","slack","discord"]},"docs.AIChatWebsiteDatasource":{type:"object",properties:{url:{type:"string",description:"The URL of the website to index. Ask Fern will crawl and index the content from this URL."},title:{oneOf:[{type:"string"},{type:"null"}],description:"An optional display name for this datasource. This helps users understand where the information is coming from when Ask Fern cites content from this source."}},required:["url"],additionalProperties:!1},"docs.AIChatDatasource":{anyOf:[{$ref:"#/definitions/docs.AIChatWebsiteDatasource"}]},"docs.AIChatConfig":{type:"object",properties:{model:{oneOf:[{$ref:"#/definitions/docs.AIChatModel"},{type:"null"}]},"system-prompt":{oneOf:[{type:"string"},{type:"null"}],description:`By default, Ask Fern uses system prompts to finetune AI search results. Add a custom prompt here to override it.
|
|
1663
1663
|
See Anthropic's prompting guide for ideas and examples.`},location:{oneOf:[{type:"array",items:{$ref:"#/definitions/docs.AIChatLocation"}},{type:"null"}],description:"Specifies where Ask Fern will be available. Options:\n- `docs` enables Ask Fern on your documentation site\n- `slack` enables Ask Fern in Slack\n- `discord` enables Ask Fern in Discord\n\nMost users should enable Ask Fern for both `docs` and either `slack` or `discord`."},datasources:{oneOf:[{type:"array",items:{$ref:"#/definitions/docs.AIChatDatasource"}},{type:"null"}],description:"Additional content sources that Ask Fern should index and search."},"mask-pii":{oneOf:[{type:"boolean"},{type:"null"}],description:`When enabled, personally identifiable information (PII) in user messages is masked before
|
|
1664
1664
|
being sent to Ask Fern. Disabled by default.`},disclaimer:{oneOf:[{type:"string"},{type:"null"}],description:`Overrides the disclaimer shown in the Ask Fern chat
|
|
1665
|
-
(default: "Responses are generated using AI and may contain mistakes.").`}
|
|
1665
|
+
(default: "Responses are generated using AI and may contain mistakes.").`},"button-text":{oneOf:[{type:"string"},{type:"null"}],description:`Overrides the "Ask AI" label on the header button and in the search dialog
|
|
1666
|
+
(default: "Ask AI", translated on localized sites).`}},additionalProperties:!1},"docs.AiExamplesConfig":{type:"object",properties:{enabled:{oneOf:[{type:"boolean"},{type:"null"}],description:"Enable AI-powered example enhancement for API documentation. When enabled, API examples will be enhanced with AI-generated content to provide more comprehensive and realistic examples."},style:{oneOf:[{type:"string"},{type:"null"}],description:"Custom styling instructions for AI-generated examples. When provided, these instructions will guide the AI in generating examples that match your preferred style, naming conventions, or domain-specific terminology. Limited to 500 characters."}},additionalProperties:!1},"docs.PageDescriptionSource":{type:"string",enum:["description","subtitle"]},"docs.AgentsConfig":{type:"object",properties:{"page-directive":{oneOf:[{type:"string"},{type:"null"}],description:"Text to prepend to each page when it is served through agent endpoints."},"page-description-source":{oneOf:[{$ref:"#/definitions/docs.PageDescriptionSource"},{type:"null"}],description:`Controls which frontmatter field is preferred for one-line page descriptions
|
|
1666
1667
|
in llms.txt. Defaults to "description". If the preferred field is not present
|
|
1667
1668
|
in a page's frontmatter, falls back to other fields (description, subtitle,
|
|
1668
1669
|
og:description, headline, excerpt).`},"llms-txt":{oneOf:[{type:"string"},{type:"null"}],description:"Relative filepath to a custom `llms.txt` file that Fern should host at `/llms.txt`,\noverriding the auto-generated version. The file should follow the llmstxt.org specification."},"llms-full-txt":{oneOf:[{type:"string"},{type:"null"}],description:"Relative filepath to a custom `llms-full.txt` file that Fern should host at `/llms-full.txt`,\noverriding the auto-generated version. The file should contain the full concatenated documentation content."},"robots-txt":{oneOf:[{type:"string"},{type:"null"}],description:"Relative filepath to a custom `robots.txt` file that Fern should host at `/robots.txt`,\noverriding the auto-generated version. Fern automatically appends a rule to disallow\nits internal `/api/fern-docs/` routes so they are excluded from crawler indexing."}},additionalProperties:!1},"docs.TwitterCardSetting":{type:"string",enum:["summary","summary_large_image","app","player"]},"docs.OgDynamicLogoColor":{type:"string",enum:["dark","light"]},"docs.MetadataConfig":{type:"object",properties:{"og:site_name":{oneOf:[{type:"string"},{type:"null"}],description:"The name of your website for Open Graph tags."},"og:title":{oneOf:[{type:"string"},{type:"null"}],description:"The title shown in social media previews."},"og:description":{oneOf:[{type:"string"},{type:"null"}],description:"The description shown in social media previews."},"og:url":{oneOf:[{type:"string"},{type:"null"}],description:"The canonical URL of your documentation."},"og:image":{oneOf:[{type:"string"},{type:"null"}],description:"The image shown in social media previews. Recommended size is 1200x630 pixels."},"og:image:width":{oneOf:[{type:"number"},{type:"null"}],description:"The width of your Open Graph image in pixels."},"og:image:height":{oneOf:[{type:"number"},{type:"null"}],description:"The height of your Open Graph image in pixels."},"og:locale":{oneOf:[{type:"string"},{type:"null"}],description:'The locale of your content (e.g., "en_US").'},"og:logo":{oneOf:[{type:"string"},{type:"null"}],description:"URL to your company logo."},"twitter:title":{oneOf:[{type:"string"},{type:"null"}],description:"The title shown in Twitter Card previews."},"twitter:description":{oneOf:[{type:"string"},{type:"null"}],description:"The description shown in Twitter Card previews."},"twitter:handle":{oneOf:[{type:"string"},{type:"null"}],description:"Your company's Twitter handle."},"twitter:image":{oneOf:[{type:"string"},{type:"null"}],description:"The image shown in Twitter Card previews."},"twitter:site":{oneOf:[{type:"string"},{type:"null"}],description:"The Twitter handle for your website."},"twitter:url":{oneOf:[{type:"string"},{type:"null"}]},"twitter:card":{oneOf:[{$ref:"#/definitions/docs.TwitterCardSetting"},{type:"null"}],description:"The Twitter Card type. Options are `summary`, `summary_large_image`, `app`, or `player`."},"og:dynamic":{oneOf:[{type:"boolean"},{type:"null"}],description:"When true, enables dynamic OG image generation for pages that don't have a custom og:image set."},"og:dynamic:background-image":{oneOf:[{type:"string"},{type:"null"}],description:"A custom background image for dynamically generated OG images. Can be a URL or a file path."},"og:dynamic:text-color":{oneOf:[{type:"string"},{type:"null"}],description:'Override the text color for dynamically generated OG images. Accepts any valid CSS color value (e.g., "#1a1a1a").'},"og:dynamic:background-color":{oneOf:[{type:"string"},{type:"null"}],description:'Override the background color for dynamically generated OG images. Accepts any valid CSS color value (e.g., "#ffffff").'},"og:dynamic:logo-color":{oneOf:[{$ref:"#/definitions/docs.OgDynamicLogoColor"},{type:"null"}],description:"Choose which logo variant from docs.yml to render in dynamically generated OG images. Defaults to `dark`."},"og:dynamic:show-logo":{oneOf:[{type:"boolean"},{type:"null"}],description:"Toggle visibility of the logo in dynamically generated OG images. Defaults to true when og:dynamic is enabled."},"og:dynamic:show-section":{oneOf:[{type:"boolean"},{type:"null"}],description:"Toggle visibility of the section title in dynamically generated OG images. Defaults to true when og:dynamic is enabled."},"og:dynamic:show-description":{oneOf:[{type:"boolean"},{type:"null"}],description:"Toggle visibility of the page description in dynamically generated OG images. Defaults to true when og:dynamic is enabled."},"og:dynamic:show-url":{oneOf:[{type:"boolean"},{type:"null"}],description:"Toggle visibility of the page URL in dynamically generated OG images. Defaults to true when og:dynamic is enabled."},"og:dynamic:show-gradient":{oneOf:[{type:"boolean"},{type:"null"}],description:"Toggle visibility of the accent gradient overlay in dynamically generated OG images. Defaults to true when og:dynamic is enabled."},"canonical-host":{oneOf:[{type:"string"},{type:"null"}],description:"The host of your documentation website. This will be used to set the canonical URL for metadata tags and documents like the sitemap.\nDefaults to the URL defined in the `instances` configuration."}},additionalProperties:!1,description:"The `metadata` object allows you to customize the appearance of your docs site in search engines and social media.\nThese settings are applied globally, but can be overridden on a per-page basis using frontmatter."},"docs.RedirectConfig":{type:"object",properties:{source:{type:"string",description:"The path you want to redirect from."},destination:{type:"string",description:"The path you want to route to. Can be an internal path (`/new-path`) or an external URL (`https://example.com`).\nExternal URLs must include the full address, including `https`."},permanent:{oneOf:[{type:"boolean"},{type:"null"}],description:"By default, uses the 308 status code to instructs clients and search engines to cache the redirect forever. Set to `false` only if you need a temporary redirect using the 307 status code, which won't be cached.\n\n@default: true"}},required:["source","destination"],additionalProperties:!1,description:'The `redirects` object allows you to redirect traffic from one path to another. You can redirect exact paths or use dynamic patterns with regex parameters like `:slug` to handle bulk redirects. You can redirect to internal paths within your site or external URLs.\n\n```yaml\nredirects:\n - source: "/old-path"\n destination: "/new-path"\n```\n\nBoth source and destination paths support regex. See https://github.com/pillarjs/path-to-regexp'},"docs.RedirectsConfiguration":{anyOf:[{type:"array",items:{$ref:"#/definitions/docs.RedirectConfig"}},{type:"string"},{type:"array",items:{type:"string"}}],description:"Either an inline list of redirects, or one or more filepaths to YAML files containing\nonly a list of redirects.\n\n```yaml\nredirects: ./redirects.yml\n```\n\n```yaml\nredirects:\n - ./redirects/a.yml\n - ./redirects/b.yml\n```"},"docs.CheckRuleSeverity":{type:"string",enum:["warn","error"]},"docs.CheckRulesConfig":{type:"object",properties:{"example-validation":{oneOf:[{$ref:"#/definitions/docs.CheckRuleSeverity"},{type:"null"}],description:"Severity for OpenAPI example validation. Default is warn."},"broken-links":{oneOf:[{$ref:"#/definitions/docs.CheckRuleSeverity"},{type:"null"}],description:"Severity for broken link detection. Defaults to error for broken internal links and warn for malformed URLs."},"no-non-component-refs":{oneOf:[{$ref:"#/definitions/docs.CheckRuleSeverity"},{type:"null"}],description:"Severity for non-component OpenAPI reference validation. Default is error."},"valid-local-references":{oneOf:[{$ref:"#/definitions/docs.CheckRuleSeverity"},{type:"null"}],description:"Severity for local OpenAPI reference validation. Default is warn."},"no-circular-redirects":{oneOf:[{$ref:"#/definitions/docs.CheckRuleSeverity"},{type:"null"}],description:"Severity for circular redirect validation. Default is error."},"valid-docs-endpoints":{oneOf:[{$ref:"#/definitions/docs.CheckRuleSeverity"},{type:"null"}],description:"Severity for docs endpoint URL validation. Default is warn."},"missing-redirects":{oneOf:[{$ref:"#/definitions/docs.CheckRuleSeverity"},{type:"null"}],description:"Severity for detecting previously published URLs that disappeared without an explicit redirect. Default is warn."},"valid-changelog-slug":{oneOf:[{$ref:"#/definitions/docs.CheckRuleSeverity"},{type:"null"}],description:"Severity for validating that each changelog's effective URL slug is one of the allowlisted values served as an RSS/Atom/JSON feed. Default is error."}},additionalProperties:!1},"docs.CheckConfig":{type:"object",properties:{rules:{oneOf:[{$ref:"#/definitions/docs.CheckRulesConfig"},{type:"null"}]}},additionalProperties:!1,description:"Configure the severity of validation rules run by `fern check`.\nEach rule can be set to `warn` (non-blocking) or `error` (blocking)."},"docs.LogoConfiguration":{type:"object",properties:{dark:{oneOf:[{type:"string"},{type:"null"}],description:"Path to your dark mode logo file, relative to the docs root. SVG format is recommended for optimal quality.\nExample: `assets/images/logo-dark.svg`"},light:{oneOf:[{type:"string"},{type:"null"}],description:"Path to your light mode logo file, relative to the docs root. SVG format is recommended for optimal quality.\nExample: `assets/images/logo-light.svg`"},height:{oneOf:[{type:"number"},{type:"null"}]},href:{oneOf:[{type:"string"},{type:"null"}],description:"The URL that users will be directed to when clicking the logo. Typically your company's homepage or app."},"right-text":{oneOf:[{type:"string"},{type:"null"}],description:"Text to display to the right of the logo image. This is useful for adding a tagline or product name next to your logo.\nExample: `Docs`"}},additionalProperties:!1},"docs.BackgroundImageThemedConfig":{type:"object",properties:{dark:{oneOf:[{type:"string"},{type:"null"}],description:"Relative filepath to the dark-mode background image."},light:{oneOf:[{type:"string"},{type:"null"}],description:"Relative filepath to the light-mode background image."}},additionalProperties:!1},"docs.BackgroundImageConfiguration":{anyOf:[{type:"string"},{$ref:"#/definitions/docs.BackgroundImageThemedConfig"}],description:"This background image is used to customize the appearance of your docs site."},"docs.ColorThemedConfig":{type:"object",properties:{dark:{oneOf:[{type:"string"},{type:"null"}]},light:{oneOf:[{type:"string"},{type:"null"}]}},additionalProperties:!1},"docs.ColorConfig":{anyOf:[{type:"string"},{$ref:"#/definitions/docs.ColorThemedConfig"}]},"docs.ColorsConfiguration":{type:"object",properties:{"accent-primary":{oneOf:[{$ref:"#/definitions/docs.ColorConfig"},{type:"null"}],description:`The primary brand color used for interactive elements like links, buttons, and highlighted text.
|
|
@@ -1839,7 +1840,7 @@ ${n.map(o=>` ${o}`).join(`,
|
|
|
1839
1840
|
`)}
|
|
1840
1841
|
]`;case 1:return`${i} Did you mean ${r[0]}?`;case 2:return`${i} Did you mean ${r[0]} or ${r[1]}?`;default:return`${i} Did you mean ${r[0]}, ${r[1]}, or ${r[2]}?`}}function Mci(e){return`API section ${e} is specified multiple times, however will be only rendered once.`}function SLh(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}var CLh,xLh,_1u=h(()=>{"use strict";L1u();CLh=3,xLh=5});function Lci({children:e,findEndpointById:t,stringifyEndpointPathParts:r,disableEndpointPairs:n,apiDefinitionId:i}){if(n)return e;let o=[],s=new Map;return e.forEach(a=>{if(a.type!=="endpoint"){o.push(a);return}let c=t(a.endpointId);if(c==null)throw new w({message:`Endpoint ${a.endpointId} not found`,code:w.Code.InternalError});let l=`${c.method} ${r(c)}`,u=s.get(l);if(s.set(l,a),u==null||u.isResponseStream===a.isResponseStream){o.push(a);return}let p=o.indexOf(u),d=a.isResponseStream?a:u,f=a.isResponseStream?u:a,m={id:Gt.V1.NodeId(`${i}:${f.endpointId}+${d.endpointId}`),type:"endpointPair",collapsed:void 0,stream:d,nonStream:f};o[p]=m}),o}var Dls=h(()=>{"use strict";Mm();Dt()});function U1u({left:e,right:t,findEndpointById:r,stringifyEndpointPathParts:n,disableEndpointPairs:i,apiDefinitionId:o}){return Lci({children:[...e,...t],findEndpointById:r,stringifyEndpointPathParts:n,disableEndpointPairs:i,apiDefinitionId:o}).filter(s=>s.type==="apiPackage"?s.children.length>0||s.overviewPageId!=null:!0)}var V1u=h(()=>{"use strict";Dls()});function G1u(e){if(e!=null)switch(e){case"unset":return;case"stable":case"generally-available":return"generally-available";case"in-development":case"pre-release":case"beta":return"beta";case"alpha":case"preview":case"legacy":case"deprecated":return e;default:return rt(e)}}function TLh(e){switch(e.type){case"endpointPair":return e.nonStream.availability;case"apiPackage":case"endpoint":case"webSocket":case"webhook":case"grpc":case"graphql":case"graphqlType":case"page":return e.availability;case"link":return;default:return rt(e)}}function q1u(e,t){let r=[];for(let o of t){let s=G1u(o);r.includes(s)||r.push(s)}for(let o of wLh)r.includes(o)||r.push(o);let n=new Map(r.map((o,s)=>[o,s])),i=o=>n.get(G1u(TLh(o)))??r.length;return[...e].sort((o,s)=>i(o)-i(s))}var wLh,W1u=h(()=>{"use strict";It();wLh=[void 0,"generally-available","alpha","beta","preview","legacy","deprecated"]});function Mvt(e,t){if(t!=null)return mo(e.absoluteFilePath,t)}var Rls=h(()=>{"use strict";tr()});function H1u({docsWorkspace:e,page:t,parentSlug:r,idgen:n,markdownFilesToFullSlugs:i,markdownFilesToNoIndex:o,hideChildren:s,resolveIconFileId:a}){let c=Gt.V1.PageId(Mvt(e,t.absolutePath)),l=r.apply({fullSlug:i.get(t.absolutePath)?.split("/"),urlSlug:t.slug??op(t.title)});return{id:n.get(c),type:"page",collapsed:void 0,pageId:c,title:t.title,slug:l.get(),icon:a?a(t.icon):t.icon,hidden:s||t.hidden,noindex:t.noindex||o.get(t.absolutePath),authed:void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags,availability:Gg(t.availability)}}var K1u=h(()=>{"use strict";Mm();Io();zci();Rls()});function kls(e){return e.fieldPath}function J1u(e){return e.name??e.id}var Y1u,OLh,PLh,BLh,wHt,X1u=h(()=>{"use strict";It();Mm();tr();Dt();Io();Y1u=Ae(Of(),1);x1u();Ols();zci();P1u();B1u();_1u();xls();V1u();Dls();W1u();Sls();K1u();Rls();OLh=[{category:"object",title:"Objects",urlSlug:"objects"},{category:"input",title:"Inputs",urlSlug:"inputs"},{category:"enum",title:"Enums",urlSlug:"enums"},{category:"scalar",title:"Scalars",urlSlug:"scalars"},{category:"interface",title:"Interfaces",urlSlug:"interfaces"},{category:"union",title:"Unions",urlSlug:"unions"}],PLh="types",BLh="Types",wHt=class{apiSection;docsWorkspace;taskContext;markdownFilesToFullSlugs;markdownFilesToNoIndex;markdownFilesToTags;workspace;hideChildren;parentAvailability;openApiTags;apiDefinitionId;#e;#t=new Set;#r=new Set;#n=new Set;#i=new Set;#o=new Set;#s=new Set;#a=new Map;#c=[];#l;#d;#p;disableEndpointPairs;collectedFileIds=new Map;#f;#u;#m;constructor(t,r,n,i,o,s,a,c,l,u,p,d,f,m,g,A){this.apiSection=t,this.docsWorkspace=i,this.taskContext=o,this.markdownFilesToFullSlugs=s,this.markdownFilesToNoIndex=a,this.markdownFilesToTags=c,this.workspace=p,this.hideChildren=d,this.parentAvailability=f,this.openApiTags=m,this.#f=new Map,this.#u=g??new Map,this.#m=A??{},this.disableEndpointPairs=i.config.experimental?.disableStreamToggle??!1,this.apiDefinitionId=Gt.V1.ApiDefinitionId(r.id),this.#e=kRe.create(r,o),this.collectedFileIds=u,this.#p=l,this.#l=this.apiSection.overviewAbsolutePath!=null?Gt.V1.PageId(Mvt(this.docsWorkspace,this.apiSection.overviewAbsolutePath)):void 0;let y=this.apiSection.overviewAbsolutePath!=null?this.markdownFilesToFullSlugs.get(this.apiSection.overviewAbsolutePath):void 0;this.#d=n.apply({fullSlug:y?.split("/"),skipUrlSlug:this.apiSection.skipUrlSlug,urlSlug:this.apiSection.slug??op(this.apiSection.title)});let I=this.apiSection.availability??this.parentAvailability;this.apiSection.navigation!=null&&(this.#c=this.#h(this.apiSection.navigation,this.#e.api.rootPackage,this.#d,I)),this.#c=this.#v(this.#c.map(C=>this.#x(C,I)),this.#w(this.#e.api.rootPackage,this.#d,I))}get(){let t=Gt.V1.followRedirects(this.#c),r=new ZVe(this.markdownFilesToFullSlugs,this.markdownFilesToNoIndex,this.markdownFilesToTags,this.workspace?.changelog?.files.map(i=>i.absoluteFilepath),this.docsWorkspace,this.#p).orUndefined(),n=this.#l;if(n==null&&!this.apiSection.tagDescriptionPages){let i=this.#c.find(o=>o.type==="apiPackage"&&o.overviewPageId!=null);i!=null&&(n=i.overviewPageId)}return{id:this.#p.get(this.apiDefinitionId),type:"apiReference",title:this.apiSection.title,apiDefinitionId:this.apiDefinitionId,overviewPageId:n,collapsed:this.apiSection.collapsed,collapsible:void 0,collapsedByDefault:void 0,paginated:this.apiSection.paginated,slug:this.#d.get(),icon:this.resolveIconFileId(this.apiSection.icon),hidden:this.hideChildren||this.apiSection.hidden,hideTitle:this.apiSection.flattened,showErrors:this.apiSection.showErrors,changelog:r?.toChangelogNode({parentSlug:this.#d,viewers:void 0,hidden:this.hideChildren}),children:this.#c,availability:Gg(this.apiSection.availability??this.parentAvailability),pointsTo:t,noindex:void 0,playground:this.#T(this.apiSection.playground),postmanCollectionUrl:this.apiSection.postman,authed:void 0,viewers:this.apiSection.viewers,orphaned:this.apiSection.orphaned,featureFlags:this.apiSection.featureFlags}}getTagDescriptionContent(){return this.#f}createTagDescriptionPageId(t,r){if(!this.apiSection.tagDescriptionPages||!this.openApiTags)return;let n=gJ(t)?t.name:void 0;if(!n)return;let i=this.openApiTags[n]??(r!=null?this.openApiTags[oo(r)]:void 0);if(!i||!i.description)return;let o=`tag-${n}.md`,s=Zt.of(`/${o}`),a=Gt.V1.PageId(o),c=`# ${WO(i.id.replace(/[_-]/g," "))}
|
|
1841
1842
|
|
|
1842
|
-
${i.description}`;return this.#f.set(s,c),this.markdownFilesToNoIndex.set(s,!1),this.markdownFilesToTags.set(s,[n]),a}#h(t,r,n,i){r=this.#e.resolveSubpackage(r);let o=r!=null?kRe.getSubpackageId(r):void 0;return t.map(s=>YY(s)._visit({link:a=>({id:this.#p.get(a.url),type:"link",collapsed:void 0,title:a.text,icon:this.resolveIconFileId(a.icon),url:Gt.Url(a.url),target:a.target}),page:a=>this.#g(a,n,i),package:a=>this.#E(a,n,i),section:a=>this.#b(a,n,i),item:({value:a})=>this.#C(a,o,n,i),endpoint:a=>this.#I(a,o,n,i),operation:a=>this.#y(a,o,n,i)})).filter(ea)}#g(t,r,n){return H1u({page:{...t,availability:t.availability??n},parentSlug:r,docsWorkspace:this.docsWorkspace,markdownFilesToFullSlugs:this.markdownFilesToFullSlugs,markdownFilesToNoIndex:this.markdownFilesToNoIndex,idgen:this.#p,hideChildren:this.hideChildren,resolveIconFileId:this.resolveIconFileId.bind(this)})}#E(t,r,n){let i=t.overviewAbsolutePath!=null?Gt.V1.PageId(Mvt(this.docsWorkspace,t.overviewAbsolutePath)):void 0,o=t.overviewAbsolutePath!=null?this.markdownFilesToFullSlugs.get(t.overviewAbsolutePath):void 0,s=t.availability??n,a=this.#e.getSubpackageByIdOrLocator(t.package);if(a!=null){let c=kRe.getSubpackageId(a),l=i??this.createTagDescriptionPageId(a,t.package),u=this.#p.get(l??`${this.apiDefinitionId}:${c}`);this.#s.has(c)&&this.taskContext.logger.warn(Mci(t.package)),this.#s.add(c),this.#a.set(u,[c]);let p=t.slug??(gJ(a)?a.urlSlug:this.apiSection.slug??op(this.apiSection.title)),d=r.apply({fullSlug:o?.split("/"),skipUrlSlug:t.skipUrlSlug,urlSlug:p}),f=this.#h(t.contents,a,d,s);return{id:u,type:"apiPackage",collapsed:void 0,children:f,title:t.title??(gJ(a)?a.displayName??WO(a.name):this.apiSection.title),slug:d.get(),icon:this.resolveIconFileId(t.icon),hidden:this.hideChildren||t.hidden,overviewPageId:l,collapsible:void 0,collapsedByDefault:void 0,availability:Gg(s),apiDefinitionId:this.apiDefinitionId,pointsTo:void 0,noindex:void 0,playground:this.#T(t.playground),authed:void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}}else{this.taskContext.logger.warn(Qci(t.package,this.#e.subpackageLocators));let c=t.slug??op(t.package),l=r.apply({fullSlug:o?.split("/"),skipUrlSlug:t.skipUrlSlug,urlSlug:c}),u=this.#h(t.contents,void 0,l,s);return{id:this.#p.get(i??`${this.apiDefinitionId}:${op(t.package)}`),type:"apiPackage",collapsed:void 0,children:u,title:t.title??t.package,slug:l.get(),icon:this.resolveIconFileId(t.icon),hidden:this.hideChildren||t.hidden,overviewPageId:i,collapsible:void 0,collapsedByDefault:void 0,availability:Gg(s),apiDefinitionId:this.apiDefinitionId,pointsTo:void 0,noindex:void 0,playground:this.#T(t.playground),authed:void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}}}#b(t,r,n){let i=t.overviewAbsolutePath!=null?Gt.V1.PageId(Mvt(this.docsWorkspace,t.overviewAbsolutePath)):void 0,o=t.overviewAbsolutePath!=null?this.markdownFilesToFullSlugs.get(t.overviewAbsolutePath):void 0,s=t.overviewAbsolutePath!=null?this.markdownFilesToNoIndex.get(t.overviewAbsolutePath):void 0,a=this.#p.get(i??o??r.get()),c=t.referencedSubpackages.map(f=>{let m=this.#e.getSubpackageByIdOrLocator(f),g=m!=null?kRe.getSubpackageId(m):void 0;if(g===void 0){this.taskContext.logger.error(Qci(f,this.#e.subpackageLocators));return}return{subpackageId:g,locator:f}}).filter(f=>f!=null).filter(ea);this.#a.set(a,c.map(f=>f.subpackageId)),c.forEach(f=>{this.#s.has(f.subpackageId)&&this.taskContext.logger.error(Mci(f.locator)),this.#s.add(f.subpackageId)});let l=t.slug??op(t.title),u=r.apply({fullSlug:o?.split("/"),skipUrlSlug:t.skipUrlSlug,urlSlug:l}),p=t.availability??n,d=this.#h(t.contents,void 0,u,p);return{id:a,type:"apiPackage",children:d,title:t.title,slug:u.get(),icon:this.resolveIconFileId(t.icon),hidden:this.hideChildren||t.hidden,overviewPageId:i,collapsed:t.collapsed,collapsible:t.collapsible,collapsedByDefault:t.collapsedByDefault,availability:Gg(p),apiDefinitionId:this.apiDefinitionId,pointsTo:void 0,noindex:s,playground:this.#T(t.playground),authed:void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}}#C(t,r,n,i){t=t.trim();let o=this.#e.getSubpackageByIdOrLocator(t)??this.#e.getSubpackageByIdOrLocator(oo(t));if(o!=null){let s=kRe.getSubpackageId(o),a=this.#p.get(`${this.apiDefinitionId}:${s}`);this.#s.has(s)&&this.taskContext.logger.error(Mci(t)),this.#s.add(s),this.#a.set(a,[s]);let c=gJ(o)?o.urlSlug:"",l=n.apply({urlSlug:c});return{id:a,type:"apiPackage",collapsed:void 0,children:[],title:gJ(o)?o.displayName??WO(o.name):this.apiSection.title,slug:l.get(),icon:void 0,hidden:this.hideChildren,overviewPageId:this.createTagDescriptionPageId(o,t),collapsible:void 0,collapsedByDefault:void 0,availability:Gg(i),apiDefinitionId:this.apiDefinitionId,pointsTo:void 0,noindex:void 0,playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}}return this.#I({type:"endpoint",endpoint:t,title:void 0,icon:void 0,slug:void 0,hidden:void 0,availability:void 0,playground:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0},r,n,i)}#I(t,r,n,i){let o=(r!=null?this.#e.subpackages.get(Tb.SubpackageId(r))?.endpoints.get(Tb.EndpointId(t.endpoint)):void 0)??this.#e.endpointsByLocator.get(t.endpoint);if(o!=null){let l=this.#e.getEndpointId(o);if(l==null)this.taskContext.logger.debug(`Expected Endpoint ID for ${o.id} at path: ${jci(o.method,o.path.parts)}. Got undefined.`);else{this.#t.has(l)&&this.taskContext.logger.error(`Duplicate endpoint found in the API Reference layout: ${l}`),this.#t.add(l);let u=t.slug!=null?n.append(t.slug):n.apply(o);return{id:this.#p.get(`${this.apiDefinitionId}:${l}`),type:"endpoint",collapsed:void 0,method:o.method,endpointId:l,apiDefinitionId:this.apiDefinitionId,availability:Gg(t.availability)??Gt.V1.convertAvailability(o.availability)??Gg(i),isResponseStream:o.response?.type.type==="stream",title:t.title??o.name??xk(o.path.parts),slug:u.get(),icon:this.resolveIconFileId(t.icon),hidden:this.hideChildren||t.hidden,playground:this.#T(o.includeInApiExplorer===!1?{...t.playground,hidden:!0}:t.playground),authed:void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}}}let s=(r!=null?this.#e.subpackages.get(Tb.SubpackageId(r))?.webSockets.get(Tb.WebSocketId(t.endpoint)):void 0)??this.#e.webSocketsByLocator.get(t.endpoint);if(s!=null){let l=this.#e.getWebSocketId(s);if(l==null)this.taskContext.logger.error(`Expected WebSocket ID for ${s.id}. Got undefined.`);else return this.#r.has(l)&&this.taskContext.logger.error(`Duplicate web socket found in the API Reference layout: ${l}`),this.#r.add(l),{id:this.#p.get(`${this.apiDefinitionId}:${l}`),type:"webSocket",collapsed:void 0,webSocketId:l,title:t.title??s.name??xk(s.path.parts),slug:(t.slug!=null?n.append(t.slug):n.apply(s)).get(),icon:this.resolveIconFileId(t.icon),hidden:this.hideChildren||t.hidden,apiDefinitionId:this.apiDefinitionId,availability:Gg(t.availability)??Gt.V1.convertAvailability(s.availability)??Gg(i),playground:this.#T(t.playground),authed:void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}}let a=(r!=null?this.#e.subpackages.get(Tb.SubpackageId(r))?.webhooks.get(Tb.WebhookId(t.endpoint)):void 0)??this.#e.webhooks.get(Gt.V1.WebhookId(t.endpoint));if(a!=null){let l=this.#e.getWebhookId(a);if(l==null)this.taskContext.logger.error(`Expected Webhook ID for ${a.id}. Got undefined.`);else return this.#n.has(l)&&this.taskContext.logger.error(`Duplicate webhook found in the API Reference layout: ${l}`),this.#n.add(l),{id:this.#p.get(`${this.apiDefinitionId}:${l}`),type:"webhook",collapsed:void 0,webhookId:l,method:a.method,title:t.title??a.name??(0,Y1u.default)("/",...a.path),slug:(t.slug!=null?n.append(t.slug):n.apply(a)).get(),icon:this.resolveIconFileId(t.icon),hidden:this.hideChildren||t.hidden,apiDefinitionId:this.apiDefinitionId,availability:Gg(t.availability)??Gt.V1.convertAvailability(a.availability)??Gg(i),authed:void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}}let c=this.#e.api.rootPackage.graphqlOperations?.find(l=>l.id===t.endpoint||l.name===t.endpoint);if(c!=null){let l=Tb.GraphQlOperationId(c.id);if(this.#o.has(l)){this.taskContext.logger.error(`Duplicate GraphQL operation found in the API Reference layout: ${l}`);return}this.#o.add(l);let u=t.slug!=null?n.append(t.slug):n.append(c.name??c.id);return this.#S({id:this.#p.get(`${this.apiDefinitionId}:${l}`),operationType:c.operationType,graphqlOperationId:Tb.GraphQlOperationId(c.id),title:t.title??c.displayName??c.name??c.id,slug:u.get(),availability:t.availability??i,icon:this.resolveIconFileId(t.icon),hidden:this.hideChildren||t.hidden,playground:this.#T(t.playground),viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags})}this.taskContext.logger.error("Unknown identifier in the API Reference layout: ",t.endpoint)}#y(t,r,n,i){let o=t.operation.trim().split(/\s+/,2);if(o.length!==2){this.taskContext.logger.error(`Invalid operation format in the API Reference layout: ${t.operation}. Expected format: "OPERATION_TYPE operationName" (e.g., "QUERY account")`);return}let[s,a]=o;if(!a){this.taskContext.logger.error(`Invalid operation format in the API Reference layout: ${t.operation}. Expected format: "OPERATION_TYPE operationName" (e.g., "QUERY account")`);return}let c=this.#e.api.rootPackage.graphqlOperations??[],l=c.filter(f=>{if(f.operationType!==s)return!1;if(a.includes(".")){if(f.id===a||f.name===a)return!0;let m=a.split("."),g=m[m.length-1],A=m.slice(0,-1).join(".");if(f.name===g||f.id===g)return f.id.startsWith(A+".")||this.#u.get(sn.GraphQlOperationId(f.id))===A}else return f.name===a||f.id===a;return!1});if(!a.includes(".")){let f=c.filter(m=>m.operationType===s&&(m.name===a||m.id===a));if(f.length>1){let m=f.map(g=>{let A=this.#u.get(sn.GraphQlOperationId(g.id));if(A)return`"${s} ${A}.${a}"`;let y=g.id.split("_");if(y.length>=3){let I=y[0];return`"${s} ${I}.${a}"`}return`"${s} ${g.id}"`}).join(", ");this.taskContext.logger.warn(`Ambiguous operation reference: "${t.operation}". Found ${f.length} operations with name "${a}". Using first match: "${m.split(", ")[0]}". Please use the full namespaced format for clarity. Available options: ${m}`)}}let u=l[0];if(u==null){this.taskContext.logger.error(`GraphQL operation not found in the API Reference layout: ${t.operation}`);return}let p=Tb.GraphQlOperationId(u.id);if(this.#o.has(p)){this.taskContext.logger.error(`Duplicate GraphQL operation found in the API Reference layout: ${p}`);return}this.#o.add(p);let d=t.slug!=null?n.append(t.slug):n.append(u.name??u.id);return this.#S({id:this.#p.get(`${this.apiDefinitionId}:${p}`),operationType:u.operationType,graphqlOperationId:Tb.GraphQlOperationId(u.id),title:t.title??u.displayName??u.name??u.id,slug:d.get(),availability:t.availability??i,hidden:this.hideChildren||t.hidden,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags})}#v(t,r){return U1u({left:t,right:r,findEndpointById:n=>this.#e.endpoints.get(n),stringifyEndpointPathParts:n=>xk(n.path.parts),disableEndpointPairs:this.disableEndpointPairs,apiDefinitionId:this.apiDefinitionId})}#x(t,r){return Pls({child:t,nodeIdToSubpackageId:this.#a,convertApiDefinitionPackageId:(n,i,o)=>this.#N(n,i,o),mergeAndFilterChildren:this.#v.bind(this)})}#w(t,r,n){let i=[];if(t.endpoints.forEach(o=>{if(o.protocol?.type==="grpc"){let s=this.#e.getGrpcId(o);if(s==null){this.taskContext.logger.error(`Expected Grpc ID for ${o.id} at path: ${jci(o.method,o.path.parts)}. Got undefined.`);return}if(this.#i.has(s))return;let a=r.apply(o);i.push({id:Gt.V1.NodeId(`${this.apiDefinitionId}:${s}`),type:"grpc",collapsed:void 0,grpcId:s,title:o.name??xk(o.path.parts),method:o.protocol?.methodType??"UNARY",apiDefinitionId:this.apiDefinitionId,availability:Gg(n),slug:a.get(),icon:void 0,hidden:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0})}else{let s=this.#e.getEndpointId(o);if(s==null){this.taskContext.logger.debug(`Expected Endpoint ID for ${o.id} at path: ${jci(o.method,o.path.parts)}. Got undefined.`);return}if(this.#t.has(s))return;let a=r.apply(o);i.push({id:Gt.V1.NodeId(`${this.apiDefinitionId}:${s}`),type:"endpoint",collapsed:void 0,method:o.method,endpointId:s,apiDefinitionId:this.apiDefinitionId,availability:Gt.V1.convertAvailability(o.availability)??Gg(n),isResponseStream:o.response?.type.type==="stream",title:o.name??xk(o.path.parts),slug:a.get(),icon:void 0,hidden:this.hideChildren,playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0})}}),t.websockets.forEach(o=>{let s=this.#e.getWebSocketId(o);if(s==null){this.taskContext.logger.error(`Expected WebSocket ID for ${o.id}. Got undefined.`);return}this.#r.has(s)||i.push({id:Gt.V1.NodeId(`${this.apiDefinitionId}:${s}`),type:"webSocket",collapsed:void 0,webSocketId:s,title:o.name??xk(o.path.parts),slug:r.apply(o).get(),icon:void 0,hidden:this.hideChildren,apiDefinitionId:this.apiDefinitionId,availability:Gt.V1.convertAvailability(o.availability)??Gg(n),playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0})}),t.webhooks.forEach(o=>{let s=this.#e.getWebhookId(o);if(s==null){this.taskContext.logger.error(`Expected Webhook ID for ${o.id}. Got undefined.`);return}this.#n.has(s)||i.push({id:Gt.V1.NodeId(`${this.apiDefinitionId}:${s}`),type:"webhook",collapsed:void 0,webhookId:s,method:o.method,title:o.name??WO(o.id),slug:r.apply(o).get(),icon:void 0,hidden:this.hideChildren,apiDefinitionId:this.apiDefinitionId,availability:Gt.V1.convertAvailability(o.availability)??Gg(n),authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0})}),t.subpackages.forEach(o=>{if(this.#s.has(o))return;let s=this.#e.getSubpackageByIdOrLocator(o);if(s==null){this.taskContext.logger.error(`Subpackage ${o} not found in ${this.apiDefinitionId}`);return}let a=gJ(s)?r.apply(s):r,c=this.#N(o,a,n),l=this.createTagDescriptionPageId(s),u=this.#e.subpackages.get(Tb.SubpackageId(o)),p=u?Array.from(u.endpoints.values()).some(d=>{let f=this.#e.getEndpointId(d);return f!=null&&this.#t.has(f)}):!1;(c.length>0||l!=null&&p)&&i.push({id:Gt.V1.NodeId(`${this.apiDefinitionId}:${o}`),type:"apiPackage",collapsed:void 0,children:c,title:gJ(s)?s.displayName??WO(s.name):this.apiSection.title,slug:a.get(),icon:void 0,hidden:this.hideChildren,overviewPageId:l,collapsible:void 0,collapsedByDefault:void 0,availability:Gg(n),apiDefinitionId:this.apiDefinitionId,pointsTo:void 0,noindex:void 0,playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0})}),t.graphqlOperations!=null&&t.graphqlOperations.length>0){let o=this.#A(t.graphqlOperations,r,n);i.push(...o)}if(t===this.#e.api.rootPackage){let o=this.#D(r,n);o!=null&&i.push(o)}return i=this.mergeEndpointPairs(i),this.apiSection.alphabetized&&(i=i.sort((o,s)=>{let a=o.type==="endpointPair"?o.nonStream.title:o.title,c=s.type==="endpointPair"?s.nonStream.title:s.title;return a.localeCompare(c)})),this.apiSection.sortByAvailability!=null&&(i=q1u(i,this.apiSection.sortByAvailability)),i}#A(t,r,n){let i={},o={};for(let l of t){let u=Tb.GraphQlOperationId(l.id);if(this.#o.has(u))continue;this.#o.add(u);let p=this.#u.get(sn.GraphQlOperationId(l.id)),d=l.operationType;p!=null?(i[p]==null&&(i[p]={}),i[p][d]==null&&(i[p][d]=[]),i[p][d].push(l)):(o[d]==null&&(o[d]=[]),o[d].push(l))}let s=[],a=["QUERY","MUTATION","SUBSCRIPTION"],c={QUERY:"Queries",MUTATION:"Mutations",SUBSCRIPTION:"Subscriptions"};for(let[l,u]of Object.entries(i)){let p=r.append(op(l)),d=[];for(let m of a){let g=u[m];if(g==null||g.length===0)continue;let A=c[m],y=p.append(op(A)),I=this.#O(g,y,n,m),C={id:this.#p.get(`${this.apiDefinitionId}:graphql:${l}:${m}`),type:"apiPackage",collapsed:void 0,children:I,title:A,slug:y.get(),icon:void 0,hidden:this.hideChildren,overviewPageId:void 0,collapsible:void 0,collapsedByDefault:void 0,availability:Gg(n),apiDefinitionId:this.apiDefinitionId,pointsTo:void 0,noindex:void 0,playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0};d.push(C)}let f={id:this.#p.get(`${this.apiDefinitionId}:graphql:namespace:${l}`),type:"apiPackage",collapsed:void 0,children:d,title:WO(l),slug:p.get(),icon:void 0,hidden:this.hideChildren,overviewPageId:void 0,collapsible:void 0,collapsedByDefault:void 0,availability:Gg(n),apiDefinitionId:this.apiDefinitionId,pointsTo:void 0,noindex:void 0,playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0};s.push(f)}for(let l of a){let u=o[l];if(u==null||u.length===0)continue;let p=c[l],d=r.append(op(p)),f=this.#O(u,d,n,l),m={id:this.#p.get(`${this.apiDefinitionId}:graphql:${l}`),type:"apiPackage",collapsed:void 0,children:f,title:p,slug:d.get(),icon:void 0,hidden:this.hideChildren,overviewPageId:void 0,collapsible:void 0,collapsedByDefault:void 0,availability:Gg(n),apiDefinitionId:this.apiDefinitionId,pointsTo:void 0,noindex:void 0,playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0};s.push(m)}return s}#D(t,r){let n=new Map;for(let[s,a]of Object.entries(this.#m)){let c=sn.TypeId(s);if(this.#e.api.types[c]==null)continue;let l=n.get(a);l!=null?l.push(c):n.set(a,[c])}if(n.size===0)return;let i=t.append(PLh),o=[];for(let{category:s,title:a,urlSlug:c}of OLh){let l=n.get(s);if(l==null||l.length===0)continue;let u=i.append(c),p=l.map(d=>this.#B(d,s,u,r)).filter(ea).sort((d,f)=>d.title.localeCompare(f.title));p.length!==0&&o.push({id:this.#p.get(`${this.apiDefinitionId}:graphql:types:${s}`),type:"apiPackage",collapsed:void 0,children:p,title:a,slug:u.get(),icon:void 0,hidden:this.hideChildren,overviewPageId:void 0,collapsible:void 0,collapsedByDefault:void 0,availability:Gg(r),apiDefinitionId:this.apiDefinitionId,pointsTo:void 0,noindex:void 0,playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0})}if(o.length!==0)return{id:this.#p.get(`${this.apiDefinitionId}:graphql:types`),type:"apiPackage",collapsed:void 0,children:o,title:BLh,slug:i.get(),icon:void 0,hidden:this.hideChildren,overviewPageId:void 0,collapsible:void 0,collapsedByDefault:void 0,availability:Gg(r),apiDefinitionId:this.apiDefinitionId,pointsTo:void 0,noindex:void 0,playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}}#B(t,r,n,i){let o=this.#e.api.types[t];if(o==null)return;let s=o.displayName??o.name??t;return{id:this.#p.get(`${this.apiDefinitionId}:graphqlType:${t}`),type:"graphqlType",collapsed:void 0,typeId:Gt.TypeId(t),typeCategory:r,title:s,slug:n.append(op(s)).get(),icon:void 0,hidden:this.hideChildren,apiDefinitionId:this.apiDefinitionId,availability:Gt.V1.convertAvailability(o.availability)??Gg(i),authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}}#S({id:t,operationType:r,graphqlOperationId:n,graphqlOperationIds:i,title:o,slug:s,availability:a,hidden:c,icon:l,playground:u,viewers:p,orphaned:d,featureFlags:f}){return{id:t,type:"graphql",collapsed:void 0,operationType:r,graphqlOperationId:n,graphqlOperationIds:i,apiDefinitionId:this.apiDefinitionId,availability:Gg(a),title:o,slug:s,icon:l,hidden:c,playground:u,authed:void 0,viewers:p,orphaned:d,featureFlags:f}}#O(t,r,n,i){let o=i==="QUERY",s=new Map,a=[];for(let u of t){let p=kls(u)?.[0];if(o&&p!=null){let d=s.get(p);d!=null?d.push(u):(s.set(p,[u]),a.push({type:"group",parentField:p}))}else a.push({type:"flat",operation:u})}let c=new Map;for(let u of a)if(u.type==="flat"){let p=J1u(u.operation);s.has(p)&&kls(u.operation)==null&&c.set(p,u.operation)}let l=[];for(let u of a)if(u.type==="flat"){let p=J1u(u.operation);if(c.has(p))continue;let d=kls(u.operation),f=r;if(d!=null&&d.length>0)for(let m of d)f=f.append(op(m));f=f.append(op(p)),l.push(this.#S({id:Gt.V1.NodeId(`${this.apiDefinitionId}:${u.operation.id}`),operationType:u.operation.operationType,graphqlOperationId:Tb.GraphQlOperationId(u.operation.id),title:u.operation.displayName??u.operation.name??u.operation.id,slug:f.get(),availability:n,hidden:this.hideChildren}))}else{let p=s.get(u.parentField)??[],f=c.get(u.parentField)??p[0];if(f==null)continue;let m=r.append(op(u.parentField));l.push(this.#S({id:Gt.V1.NodeId(`${this.apiDefinitionId}:${f.id}`),operationType:f.operationType,graphqlOperationId:Tb.GraphQlOperationId(f.id),graphqlOperationIds:p.map(g=>Tb.GraphQlOperationId(g.id)),title:u.parentField,slug:m.get(),availability:n,hidden:this.hideChildren}))}return l}#N(t,r,n){let i=t!=null?this.#e.resolveSubpackage(this.#e.getSubpackageByIdOrLocator(t)):void 0;return i==null?(this.taskContext.logger.debug(Qci(t||"unknown",[])),[]):this.#w(i,r,n)}#T(t){return O1u(t)}mergeEndpointPairs(t){return Lci({children:t,findEndpointById:r=>this.#e.endpoints.get(r),stringifyEndpointPathParts:r=>xk(r.path.parts),disableEndpointPairs:this.disableEndpointPairs,apiDefinitionId:this.apiDefinitionId})}getFileId(t){let r=this.collectedFileIds.get(t);return r??this.taskContext.failAndThrow("Failed to locate file after uploading: "+t,void 0,{code:w.Code.InternalError})}resolveIconFileId(t){if(t!=null)return this.collectedFileIds.has(t)?`file:${this.getFileId(t)}`:t}}});function DLh(e){return Z1u.default.createHash("sha256").update(e).digest("hex")}var Z1u,_ci,$1u=h(()=>{"use strict";Mm();Dt();Z1u=Ae(require("crypto"),1);_ci=class e{static init(){return new e}constructor(){}#e=new Map;#t=new Set;#r(t){let r=this.#e.get(t)??0;return this.#e.set(t,r+1),DLh(r===0?t:`${t}-${r}`)}#n(t){let r=this.#r(t),n=0;for(;this.#t.has(r);)if(r=this.#r(t),n++,n>100)throw new w({message:`Infinite loop detected for id: ${t}`,code:w.Code.ReferenceError});return r}get(t){return Gt.V1.NodeId(this.#n(t))}}});async function eTu({absolutePathToFernFolder:e}){let t=[];for(let r of RLh){let n=Re(e,r);if(await Ut(n)){let i=await BRt(n);t.push(...i.map(Zt.of))}}return t}var RLh,tTu=h(()=>{"use strict";tr();RLh=[be.of(".well-known/skills"),be.of(".well-known/agent-skills")]});function rTu(e){return e==null?{}:{pythonSdk:e.python!=null?{package:typeof e.python=="string"?e.python:e.python.package,version:typeof e.python=="string"?void 0:e.python.version}:void 0,typescriptSdk:e.typescript!=null?{package:typeof e.typescript=="string"?e.typescript:e.typescript.package,version:typeof e.typescript=="string"?void 0:e.typescript.version}:void 0,goSdk:e.go!=null?{githubRepo:typeof e.go=="string"?e.go:e.go.package,version:typeof e.go=="string"?void 0:e.go.version}:void 0,javaSdk:e.java!=null?{coordinate:typeof e.java=="string"?e.java:e.java.package,version:typeof e.java=="string"?void 0:e.java.version}:void 0,rubySdk:e.ruby!=null?{gem:typeof e.ruby=="string"?e.ruby:e.ruby.package,version:typeof e.ruby=="string"?void 0:e.ruby.version}:void 0,csharpSdk:e.csharp!=null?{package:typeof e.csharp=="string"?e.csharp:e.csharp.package,version:typeof e.csharp=="string"?void 0:e.csharp.version}:void 0,phpSdk:e.php!=null?{package:typeof e.php=="string"?e.php:e.php.package,version:typeof e.php=="string"?void 0:e.php.version}:void 0,swiftSdk:e.swift!=null?{package:typeof e.swift=="string"?e.swift:e.swift.package,version:typeof e.swift=="string"?void 0:e.swift.version}:void 0,rustSdk:e.rust!=null?{package:typeof e.rust=="string"?e.rust:e.rust.package,version:typeof e.rust=="string"?void 0:e.rust.version}:void 0,cliSdk:e.cli!=null?{package:typeof e.cli=="string"?e.cli:e.cli.package,version:typeof e.cli=="string"?void 0:e.cli.version}:void 0}}var nTu=h(()=>{"use strict"});function Uci(e){return typeof e=="string"?e:e.name}function FRe(e){if(e!=null)return typeof e=="string"?e:e.originalName}var Lvt=h(()=>{"use strict";tc()});function iTu({auth:e,playgroundConfig:t,context:r}){if(e.schemes.length>0&&e.schemes[0]!=null){let n=e.schemes[0];return oTu({scheme:n,playgroundConfig:t,context:r})}}function oTu({scheme:e,playgroundConfig:t,context:r}){switch(e.type){case"basic":return{type:"basicAuth",passwordName:jr(e.password),usernameName:jr(e.username),description:e.docs,playgroundDescription:e.playgroundDocs,passwordAlwaysEmpty:e.passwordOmit};case"bearer":return{type:"bearerAuth",tokenName:jr(e.token),description:e.docs,playgroundDescription:e.playgroundDocs};case"header":return{type:"header",headerWireValue:cr(e.name),nameOverride:jr(Uci(e.name)),prefix:e.prefix,description:e.docs,playgroundDescription:e.playgroundDocs};case"oauth":{let n=e.configuration;if(n.type!=="clientCredentials")return{type:"bearerAuth",tokenName:"token",description:e.docs,playgroundDescription:e.playgroundDocs};let i=n.tokenEndpoint.responseProperties.accessToken.propertyPath?.map(o=>jr(o.name)).join(".")||"$.body.access_token";return t?.oauth?{type:"oAuth",value:{type:"clientCredentials",value:{type:"referencedEndpoint",endpointId:sn.EndpointId(n.tokenEndpoint.endpointReference.endpointId),accessTokenLocator:i,headerName:n.tokenHeader,tokenPrefix:n.tokenPrefix,description:e.docs,playgroundDescription:e.playgroundDocs}}}:{type:"bearerAuth",tokenName:"token",description:e.docs,playgroundDescription:e.playgroundDocs}}case"inferred":{e.tokenEndpoint.authenticatedRequestHeaders.length>1&&r.logger.warn("Inferred auth scheme has multiple authenticated request headers. Only the `Authentication` or first header will be pushed to FDR.");let n=e.tokenEndpoint.authenticatedRequestHeaders.find(o=>o.headerName.toLowerCase()==="authorization");if(n)return n.responseProperty.propertyPath!=null&&n.responseProperty.propertyPath.length>0&&r.logger.warn("Inferred Authentication header has a property path. The property wirevalue will be pushed to FDR without property path."),{type:"bearerAuth",tokenName:cr(n.responseProperty.property.name),description:e.docs,playgroundDescription:e.playgroundDocs};let i=e.tokenEndpoint.authenticatedRequestHeaders[0];return i?{type:"header",headerWireValue:i.headerName,prefix:i.valuePrefix,nameOverride:void 0,description:e.docs,playgroundDescription:e.playgroundDocs}:{type:"bearerAuth",tokenName:"token",description:e.docs,playgroundDescription:e.playgroundDocs}}default:rt(e)}}function sTu({auth:e,playgroundConfig:t,context:r}){let n={};for(let i of e.schemes){let o=oTu({scheme:i,playgroundConfig:t,context:r});o!=null&&(n[sn.AuthSchemeId(i.key)]=o)}return n}var aTu=h(()=>{"use strict";It();Mm();Lvt()});function cTu(e){return e._visit({alias:t=>({type:"alias",value:of(t.aliasOf)}),enum:t=>({type:"enum",default:t.default!=null?cr(t.default.name):void 0,values:t.values.map(r=>({description:r.docs??void 0,value:cr(r.name),availability:eE(r.availability)}))}),object:t=>({type:"object",extends:t.extends.map(r=>sn.TypeId(r.typeId)),properties:t.properties.map(r=>({description:r.docs??void 0,key:sn.PropertyKey(cr(r.name)),valueType:of(r.valueType,r.defaultValue),availability:eE(r.availability),propertyAccess:r.propertyAccess})),extraProperties:LLh(t.extraProperties)}),union:t=>{let r=t.baseProperties.map(n=>({key:sn.PropertyKey(cr(n.name)),valueType:of(n.valueType,n.defaultValue),availability:eE(n.availability),description:n.docs,propertyAccess:n.propertyAccess}));return{type:"discriminatedUnion",discriminant:cr(t.discriminant),variants:t.types.map(n=>({description:n.docs??void 0,discriminantValue:cr(n.discriminantValue),displayName:n.displayName,availability:n.availability!=null?eE(n.availability):void 0,additionalProperties:Xt.types.SingleUnionTypeProperties._visit(n.shape,{samePropertiesAsObject:i=>({extends:[sn.TypeId(i.typeId)],properties:r,extraProperties:void 0}),singleProperty:i=>({extends:[],properties:[{key:sn.PropertyKey(cr(i.name)),valueType:of(i.type),description:void 0,availability:void 0,propertyAccess:void 0},...r],extraProperties:void 0}),noProperties:()=>({extends:[],properties:r,extraProperties:void 0}),_other:()=>{throw new w({message:"Unknown SingleUnionTypeProperties: "+n.shape.propertiesType,code:w.Code.InternalError})}})}))}},undiscriminatedUnion:t=>({type:"undiscriminatedUnion",variants:t.members.map(r=>({typeName:r.type.type==="named"?jr(r.type.name):void 0,description:r.docs??void 0,type:of(r.type),availability:void 0,displayName:r.type.type==="named"?r.type.displayName:void 0}))}),_other:()=>{throw new w({message:"Unknown Type shape: "+e.type,code:w.Code.InternalError})}})}function of(e,t){return e._visit({container:r=>Xt.types.ContainerType._visit(r,{list:n=>({type:"list",itemType:of(n),minItems:void 0,maxItems:void 0}),map:({keyType:n,valueType:i})=>({type:"map",keyType:of(n),valueType:of(i),minProperties:void 0,maxProperties:void 0}),optional:n=>({type:"optional",itemType:of(n),defaultValue:t}),nullable:n=>({type:"nullable",itemType:of(n)}),set:n=>({type:"set",itemType:of(n),minItems:void 0,maxItems:void 0}),literal:n=>Xt.types.Literal._visit(n,{boolean:i=>({type:"literal",value:{type:"booleanLiteral",value:i}}),string:i=>({type:"literal",value:{type:"stringLiteral",value:i}}),_other:()=>{throw new w({message:"Unknown literal type: "+n.type,code:w.Code.InternalError})}}),_other:()=>{throw new w({message:"Unknown container reference: "+r.type,code:w.Code.InternalError})}}),named:r=>({type:"id",value:sn.TypeId(r.typeId),default:void 0}),primitive:r=>({type:"primitive",value:Xt.types.PrimitiveTypeV1._visit(r.v1,{integer:()=>FLh(r.v2),float:()=>NLh(r.v2),double:()=>jLh(r.v2),string:()=>kLh(r.v2),long:()=>zLh(r.v2),boolean:()=>({type:"boolean",default:r.v2?.type==="boolean"?r.v2.default:void 0}),dateTime:()=>({type:"datetime",default:void 0}),date:()=>({type:"date",default:void 0}),uuid:()=>({type:"uuid",default:void 0}),base64:()=>({type:"base64",mimeType:void 0,default:void 0}),bigInteger:()=>({type:"bigInteger",default:r.v2?.type==="bigInteger"?r.v2.default:void 0}),uint:()=>QLh(r.v2),uint64:()=>MLh(r.v2),dateTimeRfc2822:()=>({type:"datetime",default:void 0}),_other:()=>{throw new w({message:"Unknown primitive: "+r.v1,code:w.Code.InternalError})}})}),unknown:()=>({type:"unknown"}),_other:()=>{throw new w({message:"Unknown Type reference: "+e.type,code:w.Code.InternalError})}})}function kLh(e){let t=e!=null&&e.type==="string"?e.validation:void 0;return{type:"string",format:t?.format,regex:t?.pattern,minLength:t?.minLength,maxLength:t?.maxLength,default:e!=null&&e.type==="string"?e.default:void 0}}function FLh(e){let t=e!=null&&e.type==="integer"?e.validation:void 0;return{type:"integer",minimum:t?.exclusiveMin===!0?void 0:t?.min,maximum:t?.exclusiveMax===!0?void 0:t?.max,exclusiveMinimum:t?.exclusiveMin===!0?t?.min:void 0,exclusiveMaximum:t?.exclusiveMax===!0?t?.max:void 0,multipleOf:t?.multipleOf,default:e!=null&&e.type==="integer"?e.default:void 0}}function NLh(e){return{type:"scalar",name:"float",description:void 0,default:e!=null&&e.type==="float"?e.default:void 0}}function jLh(e){let t=e!=null&&e.type==="double"?e.validation:void 0;return{type:"double",minimum:t?.exclusiveMin===!0?void 0:t?.min,maximum:t?.exclusiveMax===!0?void 0:t?.max,exclusiveMinimum:t?.exclusiveMin===!0?t?.min:void 0,exclusiveMaximum:t?.exclusiveMax===!0?t?.max:void 0,multipleOf:t?.multipleOf,default:e!=null&&e.type==="double"?e.default:void 0}}function zLh(e){let t=e!=null&&e.type==="long"?e.validation:void 0;return{type:"long",minimum:t?.exclusiveMin===!0?void 0:t?.min,maximum:t?.exclusiveMax===!0?void 0:t?.max,exclusiveMinimum:t?.exclusiveMin===!0?t?.min:void 0,exclusiveMaximum:t?.exclusiveMax===!0?t?.max:void 0,multipleOf:t?.multipleOf,default:e!=null&&e.type==="long"?e.default:void 0}}function QLh(e){let t=e!=null&&e.type==="uint"?e.validation:void 0;return{type:"uint",minimum:t?.exclusiveMin===!0?void 0:t?.min,maximum:t?.exclusiveMax===!0?void 0:t?.max,exclusiveMinimum:t?.exclusiveMin===!0?t?.min:void 0,exclusiveMaximum:t?.exclusiveMax===!0?t?.max:void 0,multipleOf:t?.multipleOf,default:e!=null&&e.type==="uint"?e.default:void 0}}function MLh(e){let t=e!=null&&e.type==="uint64"?e.validation:void 0;return{type:"uint64",minimum:t?.exclusiveMin===!0?void 0:t?.min,maximum:t?.exclusiveMax===!0?void 0:t?.max,exclusiveMinimum:t?.exclusiveMin===!0?t?.min:void 0,exclusiveMaximum:t?.exclusiveMax===!0?t?.max:void 0,multipleOf:t?.multipleOf,default:e!=null&&e.type==="uint64"?e.default:void 0}}function LLh(e){return typeof e=="boolean"?e?Wr.unknown():void 0:typeof e=="string"?{type:"id",value:sn.TypeId(e),default:void 0}:of(e)}var Fls=h(()=>{"use strict";Mm();jn();Dt();Nls();Lvt()});function Qls(e,t,r,n){let i=e.service!=null?t.services[e.service]:void 0,o=e.webhooks!=null?t.webhookGroups[e.webhooks]:void 0,s=e.websocket!=null&&t.websocketChannels!=null?t.websocketChannels[e.websocket]:void 0;return{endpoints:i!=null?ULh(i,t):[],webhooks:o!=null?_Lh(o):[],websockets:s!=null?[GLh(s,t)]:[],types:[...e.types.map(c=>sn.TypeId(c)),...Object.keys(n??{}).map(c=>sn.TypeId(c))],subpackages:e.subpackages.map(c=>sn.SubpackageId(c)),pointsTo:e.navigationConfig!=null?sn.SubpackageId(e.navigationConfig.pointsTo):void 0,graphqlOperations:r?Object.values(r):[]}}function _Lh(e){return e.map(t=>{let r=[];if(t.v2Examples!=null){for(let[n,i]of Object.entries(t.v2Examples.userSpecifiedExamples))r.push({name:i.name??n,payload:i.payload});for(let[n,i]of Object.entries(t.v2Examples.autogeneratedExamples))r.push({name:i.name??n,payload:i.payload})}else r.push(...t.examples?.map(n=>({name:FRe(n.name),payload:n.payload.jsonExample}))??[]);return{description:t.docs??void 0,availability:eE(t.availability),id:sn.WebhookId(jr(t.name)),path:[],method:t.method,name:t.displayName??hje(jr(t.name)),headers:t.headers.map(n=>({description:n.docs??void 0,key:cr(n.name),type:of(n.valueType,n.defaultValue),availability:eE(n.availability)})),payload:r6h(t.payload,t.fileUploadPayload),examples:r,responses:t.responses?.map(zls).filter(ea)}})}function ULh(e,t){let r=[];for(let n of e.endpoints){let i=n.autogeneratedExamples[0],o=[];if(n.v2Examples!=null){let a,c=n.v2Examples.userSpecifiedExamples,l=n.v2Examples.autogeneratedExamples,u=Object.values(c).map(d=>d.response?.statusCode).filter((d,f,m)=>m.indexOf(d)!==f).length>0;for(let[d,f]of Object.entries(c))a=uTu({shouldUseExampleName:f.displayName!=null||u,exampleName:f.displayName??d,example:f,irEndpoint:n,irService:e,ir:t}),a!=null&&o.push(a);let p=Object.values(l).map(d=>d.response?.statusCode).filter((d,f,m)=>m.indexOf(d)!==f).length>0;for(let[d,f]of Object.entries(l))a=uTu({shouldUseExampleName:p,exampleName:f.displayName??d,example:f,irEndpoint:n,irService:e,ir:t}),a!=null&&o.push(a)}else if(n.userSpecifiedExamples.length>0)o.push(...n.userSpecifiedExamples.map(a=>jls({userSpecifiedExample:a,...i!=null&&{autogeneratedExample:i},irEndpoint:n,ir:t})).filter(ea));else if(i!=null){let a=jls({autogeneratedExample:i,irEndpoint:n,ir:t});a!=null&&o.push(a)}else if(n.response?.body?.type==="fileDownload"){let a=Qot({ir:t,service:e,endpoint:{...n,response:void 0},typeDeclarations:t.types,skipOptionalRequestProperties:!0,generationResponse:{type:"success"}});if(a.type==="success"){let c=jls({autogeneratedExample:a,irEndpoint:n,ir:t});if(c!=null){let l={...c,responseBodyV3:{type:"filename",value:"<bytes>"}};o.push(l)}}}o.push(...e6h({irEndpoint:n,ir:t,examples:o}));let s={slug:void 0,availability:eE(n.availability??e.availability),auth:n.auth,authV2:qLh(n.security),multiAuth:WLh(n.security,t.auth),description:n.docs??void 0,method:XLh(n.method),defaultEnvironment:t.environments?.defaultEnvironment!=null?sn.EnvironmentId(t.environments.defaultEnvironment):void 0,environments:t.environments!=null?HLh({environmentsConfig:t.environments,endpoint:n}):void 0,id:sn.EndpointId(jr(n.name)),originalEndpointId:n.id,name:n.displayName??hje(jr(n.name)),path:n.basePath!=null?{pathParameters:n.pathParameters.map(a=>({description:a.docs??void 0,key:sn.PropertyKey(jr(a.name)),type:of(a.valueType),availability:void 0,explode:a.explode})),parts:[..._vt(n.basePath),..._vt(n.path)]}:{pathParameters:[...t.pathParameters,...e.pathParameters,...n.pathParameters].map(a=>({description:a.docs??void 0,key:sn.PropertyKey(jr(a.name)),type:of(a.valueType),availability:void 0,explode:a.explode})),parts:[...t.basePath!=null?_vt(t.basePath):[],..._vt(e.basePath),..._vt(n.path)]},queryParameters:n.queryParameters.map(a=>({description:a.docs??void 0,key:cr(a.name),type:of(a.valueType,a.defaultValue),availability:eE(a.availability),explode:a.explode})),headers:[...e.headers,...n.headers].map(a=>({description:a.docs??void 0,key:cr(a.name),type:of(a.valueType,a.defaultValue),availability:eE(a.availability)})),responseHeaders:n.responseHeaders?.map(a=>({description:a.docs??void 0,key:cr(a.name),type:of(a.valueType,a.defaultValue),availability:eE(a.availability)})),request:n.requestBody!=null?lTu(n.requestBody):void 0,requestsV2:{requests:n.v2RequestBodies?.requestBodies?.map(lTu).filter(ea)},response:n.response!=null?zls(n.response):void 0,responsesV2:{responses:n.v2Responses?.responses?.map(zls).filter(ea)},errors:void 0,errorsV2:ZLh(n.errors,t),examples:o,protocol:n.source?._visit({openapi:()=>({type:"rest"}),openrpc:a=>({type:"openrpc",methodName:n.id,paramStructure:JLh(a.paramStructure)}),proto:a=>({type:"grpc",methodName:n.id,methodType:a.methodType}),_other:()=>{}}),includeInApiExplorer:n.apiPlayground,subtitle:n.subtitle??void 0};VLh(s,n),r.push(s)}return r}function VLh(e,t){let r=t.v2Examples?.userSpecifiedExamples;if(r==null||Object.keys(r).length===0)return;let n=e;n.v2Examples={userSpecifiedExamples:r,autogeneratedExamples:{}}}function GLh(e,t){let r=[];if(e.v2Examples!=null&&(Object.keys(e.v2Examples.userSpecifiedExamples).length>0||Object.keys(e.v2Examples.autogeneratedExamples).length>0)){let n=Object.entries(e.v2Examples.userSpecifiedExamples),i=Object.entries(e.v2Examples.autogeneratedExamples),o=n.length>0?n[0]:i[0];if(o!=null){let[s,a]=o;r.push({name:s,description:"",path:a.baseUrl??"",pathParameters:a.pathParameters??{},queryParameters:a.queryParameters??{},headers:a.headers??{},messages:a.messages?.map(c=>({type:sn.WebSocketMessageId(c.type),body:c.body}))??[]})}}else r=e.examples.map(n=>({name:FRe(n.name),description:n.docs,path:n.url,pathParameters:n.pathParameters.reduce((i,o)=>(i[sn.PropertyKey(jr(o.name))]=o.value.jsonExample,i),{}),queryParameters:n.queryParameters.reduce((i,o)=>(i[cr(o.name)]=o.value.jsonExample,i),{}),headers:n.headers.reduce((i,o)=>(i[cr(o.name)]=o.value.jsonExample,i),{}),messages:n.messages.map(i=>({type:sn.WebSocketMessageId(i.type),body:i.body.jsonExample}))}));return{auth:e.auth,availability:eE(e.availability),description:e.docs??void 0,defaultEnvironment:t.environments?.defaultEnvironment!=null?sn.EnvironmentId(t.environments.defaultEnvironment):void 0,environments:t.environments!=null?KLh({environmentsConfig:t.environments,channel:e}):[],id:sn.WebSocketId(jr(e.name)),name:e.displayName??hje(jr(e.name)),path:{pathParameters:e.pathParameters.map(n=>({description:n.docs??void 0,key:sn.PropertyKey(jr(n.name)),type:of(n.valueType),availability:void 0,explode:n.explode})),parts:_vt(e.path)},headers:e.headers.map(n=>({key:cr(n.name),type:of(n.valueType,n.defaultValue),description:n.docs,availability:eE(n.availability)})),queryParameters:e.queryParameters.map(n=>({description:n.docs??void 0,key:cr(n.name),type:of(n.valueType,n.defaultValue),availability:eE(n.availability),explode:n.explode})),messages:e.messages.map(n=>({type:sn.WebSocketMessageId(n.type),displayName:n.displayName,origin:n.origin,body:i6h(n.body),description:n.docs,availability:eE(n.availability)})),examples:r,includeInApiExplorer:e.apiPlayground}}function qLh(e){if(e==null)return;if(e.length===0)return[];let t=new Set(e.flatMap(r=>Object.keys(r)));return Array.from(t).map(r=>sn.AuthSchemeId(r))}function WLh(e,t){return e==null?t!=null&&t.requirement==="ANY"&&t.schemes.length>0?t.schemes.map(r=>({schemes:[sn.AuthSchemeId(r.key)]})):void 0:e.length===0?[]:e.map(r=>({schemes:Object.keys(r).map(n=>sn.AuthSchemeId(n))}))}function eE(e){if(e!=null)switch(e.status){case"DEPRECATED":return sn.Availability.Deprecated;case"LEGACY":return sn.Availability.Legacy;case"PRE_RELEASE":case"BETA":return sn.Availability.Beta;case"GENERAL_AVAILABILITY":return sn.Availability.GenerallyAvailable;case"IN_DEVELOPMENT":return sn.Availability.Beta;case"ALPHA":return sn.Availability.Alpha;case"PREVIEW":return sn.Availability.Preview;default:rt(e.status)}}function HLh({environmentsConfig:e,endpoint:t}){let r=e.environments,n=t.baseUrl,i=t.v2BaseUrls;switch(r.type){case"singleBaseUrl":return r.environments.map(o=>({id:sn.EnvironmentId(o.id),baseUrl:o.url,audiences:o.audiences}));case"multipleBaseUrls":if(i!=null)return i.flatMap(s=>r.environments.map(a=>{let c=a.urls[s];if(c==null)throw new w({message:`Encountered undefined server name "${s}" at endpoint ${t.method.toUpperCase()} ${t.path}. Expected environment ${a.id} to contain url for ${s}`,code:w.Code.ValidationError});return{id:sn.EnvironmentId(s),baseUrl:c,audiences:a.audiences}})).filter((s,a,c)=>a===c.findIndex(l=>l.id===s.id&&l.baseUrl===s.baseUrl));if(n==null)throw new w({message:`Expected endpoint ${jr(t.name)} to have base url.`,code:w.Code.IrConversionError});return r.environments.map(o=>{let s=o.urls[n];if(s==null)throw new w({message:`Encountered undefined server name "${n}" at endpoint ${t.method.toUpperCase()} ${t.path.head}. Expected environment ${o.id} to contain url for ${n}`,code:w.Code.ValidationError});return{id:sn.EnvironmentId(o.id),baseUrl:s,audiences:o.audiences}});default:rt(r)}}function KLh({environmentsConfig:e,channel:t}){let r=e.environments,n=t.baseUrl;switch(r.type){case"singleBaseUrl":return r.environments.map(i=>({id:sn.EnvironmentId(i.id),baseUrl:YLh(i.url,"wss"),audiences:i.audiences}));case"multipleBaseUrls":if(n==null)throw new w({message:`Expected channel ${jr(t.name)} to have base url.`,code:w.Code.IrConversionError});return r.environments.map(i=>{let o=i.urls[n];if(o==null)throw new w({message:`Encountered undefined server name ${o} at channel ${jr(t.name)} ${t.path.head}. Expected environment ${i.id} to contain url for ${n}`,code:w.Code.IrConversionError});return{id:sn.EnvironmentId(i.id),baseUrl:o,audiences:i.audiences}});default:rt(r)}}function JLh(e){switch(e){case"BY_NAME":return"by-name";case"BY_POSITION":return"by-position";case"EITHER":return"either";case void 0:return;default:rt(e)}}function YLh(e,t){return e.replace(/^[^:]+/,t)}function XLh(e){return Xt.http.HttpMethod._visit(e,{get:()=>sn.HttpMethod.Get,post:()=>sn.HttpMethod.Post,put:()=>sn.HttpMethod.Put,patch:()=>sn.HttpMethod.Patch,delete:()=>sn.HttpMethod.Delete,head:()=>sn.HttpMethod.Head,_other:()=>{throw new w({message:"Unknown http method: "+e,code:w.Code.InternalError})}})}function _vt(e){let t=e.parts.flatMap(r=>[{type:"pathParameter",value:sn.PropertyKey(r.pathParameter)},{type:"literal",value:r.tail}]);return[{type:"literal",value:e.head},...t]}function lTu(e){let t=Xt.http.HttpRequestBody._visit(e,{inlinedRequestBody:r=>({type:"json",contentType:r.contentType??Fp.APPLICATION_JSON,shape:{type:"object",extends:r.extends.map(n=>sn.TypeId(n.typeId)),properties:r.properties.map(n=>({description:n.docs??void 0,key:sn.PropertyKey(cr(n.name)),valueType:of(n.valueType,n.defaultValue),availability:eE(n.availability),propertyAccess:n.propertyAccess})),extraProperties:r.extraProperties?{type:"unknown"}:void 0}}),reference:r=>({type:"json",contentType:r.contentType??Fp.APPLICATION_JSON,shape:{type:"reference",value:of(r.requestBodyType)},description:r.docs??void 0}),fileUpload:r=>({type:"fileUpload",value:{name:jr(r.name),description:void 0,availability:void 0,properties:r.properties.map(n=>n._visit({file:i=>{let o=i._visit({file:s=>({type:"file",key:sn.PropertyKey(cr(s.key)),isOptional:s.isOptional,contentType:s.contentType,description:s.docs??void 0,availability:void 0}),fileArray:s=>({type:"fileArray",key:sn.PropertyKey(cr(s.key)),isOptional:s.isOptional,contentType:s.contentType,description:s.docs??void 0,availability:void 0}),_other:()=>{}});if(o!=null)return{type:"file",value:o}},bodyProperty:i=>({type:"bodyProperty",key:sn.PropertyKey(cr(i.name)),valueType:of(i.valueType,i.defaultValue),contentType:i.contentType,description:i.docs??void 0,availability:eE(i.availability),exploded:i.style==="exploded",propertyAccess:void 0}),_other:()=>{}})).filter(ea)},contentType:r.contentType,description:r.docs??void 0}),bytes:r=>({type:"bytes",description:r.docs??void 0,availability:void 0,isOptional:r.isOptional,contentType:r.contentType}),_other:()=>{throw new w({message:"Unknown HttpRequestBody: "+e.type,code:w.Code.InternalError})}});return t!=null?{type:t,description:e.docs}:void 0}function zls(e){let t=e.docs,r;return e.body!=null&&(r=Xt.http.HttpResponseBody._visit(e.body,{fileDownload:n=>(t=n.docs,{type:"fileDownload",contentType:void 0}),json:n=>(t=n.docs,{type:"reference",value:of(n.responseBodyType)}),text:()=>{},bytes:()=>{},streamParameter:()=>{},streaming:n=>{if(n.type==="text")return t=n.docs,{type:"streamingText"};if(n.type==="json")return t=n.docs,{type:"stream",shape:{type:"reference",value:of(n.payload)},terminator:n.terminator};if(n.type==="sse")return t=n.docs,{type:"stream",shape:{type:"reference",value:of(n.payload)},terminator:n.terminator}},_other:()=>{throw new w({message:"Unknown HttpResponse: "+e.body,code:w.Code.InternalError})}})),r!=null?{type:r,statusCode:e.statusCode,isWildcard:e.isWildcardStatusCode===!0?!0:void 0,description:t}:e.statusCode!=null?{statusCode:e.statusCode,isWildcard:e.isWildcardStatusCode===!0?!0:void 0,description:t,type:{type:"object",extends:[],properties:[],extraProperties:void 0}}:void 0}function ZLh(e,t){let r=[];if(t.errorDiscriminationStrategy.type==="statusCode")for(let n of e){let i=t.errors[n.error.errorId];i&&r.push({type:i.type==null?void 0:{type:"alias",value:of(i.type)},statusCode:i.statusCode,isWildcard:i.isWildcardStatusCode===!0?!0:void 0,description:i.docs??void 0,name:i.displayName??jr(i.name.name),availability:void 0,examples:pTu(i,t),headers:i.headers!=null&&i.headers.length>0?i.headers.map(o=>({description:o.docs??void 0,key:cr(o.name),type:of(o.valueType,o.defaultValue),availability:eE(o.availability)})):void 0})}else for(let n of e){let i=t.errors[n.error.errorId];if(i){let o=[{key:sn.PropertyKey(cr(t.errorDiscriminationStrategy.discriminant)),valueType:{type:"literal",value:{type:"stringLiteral",value:jr(Uci(i.discriminantValue))}},description:i.docs,availability:void 0,propertyAccess:void 0}];i.type!=null&&o.push({key:sn.PropertyKey(cr(t.errorDiscriminationStrategy.contentProperty)),valueType:of(i.type),description:i.docs,availability:void 0,propertyAccess:void 0}),r.push({type:i.type==null?void 0:{type:"object",extends:[],properties:o,extraProperties:void 0},statusCode:i.statusCode,isWildcard:i.isWildcardStatusCode===!0?!0:void 0,description:i.docs??void 0,availability:void 0,name:i.displayName??jr(i.name.name),examples:i.examples.map(s=>({name:FRe(s.name),responseBody:{type:"json",value:s.jsonExample},description:s.docs})),headers:i.headers!=null&&i.headers.length>0?i.headers.map(s=>({description:s.docs??void 0,key:cr(s.name),type:of(s.valueType,s.defaultValue),availability:eE(s.availability)})):void 0})}}return r}function Mls(e){let t={};for(let r of e??[]){let n=Object.values(r.v2Examples?.userSpecifiedExamples??{})[0]??Object.values(r.v2Examples?.autogeneratedExamples??{})[0];n!==void 0&&(t[cr(r.name)]=n)}return Object.keys(t).length>0?t:void 0}function $Lh({irEndpoint:e,ir:t,statusCode:r}){let n;for(let i of e.errors??[]){let o=t.errors[i.error.errorId];if(o!=null){if(o.isWildcardStatusCode!==!0&&o.statusCode===r)return o.headers;o.isWildcardStatusCode===!0&&Math.floor(o.statusCode/100)===Math.floor(r/100)&&(n=o)}}return n?.headers}function e6h({irEndpoint:e,ir:t,examples:r}){let n=r.find(s=>s.responseStatusCode<400)??r[0];if(n==null)return[];let i=new Set(r.map(s=>s.responseStatusCode)),o=[];for(let s of e.errors??[]){let a=t.errors[s.error.errorId];if(a==null||a.isWildcardStatusCode===!0||i.has(a.statusCode))continue;let c=Mls(a.headers);c!=null&&(o.push({...n,name:void 0,description:void 0,codeSamples:void 0,responseStatusCode:a.statusCode,responseBody:void 0,responseBodyV3:pTu(a,t)[0]?.responseBody,responseHeaders:c}),i.add(a.statusCode))}return o}function uTu({shouldUseExampleName:e,exampleName:t,example:r,irEndpoint:n,irService:i,ir:o}){if(r==null)return;let s=d=>{if(d.valueType.type==="container"&&d.valueType.container.type==="literal")return d.valueType.container.literal._visit({boolean:f=>`${f}`,string:f=>f,_other:()=>{}});if(d.valueType.type==="container"&&d.valueType.container.type==="optional"&&d.valueType.container.optional.type==="container"&&d.valueType.container.optional.container.type==="literal")return d.valueType.container.optional.container.literal._visit({boolean:f=>`${f}`,string:f=>f,_other:()=>{}})},a={};o.headers.forEach(d=>{let f=s(d);f!=null&&(a[cr(d.name)]=f)}),i.headers.forEach(d=>{let f=s(d);f!=null&&(a[cr(d.name)]=f)}),n.headers.forEach(d=>{let f=s(d);f!=null&&(a[cr(d.name)]=f)});let c=r.response?.body!=null?r.response.body.value:void 0,l=r.response?.statusCode??n.response?.statusCode??200,u=n.response?.statusCode??200,p=l>=400?$Lh({irEndpoint:n,ir:o,statusCode:l}):l===u?n.responseHeaders:void 0;return{name:e?t:void 0,description:"",path:r.request?.endpoint.path??"",pathParameters:r.request?.pathParameters??{},queryParameters:r.request?.queryParameters??{},headers:(()=>{let f={...r.request?.headers??{}};for(let[m,g]of Object.entries(a))(f[m]===null||f[m]===void 0)&&(f[m]=g);return f})(),requestBody:r.request?.requestBody,requestBodyV3:n.requestBody?._visit({inlinedRequestBody:()=>r.request!=null?{type:"json",value:r.request.requestBody}:void 0,reference:()=>r.request!=null?{type:"json",value:r.request.requestBody}:void 0,fileUpload:d=>{if(r.request==null)return;let f={};if(si(r.request.requestBody)){let m=r.request.requestBody;for(let g of d.properties)g._visit({file:A=>{let y=m[cr(A.key)];if(A.type==="file")f[cr(A.key)]={type:"filename",value:typeof y=="string"?y:"<file1>"};else if(A.type==="fileArray"){let I=(Array.isArray(y)?y:[y]).filter(C=>typeof C=="string");f[cr(A.key)]={type:"filenames",value:I}}},bodyProperty:A=>{if(A.style==="exploded"){let y=m[cr(A.name)];f[cr(A.name)]={type:"exploded",value:Array.isArray(y)?y:[y]}}else f[cr(A.name)]={type:"json",value:m[cr(A.name)]}},_other:Q_})}return{type:"form",value:f}},bytes:()=>{},_other:()=>{}}),responseStatusCode:l,responseBody:c??void 0,responseBodyV3:c!=null?r.response?.body?._visit({json:d=>({type:"json",value:d}),stream:d=>Array.isArray(d)&&d.length>0&&d.every(t6h)?{type:"sse",value:d}:{type:"stream",value:d},error:()=>{},_other:()=>{throw new w({message:"Unknown ExampleResponseBody: "+r.response?.body?.type,code:w.Code.InternalError})}}):void 0,responseHeaders:Mls(p),codeSamples:r.codeSamples?.map(d=>({name:d.name,description:d.docs??void 0,install:void 0,language:d.language,code:d.code})).filter(ea)}}function t6h(e){return typeof e=="object"&&e!==null&&"event"in e&&typeof e?.event=="string"&&"data"in e}function jls({userSpecifiedExample:e,autogeneratedExample:t,irEndpoint:r,ir:n}){let i=n.headers.map(c=>{let l;if(c.valueType.type==="container"&&c.valueType.container.type==="literal"?l=c.valueType.container.literal._visit({boolean:u=>`${u}`,string:u=>u,_other:()=>{}}):c.valueType.type==="container"&&c.valueType.container.type==="optional"&&c.valueType.container.optional.type==="container"&&c.valueType.container.optional.container.type==="literal"&&(l=c.valueType.container.optional.container.literal._visit({boolean:u=>`${u}`,string:u=>u,_other:()=>{}})),l!=null)return{name:c.name,value:{jsonExample:l,shape:Xt.ExampleTypeReferenceShape.primitive(Xt.ExamplePrimitive.string({original:l}))}}}).filter(ea),o=e?.example??t?.example;if(o==null)return;let{codeSamples:s}=e??{codeSamples:[]},a=Xt.http.ExampleResponse._visit(o.response,{ok:()=>r.responseHeaders,error:({error:c})=>n.errors[c.errorId]?.headers,_other:()=>r.responseHeaders});return{name:FRe(o.name),description:o.docs,path:o.url,pathParameters:[...o.rootPathParameters,...o.servicePathParameters,...o.endpointPathParameters].reduce((c,l)=>(c[sn.PropertyKey(jr(l.name))]=l.value.jsonExample,c),{}),queryParameters:o.queryParameters.reduce((c,l)=>(c[cr(l.name)]=l.value.jsonExample,c),{}),headers:[...i,...o.serviceHeaders,...o.endpointHeaders].reduce((c,l)=>(c[cr(l.name)]=l.value.jsonExample,c),{}),requestBody:o.request?.jsonExample,requestBodyV3:r.requestBody?._visit({inlinedRequestBody:()=>o.request!=null?{type:"json",value:o.request.jsonExample}:void 0,reference:()=>o.request!=null?{type:"json",value:o.request.jsonExample}:void 0,fileUpload:c=>{if(o.request==null)return;let l={};if(si(o.request.jsonExample)){let u=o.request.jsonExample;for(let p of c.properties)p._visit({file:d=>{let f=u[cr(d.key)];if(d.type==="file")l[cr(d.key)]={type:"filename",value:typeof f=="string"?f:"<file1>"};else if(d.type==="fileArray"){let m=(Array.isArray(f)?f:[f]).filter(g=>typeof g=="string");l[cr(d.key)]={type:"filenames",value:m}}},bodyProperty:d=>{if(d.style==="exploded"){let f=u[cr(d.name)];l[cr(d.name)]={type:"exploded",value:Array.isArray(f)?f:[f]}}else l[cr(d.name)]={type:"json",value:u[cr(d.name)]}},_other:Q_})}return{type:"form",value:l}},bytes:()=>{},_other:()=>{}}),responseStatusCode:Xt.http.ExampleResponse._visit(o.response,{ok:c=>r.response?.statusCode??c._visit({body:l=>l!=null?200:204,stream:l=>l.length>0?200:204,sse:l=>l.length>0?200:204,_other:()=>{throw new w({message:"Unknown ExampleResponseBody: "+c.type,code:w.Code.InternalError})}}),error:({error:c})=>{let l=n.errors[c.errorId];if(l==null)throw new w({message:"Cannot find error "+c.errorId,code:w.Code.ResolutionError});return l.statusCode},_other:()=>{throw new w({message:"Unknown ExampleResponse: "+o.response.type,code:w.Code.InternalError})}}),responseBody:o.response._visit({ok:c=>c._visit({body:l=>l?.jsonExample,stream:()=>{},sse:()=>{},_other:()=>{}}),error:c=>c.body?.jsonExample,_other:()=>{}}),responseBodyV3:o.response._visit({ok:c=>c._visit({body:l=>l!=null?{type:"json",value:l.jsonExample}:void 0,stream:l=>({type:"stream",value:l.map(u=>u.jsonExample)}),sse:l=>({type:"sse",value:l.map(({event:u,data:p})=>({event:u,data:p.jsonExample}))}),_other:()=>{throw new w({message:"Unknown ExampleResponseBody: "+c.type,code:w.Code.InternalError})}}),error:c=>c.body!=null?{type:"json",value:c.body.jsonExample}:void 0,_other:()=>{throw new w({message:"Unknown ExampleResponse: "+o.response.type,code:w.Code.InternalError})}}),responseHeaders:Mls(a),codeSamples:s?.map(c=>U6._visit(c,{language:l=>({language:l.language,code:l.code,name:FRe(l.name),description:l.docs??void 0,install:l.install}),sdk:l=>({language:l.sdk,code:l.code,name:FRe(l.name),description:l.docs??void 0,install:void 0}),_other:()=>{}})).filter(ea)}}function r6h(e,t){return t!=null?{type:{type:"formData",name:jr(t.name),description:t.docs??void 0,availability:void 0,properties:t.properties.map(r=>r._visit({file:n=>{let i=n._visit({file:o=>({type:"file",key:sn.PropertyKey(cr(o.key)),isOptional:o.isOptional,contentType:o.contentType,description:o.docs??void 0,availability:void 0}),fileArray:o=>({type:"fileArray",key:sn.PropertyKey(cr(o.key)),isOptional:o.isOptional,contentType:o.contentType,description:o.docs??void 0,availability:void 0}),_other:()=>{}});if(i!=null)return{type:"file",value:i}},bodyProperty:n=>({type:"bodyProperty",key:sn.PropertyKey(cr(n.name)),valueType:of(n.valueType,n.defaultValue),contentType:n.contentType,description:n.docs??void 0,availability:eE(n.availability),exploded:n.style==="exploded",propertyAccess:void 0}),_other:()=>{}})).filter(ea)},description:t.docs??void 0}:n6h(e)}function n6h(e){switch(e.type){case"inlinedPayload":return{type:{type:"object",extends:e.extends.map(t=>sn.TypeId(t.typeId)),properties:e.properties.map(t=>({description:t.docs??void 0,key:sn.PropertyKey(cr(t.name)),valueType:of(t.valueType),availability:eE(t.availability),propertyAccess:void 0})),extraProperties:void 0},description:void 0};case"reference":return{type:{type:"reference",value:of(e.payloadType)},description:e.docs};default:rt(e)}}function i6h(e){switch(e.type){case"inlinedBody":return{type:"object",extends:e.extends.map(t=>sn.TypeId(t.typeId)),properties:e.properties.map(t=>({description:t.docs??void 0,key:sn.PropertyKey(cr(t.name)),valueType:of(t.valueType),availability:eE(t.availability),propertyAccess:void 0})),extraProperties:void 0};case"reference":return{type:"reference",value:of(e.bodyType)};default:rt(e)}}function pTu(e,t){let r=e.v2Examples?.userSpecifiedExamples,n=e.v2Examples?.autogeneratedExamples,i=e.examples;if(r!=null&&Object.keys(r).length>0)return Object.entries(r).map(([s,a])=>({name:s,responseBody:{type:"json",value:a},description:void 0}));if(n!=null&&Object.keys(n).length>0)return Object.entries(n).map(([s,a])=>({name:s,responseBody:{type:"json",value:a},description:void 0}));if(i.length>0)return i.map(s=>({name:FRe(s.name),responseBody:{type:"json",value:s.jsonExample},description:s.docs}));let o=o6h(e,t);return o!=null?[o]:[]}function o6h(e,t){if(e.type==null||e.type.type!=="named")return;let r=e.type.typeId,n=t.types[r];if(n==null||n.shape.type!=="object")return;let i={},o=!1;for(let s of n.shape.properties){let a=cr(s.name),c=s.v2Examples;if(c?.userSpecifiedExamples!=null){let l=Object.values(c.userSpecifiedExamples);if(l.length>0){i[a]=l[0],o=!0;continue}}if(c?.autogeneratedExamples!=null){let l=Object.values(c.autogeneratedExamples);if(l.length>0){i[a]=l[0];continue}}}if(o)return{name:void 0,responseBody:{type:"json",value:i},description:void 0}}var Nls=h(()=>{"use strict";It();Mm();jn();tc();Dt();Io();Fls();Lvt()});function aO({ir:e,snippetsConfig:t,playgroundConfig:r,graphqlOperations:n={},graphqlTypes:i={},context:o,apiNameOverride:s}){let a={types:{},subpackages:{},rootPackage:Qls(e.rootPackage,e,n,i),apiName:s??jr(e.apiName),auth:iTu({auth:e.auth,playgroundConfig:r,context:o}),authSchemes:sTu({auth:e.auth,playgroundConfig:r,context:o}),snippetsConfiguration:t,globalHeaders:e.headers.map(c=>({availability:eE(c.availability),description:c.docs??void 0,key:cr(c.name),type:of(c.valueType,c.defaultValue)})),navigation:void 0};for(let[c,l]of Object.entries(e.types))a.types[sn.TypeId(c)]={description:l.docs??void 0,name:jr(l.name.name),shape:cTu(l.shape),availability:eE(l.availability),displayName:l.name.displayName};for(let[c,l]of Object.entries(i))a.types[sn.TypeId(c)]=l;for(let[c,l]of Object.entries(e.subpackages)){let u=l.service!=null?e.services[l.service]:void 0;a.subpackages[sn.SubpackageId(c)]={subpackageId:sn.SubpackageId(c),displayName:u?.displayName??l.displayName,name:jr(l.name),description:l.docs??void 0,...Qls(l,e)}}return a}var Lls=h(()=>{"use strict";Mm();aTu();Nls();Fls();Lvt()});async function _ls({organization:e,workspace:t,context:r,token:n,audiences:i,snippetsConfig:o,playgroundConfig:s,graphqlOperations:a={},graphqlTypes:c={}}){let l=Mg({workspace:t,audiences:i,generationLanguage:void 0,keywords:void 0,smartCasing:!1,exampleGeneration:{disabled:!1},readme:void 0,version:void 0,packageName:void 0,context:r,sourceResolver:new Dh(r,t)}),u=dF({token:n.value}),p=aO({ir:l,snippetsConfig:o,playgroundConfig:s,graphqlOperations:a,graphqlTypes:c,context:r});try{let d=await u.api.register.registerApiDefinition({orgId:sn.OrgId(e),apiId:sn.ApiId(jr(l.apiName)),definition:p});return r.logger.debug(`Registered API Definition ${d.apiDefinitionId}`),{id:d.apiDefinitionId,ir:l}}catch(d){return r.failAndThrow("Failed to register API",d,{code:w.Code.NetworkError})}}var fTu=h(()=>{"use strict";P2();ef();Mm();ep();Dt();Lls();Lvt()});var Nhe=h(()=>{"use strict";Lls();fTu()});function THt({ir:e,apiDefinitionId:t,playgroundConfig:r,context:n,graphqlOperations:i={},graphqlTypes:o={}}){return y7(g7(aO({ir:e,snippetsConfig:{typescriptSdk:void 0,pythonSdk:void 0,javaSdk:void 0,rubySdk:void 0,goSdk:void 0,csharpSdk:void 0,phpSdk:void 0,swiftSdk:void 0,rustSdk:void 0},playgroundConfig:r,graphqlOperations:i,graphqlTypes:o,context:n}),gfr.ApiDefinitionId(t),s6h))}var s6h,Uls=h(()=>{"use strict";Mm();Nhe();s6h=new A7({snippetsBySdkId:{},snippetsConfigWithSdkId:{},snippetTemplatesByEndpoint:{},snippetsBySdkIdAndEndpointId:{},snippetTemplatesByEndpointId:{}})});async function Iw({iconPath:e,filepaths:t}){e!=null&&typeof e=="string"&&dTu.default.isAbsolute(e)&&t.add(e)}async function mTu({parsedDocsConfig:e}){let t=new Set;if(e.logo?.dark!=null&&t.add(e.logo.dark),e.logo?.light!=null&&t.add(e.logo.light),e.favicon!=null&&t.add(e.favicon),e.backgroundImage?.dark!=null&&t.add(e.backgroundImage.dark),e.backgroundImage?.light!=null&&t.add(e.backgroundImage.light),e.metadata?.["og:image"]!=null&&e.metadata["og:image"].type==="filepath"&&t.add(e.metadata["og:image"].value),e.metadata?.["og:logo"]!=null&&e.metadata["og:logo"].type==="filepath"&&t.add(e.metadata["og:logo"].value),e.metadata?.["twitter:image"]!=null&&e.metadata["twitter:image"].type==="filepath"&&t.add(e.metadata["twitter:image"].value),e.metadata?.["og:dynamic:background-image"]!=null&&e.metadata["og:dynamic:background-image"].type==="filepath"&&t.add(e.metadata["og:dynamic:background-image"].value),e.typography?.bodyFont!=null&&e.typography.bodyFont.variants.forEach(n=>{t.add(n.absolutePath)}),e.typography?.headingsFont!=null&&e.typography.headingsFont.variants.forEach(n=>{t.add(n.absolutePath)}),e.typography?.codeFont!=null&&e.typography.codeFont.variants.forEach(n=>{t.add(n.absolutePath)}),e.navigation.type==="productgroup"&&e.navigation.products.forEach(n=>{n.image!=null&&t.add(n.image)}),(await Vls({navigation:e.navigation})).forEach(n=>{t.add(n)}),e.navbarLinks&&await Promise.all(e.navbarLinks.map(async n=>{n.type==="dropdown"&&n.links.map(async i=>{i.icon&&await Iw({iconPath:i.icon,filepaths:t}),i.rightIcon&&await Iw({iconPath:i.rightIcon,filepaths:t})}),n.type!=="github"&&(n.icon&&await Iw({iconPath:n.icon,filepaths:t}),n.rightIcon&&await Iw({iconPath:n.rightIcon,filepaths:t}))})),e.js!=null&&e.js.files.forEach(n=>{t.add(n.absolutePath)}),e.context7File!=null&&t.add(e.context7File),e.llmsTxtFile!=null&&t.add(e.llmsTxtFile),e.llmsFullTxtFile!=null&&t.add(e.llmsFullTxtFile),e.robotsTxtFile!=null&&t.add(e.robotsTxtFile),e.pageActions?.options?.custom!=null&&await Promise.all(e.pageActions.options.custom.map(async n=>{n.icon!=null&&await Iw({iconPath:n.icon,filepaths:t})})),e.translationNavigationOverlays!=null)for(let n of Object.values(e.translationNavigationOverlays))await a6h({navbarLinks:n.navbarLinks,filepaths:t});return t}async function a6h({navbarLinks:e,filepaths:t}){e!=null&&await Promise.all(e.map(async r=>{if(r.type!=="github"){if(r.type==="dropdown"){await Promise.all(r.links.map(async n=>{n.icon!=null&&await Iw({iconPath:n.icon,filepaths:t}),n.rightIcon!=null&&await Iw({iconPath:n.rightIcon,filepaths:t})})),r.icon!=null&&await Iw({iconPath:r.icon,filepaths:t}),r.rightIcon!=null&&await Iw({iconPath:r.rightIcon,filepaths:t});return}r.icon!=null&&await Iw({iconPath:r.icon,filepaths:t}),r.rightIcon!=null&&await Iw({iconPath:r.rightIcon,filepaths:t})}}))}async function Vls({navigation:e}){let t=new Set;switch(e.type){case"untabbed":await Promise.all(e.items.map(r=>$Ve({item:r,filepaths:t})));break;case"tabbed":await Promise.all(e.items.map(async r=>{r.icon!=null&&await Iw({iconPath:r.icon,filepaths:t}),r.child.type==="layout"&&r.child.layout!=null?await Promise.all(r.child.layout.map(n=>$Ve({item:n,filepaths:t}))):r.child.type==="variants"&&r.child.variants!=null&&await Promise.all(r.child.variants.flatMap(n=>{let i=[];return n.icon!=null&&i.push(Iw({iconPath:n.icon,filepaths:t})),i.push(...n.layout.map(o=>$Ve({item:o,filepaths:t}))),i}))}));break;case"versioned":await Promise.all(e.versions.map(async r=>{r.landingPage!=null&&await $Ve({item:r.landingPage,filepaths:t}),(await Vls({navigation:r.navigation})).forEach(i=>t.add(i))}));break;case"productgroup":await Promise.all(e.products.map(async r=>{r.icon!=null&&await Iw({iconPath:r.icon,filepaths:t}),r.type==="internal"&&(r.landingPage!=null&&await $Ve({item:r.landingPage,filepaths:t}),(await Vls({navigation:r.navigation})).forEach(i=>t.add(i)))})),e.changelog!=null&&await $Ve({item:e.changelog,filepaths:t});break}return t}async function $Ve({item:e,filepaths:t}){switch(e.type){case"page":e.icon!=null&&await Iw({iconPath:e.icon,filepaths:t});break;case"section":e.icon!=null&&await Iw({iconPath:e.icon,filepaths:t}),await Promise.all(e.contents.map(r=>$Ve({item:r,filepaths:t})));break;case"apiSection":e.icon!=null&&await Iw({iconPath:e.icon,filepaths:t});break;case"link":e.icon!=null&&await Iw({iconPath:e.icon,filepaths:t});break;case"changelog":e.icon!=null&&await Iw({iconPath:e.icon,filepaths:t});break}}var dTu,hTu=h(()=>{"use strict";dTu=Ae(require("path"),1)});async function gTu(e,t,r){let n=new Array(e.length),i=0,o=!1,s,a=async()=>{for(;i<e.length&&!o;){let l=i++;try{n[l]=await r(e[l],l)}catch(u){o||(o=!0,s=u)}}},c=Math.min(Math.max(1,Math.floor(t)),e.length);if(await Promise.all(Array.from({length:c},a)),o)throw s;return n}var ATu=h(()=>{"use strict"});function c6h(e,t,r){return e.replace(/\[([^\]]*)\]\(([^)]+\.mdx?(?:#[^)]*)?)\)/g,(n,i,o)=>{let s=o.indexOf("#"),a=s>=0?o.substring(0,s):o,c=s>=0?o.substring(s):"",l=CVe({href:a,metadata:r,markdownFilesToPathName:t});return l!=null&&l.type==="replace"?`[${i}](${l.slug}${c})`:n})}function Vci(e,t,r){if(e==null||typeof e!="object")return;if(Array.isArray(e)){for(let i of e)Vci(i,t,r);return}let n=e;for(let[i,o]of Object.entries(n))typeof o=="string"&&o.includes(".md")?n[i]=c6h(o,t,r):typeof o=="object"&&Vci(o,t,r)}function e5e(e,t,r){if(e==null||typeof e!="object")return;if(Array.isArray(e)){for(let i of e)e5e(i,t,r);return}let n=e;n.apiDefinitionId===t&&(n.apiDefinitionId=r);for(let i of Object.values(n))typeof i=="object"&&e5e(i,t,r)}var Gls=h(()=>{"use strict";i4()});async function yTu({navigation:e,apiWorkspaces:t,visitor:r,context:n}){u6h(e)?await Promise.all(e.map(async i=>{gde(i)?await Promise.all(i.layout.map(async o=>{await Gci({navigationItem:o,visitor:r,apiWorkspaces:t,context:n})})):Ade(i)&&await Promise.all(i.variants.flatMap(o=>o.layout.map(async s=>{await Gci({navigationItem:s,visitor:r,apiWorkspaces:t,context:n})})))})):await Promise.all(e.map(async i=>{await Gci({navigationItem:i,visitor:r,apiWorkspaces:t,context:n})}))}async function Gci({navigationItem:e,visitor:t,apiWorkspaces:r,context:n}){if(await V_(e,{alphabetized:Ot,sortByAvailability:Ot,api:Ot,apiName:Ot,specs:Ot,audiences:Ot,displayErrors:Ot,tagDescriptionPages:Ot,snippets:Ot,summary:Ot,title:Ot,layout:Ot,collapsed:Ot,icon:Ot,slug:Ot,hidden:Ot,skipSlug:Ot,paginated:Ot,playground:Ot,flattened:Ot,path:Ot,page:Ot,featureFlag:Ot,openrpc:Ot,postman:Ot,contents:async i=>{i!=null&&await Promise.all(i.map(async o=>{await Gci({navigationItem:o,visitor:t,apiWorkspaces:r,context:n})}))},viewers:Ot,orphaned:Ot,availability:Ot}),l6h(e)){let i=r.find(o=>o.workspaceName===e.apiName);i!=null&&await t.apiSection?.({config:e,workspace:i,context:n})}}function l6h(e){return e.api!=null}function u6h(e){return e[0]?.tab!=null}var bTu=h(()=>{"use strict";Zn();It()});function xN(e){return Uh(e)?e:`https://${e}`}var qls=h(()=>{"use strict";It()});function qci(){let e=process.env.FERN_DOCS_API_REGISTRATION_CONCURRENCY?.trim();return e!=null&&/^[1-9]\d*$/.test(e)?Number(e):p6h}function m6h(e){if(e!=null)return{schema:e.schema,...e.name==null?{}:{name:e.name},...e.applyTo==null?{}:{"apply-to":e.applyTo},...e.ensure==null?{}:{ensure:e.ensure.map(t=>({"status-code":t.statusCode,...t.methods==null?{}:{methods:t.methods}}))}}}function h6h(e,t){let r=e?.launch;if(e?.github==null)return{url:void 0,launch:r};let{owner:n,repo:i,branch:o="main",host:s="https://github.com"}=e.github;return{url:`${xN(s)}/${n}/${i}/blob/${o}/fern/${t}?plain=1`,launch:r}}function g6h(e){return e==null||typeof e=="string"?e:{style:e.style,alignment:e.alignment?.toUpperCase(),placement:e.placement?.toUpperCase()}}function A6h(e){if(e!=null)return{enabled:e.enabled,order:e.order,hide:e.hide,labels:e.labels,"show-products":e.showProducts}}function y6h(e){return e==null||e.light==null&&e.dark==null?{}:{"code-blocks":{light:e.light,dark:e.dark}}}function b6h(e){let t=e.findIndex(n=>n.default===!0);if(t!==-1)return t;let r=e.findIndex(n=>n.hidden!==!0);return r===-1?0:r}function E6h(e){switch(e){case"beta":return Gt.V1.NavigationV1Availability.Beta;case"deprecated":return Gt.V1.NavigationV1Availability.Deprecated;case"ga":return Gt.V1.NavigationV1Availability.GenerallyAvailable;case"stable":return Gt.V1.NavigationV1Availability.Stable;case"alpha":return Gt.V1.NavigationV1Availability.Alpha;case"preview":return Gt.V1.NavigationV1Availability.Preview;case"legacy":return Gt.V1.NavigationV1Availability.Legacy;default:rt(e)}}function STu(e){return e.flatMap(t=>{switch(t.type){case"page":case"link":return[t];case"section":case"package":{let r=STu(t.contents);return r.length===0&&t.overviewAbsolutePath==null?[]:[{type:"section",title:t.title??(t.type==="package"?t.package:""),referencedSubpackages:[],overviewAbsolutePath:t.overviewAbsolutePath,contents:r,slug:t.slug??(t.type==="package"?op(t.package):void 0),hidden:t.hidden,icon:t.icon,skipUrlSlug:t.skipUrlSlug,collapsed:t.type==="section"?t.collapsed:void 0,collapsible:t.type==="section"?t.collapsible:void 0,collapsedByDefault:t.type==="section"?t.collapsedByDefault:void 0,availability:t.availability,playground:void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}]}case"item":case"endpoint":case"operation":return[];default:rt(t)}})}var ITu,vTu,CTu,Uvt,jhe,xTu,p6h,f6h,ETu,d6h,a4,wTu=h(()=>{"use strict";yc();P2();Zn();It();i4();Mm();tr();a5o();ep();tc();fd();Cls();Dt();ITu=require("crypto"),vTu=Ae(Kkt(),1),CTu=Ae(Jkt(),1),Uvt=require("fs"),jhe=require("fs/promises"),xTu=Ae(eQ(),1);Ko();Io();X1u();Ols();$1u();gls();Als();tTu();zci();nTu();Uls();hTu();ATu();Gls();bTu();qls();vTu.default.extend(CTu.default);p6h=4;f6h=e=>e.map(t=>({...t,fileId:String(t.relativeFilePath)})),ETu=0,d6h=async({ir:e})=>(ETu++,`${_zo(e.apiName)}-${ETu}`),a4=class{domain;docsWorkspace;ossWorkspaces;apiWorkspaces;taskContext;editThisPage;uploadFiles;registerApi;onApiRegistrationQueued;onNavigationTreeBuilt;targetAudiences;docsVisibility;buildTranslatedApiDefinitions;buildRefVersions;skipApiReferences;cliVersion;cliName;refWorkspacesByFernFolder=new Map;markdownFilesToPathName={};constructor({domain:t,docsWorkspace:r,ossWorkspaces:n,apiWorkspaces:i,taskContext:o,editThisPage:s,uploadFiles:a=f6h,registerApi:c=d6h,onApiRegistrationQueued:l,onNavigationTreeBuilt:u,targetAudiences:p,docsVisibility:d="public",buildTranslatedApiDefinitions:f=!1,buildRefVersions:m=!0,skipApiReferences:g=!1,cliVersion:A,cliName:y="fern"}){this.domain=t,this.docsWorkspace=r,this.ossWorkspaces=n,this.apiWorkspaces=i,this.taskContext=o,this.editThisPage=s,this.uploadFiles=a,this.registerApi=c,this.onApiRegistrationQueued=l,this.onNavigationTreeBuilt=u,this.targetAudiences=p,this.docsVisibility=d,this.buildTranslatedApiDefinitions=f,this.buildRefVersions=m,this.skipApiReferences=g,this.cliVersion=A,this.cliName=y}#e=_ci.init();shouldIncludeByAudience(t){return!t||t.length===0||!this.targetAudiences||this.targetAudiences.length===0?!0:t.some(r=>this.targetAudiences?.includes(r))}applyAudienceFiltering(t){let r=this.filterNavigationByAudience(t.navigation);return{...t,navigation:r}}filterNavigationByAudience(t){return t.type==="untabbed"||t.type==="tabbed"?t:t.type==="versioned"?{...t,versions:t.versions.filter(r=>this.shouldIncludeByAudience(this.getRawVersionAudiences(r.version)))}:t.type==="productgroup"?{...t,products:t.products.filter(r=>{let n=this.getRawProductAudiences(r.product);return this.shouldIncludeByAudience(n)})}:t}getRawProductAudiences(t){let n=this.docsWorkspace.config.products?.find(i=>i.displayName===t);return oUt(n?.audiences)}getRawVersionAudiences(t){let n=this.docsWorkspace.config.versions?.find(i=>i.displayName===t);return oUt(n?.audiences)}_parsedDocsConfig;get parsedDocsConfig(){if(this._parsedDocsConfig==null)throw new w({message:"parsedDocsConfig is not set",code:w.Code.InternalError});return this._parsedDocsConfig}getTranslationPages(){return this._parsedDocsConfig?.translationPages}getTranslationNavigationOverlays(){return this._parsedDocsConfig?.translationNavigationOverlays}getCollectedFileIds(){return this.collectedFileIds}getDocsWorkspacePath(){return this.docsWorkspace.absoluteFilePath}getSkippedApiDefinitions(){return this.skippedApiDefinitions}getTranslatedApiSpecs(){return this.translatedApiSpecs}getMarkdownFilesToPathName(){return this.markdownFilesToPathName}getDocsTranslationsConfig(){let t=this.parsedDocsConfig.translations;if(t==null||t.length===0)return;let r=t.map(i=>Fa.DocsYmlSchemas.normalizeTranslationConfig(i)),n=r.find(i=>i.default===!0)??r[0];if(n!=null)return{defaultLocale:n.lang,translations:r.map(i=>i.lang)}}collectedFileIds=new Map;markdownFilesToFullSlugs=new Map;markdownFilesToSidebarTitle=new Map;markdownFilesToNoIndex=new Map;markdownFilesToTags=new Map;markdownFilesToAvailability=new Map;rawMarkdownFiles={};referencedMarkdownFiles=[];pendingApiRegistrations=[];pendingApiCounter=0;skippedApiCounter=0;skippedApiDefinitions={};translatedApiSpecs=new Map;async resolve(){let t=performance.now(),r=process.memoryUsage();this.referencedMarkdownFiles=[],this.taskContext.logger.debug("Parsing docs configuration...");let n=performance.now();this._parsedDocsConfig=await r4e({rawDocsConfiguration:this.docsWorkspace.config,context:this.taskContext,absolutePathToFernFolder:this.docsWorkspace.absoluteFilePath,absoluteFilepathToDocsConfig:this.docsWorkspace.absoluteFilepathToDocsConfig,buildRefVersions:this.buildRefVersions});let i=performance.now()-n,o=Object.keys(this.parsedDocsConfig.pages).length;this.taskContext.logger.debug(`Parsed docs configuration in ${i.toFixed(0)}ms: ${o} pages`),this.targetAudiences&&this.targetAudiences.length>0&&(this._parsedDocsConfig=this.applyAudienceFiltering(this._parsedDocsConfig)),this.taskContext.logger.debug("Storing raw markdown content...");for(let[qe,mt]of Object.entries(this.parsedDocsConfig.pages))this.rawMarkdownFiles[be.of(qe)]=sO(mt);let s=this.parsedDocsConfig.experimental?.openapiParserV3,a=s!=null&&!s;if(this.docsWorkspace.config.navigation!=null&&a&&!this.skipApiReferences){this.taskContext.logger.debug("Visiting navigation AST for changelog files...");let qe=performance.now();await yTu({navigation:this.docsWorkspace.config.navigation,visitor:{apiSection:async({workspace:At})=>{(await At.toFernWorkspace({context:this.taskContext},{enableUniqueErrorsPerEndpoint:!0,detectGlobalHeaders:!1,preserveSchemaIds:!0,objectQueryParameters:!0,respectReadonlySchemas:!0,docsVisibility:this.docsVisibility})).changelog?.files.forEach(er=>{let Ce=mo(this.docsWorkspace.absoluteFilePath,er.absoluteFilepath);this.parsedDocsConfig.pages[Ce]=er.contents,this.rawMarkdownFiles[be.of(Ce)]=sO(er.contents)})}},apiWorkspaces:this.apiWorkspaces,context:this.taskContext});let mt=performance.now()-qe;this.taskContext.logger.debug(`Visited navigation AST in ${mt.toFixed(0)}ms`)}this.taskContext.logger.debug("Building markdown file maps...");let c=performance.now();this.extractAllFrontmatterData(this.parsedDocsConfig.pages);let l=performance.now()-c;this.taskContext.logger.debug(`Built markdown file maps in ${l.toFixed(0)}ms`),this.taskContext.logger.debug("Replacing referenced markdown and code files...");let u=performance.now(),p=new Set,d=Object.entries(this.parsedDocsConfig.pages),f=[];for(let[,qe]of d)f.push(...xci(qe));let m=Date.now(),g=await Sci(f,this.taskContext);if(g.size>0){let qe=new Set(f).size;this.taskContext.logger.info(`Prefetched ${qe} external code URLs in ${Date.now()-m}ms`)}for(let[qe,mt]of d){let At=await Ck({markdown:mt,absolutePathToFernFolder:this.docsWorkspace.absoluteFilePath,absolutePathToMarkdownFile:this.resolveFilepath(qe),context:this.taskContext});for(let Ce of At.referencedFiles)p.has(Ce.absoluteFilePath)||(p.add(Ce.absoluteFilePath),this.referencedMarkdownFiles.push(Ce));let Ht=await r4({markdown:At.markdown,absolutePathToFernFolder:this.docsWorkspace.absoluteFilePath,absolutePathToMarkdownFile:this.resolveFilepath(qe),context:this.taskContext,urlCache:g}),er=n4({markdown:Ht,absolutePathToFernFolder:this.docsWorkspace.absoluteFilePath,absolutePathToMarkdownFile:this.resolveFilepath(qe),context:this.taskContext});this.parsedDocsConfig.pages[be.of(qe)]=er}let A=performance.now()-u;this.taskContext.logger.debug(`Replaced referenced content in ${A.toFixed(0)}ms, found ${this.referencedMarkdownFiles.length} referenced markdown files`),this.taskContext.logger.debug("Collecting files from docs config...");let y=performance.now(),I=await mTu({parsedDocsConfig:this.parsedDocsConfig}),C=performance.now()-y;this.taskContext.logger.debug(`Collected ${I.size} files in ${C.toFixed(0)}ms`);let x=await eTu({absolutePathToFernFolder:this.docsWorkspace.absoluteFilePath});x.length>0&&(this.taskContext.logger.debug(`Collected ${x.length} well-known agent skills files`),x.forEach(qe=>I.add(qe))),this.taskContext.logger.debug("Parsing image paths from markdown files...");let S=performance.now();for(let[qe,mt]of Object.entries(this.parsedDocsConfig.pages))try{let{filepaths:At,markdown:Ht}=pJ(mt,{absolutePathToMarkdownFile:this.resolveFilepath(qe),absolutePathToFernFolder:this.docsWorkspace.absoluteFilePath});this.parsedDocsConfig.pages[be.of(qe)]=Ht;for(let er of At)I.add(er)}catch(At){throw this.taskContext.logger.error(`Failed to parse ${qe}: ${tn(At)}`),new w({message:`Failed to parse markdown file ${qe}: ${tn(At)}`,code:w.Code.ParseError})}let B=performance.now()-S;this.taskContext.logger.debug(`Parsed image paths in ${B.toFixed(0)}ms`);let D=Array.from(I).map(qe=>({absoluteFilePath:qe,relativeFilePath:this.toRelativeFilepath(qe)}));this.taskContext.logger.info(`Uploading ${D.length} files...`);let R=performance.now(),O=await this.uploadFiles(D),z=performance.now()-R;this.taskContext.logger.info(`Uploaded ${O.length} files in ${z.toFixed(0)}ms`),O.forEach(qe=>{this.collectedFileIds.set(qe.absoluteFilePath,qe.fileId)}),this.resolveTranslationOverlayNavbarLinkIcons(),this.taskContext.logger.debug("Building navigation tree...");let Y=performance.now(),$=await this.toRootNode(),ee=performance.now()-Y;this.taskContext.logger.debug(`Built navigation tree in ${ee.toFixed(0)}ms`),this.onNavigationTreeBuilt?.(),this.taskContext.logger.debug("Getting fully qualified path names...");let se=performance.now(),ue=await this.getMarkdownFilesToFullyQualifiedPathNames($);this.markdownFilesToPathName=ue;let oe=performance.now()-se;if(this.taskContext.logger.debug(`Got path names in ${oe.toFixed(0)}ms`),this.pendingApiRegistrations.length>0){this.taskContext.logger.debug(`Processing ${this.pendingApiRegistrations.length} deferred API registrations...`);let qe=performance.now(),mt=this.pendingApiRegistrations,At=[],Ht=new Map;for(let ut of mt){this.resolveLinksInIrDocs(ut.ir,ue);let Ie=ut.workspace?.getSources().map(pt=>[pt.absoluteFilePath,pt.absoluteFilePathToOverrides]),we=(0,ITu.createHash)("sha256").update(JSON.stringify({ir:ut.ir,snippetsConfig:ut.snippetsConfig,playgroundConfig:ut.playgroundConfig,apiName:ut.apiName,workspace:Ie,graphqlOperations:ut.graphqlOperations,graphqlTypes:ut.graphqlTypes})).digest("hex");At.push(we),Ht.has(we)||Ht.set(we,ut)}let er=[...Ht.entries()],Ce=await gTu(er,qci(),async([,ut])=>await this.registerApi({ir:ut.ir,snippetsConfig:ut.snippetsConfig,playgroundConfig:ut.playgroundConfig,apiName:ut.apiName,workspace:ut.workspace,graphqlOperations:ut.graphqlOperations,graphqlTypes:ut.graphqlTypes})),ge=new Map(er.map(([ut],Ie)=>[ut,Ce[Ie]]));for(let[ut,Ie]of mt.entries()){let we=At[ut],pt=we!=null?ge.get(we):void 0;if(pt==null)throw new Error(`Registering API ${Ie.apiName??Ie.tempApiDefinitionId} returned no definition id`);if(e5e(Ie.apiReferenceNode,Ie.tempApiDefinitionId,pt),Ie.translatedIrsByLocale!=null)for(let[We,je]of Ie.translatedIrsByLocale){this.resolveLinksInIrDocs(je,ue);let it=this.translatedApiSpecs.get(We);it==null&&(it=new Map,this.translatedApiSpecs.set(We,it)),it.set(pt,{ir:je,snippetsConfig:Ie.snippetsConfig,playgroundConfig:Ie.playgroundConfig,apiName:Ie.apiName,graphqlOperations:Ie.graphqlOperations,graphqlTypes:Ie.graphqlTypes,workspace:Ie.workspace})}}let nt=performance.now()-qe;this.taskContext.logger.debug(`Processed deferred API registrations in ${nt.toFixed(0)}ms`),this.pendingApiRegistrations=[]}this.taskContext.logger.debug("Replacing image paths and URLs in markdown...");let me=performance.now();for(let[qe,mt]of Object.entries(this.parsedDocsConfig.pages))try{this.parsedDocsConfig.pages[be.of(qe)]=X3(mt,this.collectedFileIds,ue,{absolutePathToMarkdownFile:this.resolveFilepath(qe),absolutePathToFernFolder:this.docsWorkspace.absoluteFilePath},this.taskContext)}catch(At){throw new w({message:`Failed to replace image paths in markdown file ${qe}: ${tn(At)}`,code:w.Code.ParseError})}let xe=performance.now()-me;this.taskContext.logger.debug(`Replaced image paths in ${xe.toFixed(0)}ms`),this.taskContext.logger.debug("Building page content...");let Be={};Object.entries(this.parsedDocsConfig.pages).forEach(([qe,mt])=>{let{url:At,launch:Ht}=h6h(this.editThisPage,qe),er=this.rawMarkdownFiles[be.of(qe)];Be[BS.PageId(qe)]={markdown:sO(mt),editThisPageUrl:At?BS.Url(At):void 0,editThisPageLaunch:Ht,rawMarkdown:er}}),this.taskContext.logger.debug("Converting docs configuration...");let pe=performance.now(),ce=await this.convertDocsConfiguration($),Pe=performance.now()-pe;this.taskContext.logger.debug(`Converted docs configuration in ${Pe.toFixed(0)}ms`);let Ee={};if(this._parsedDocsConfig.experimental?.mdxComponents!=null){this.taskContext.logger.debug("Processing MDX components...");let qe=performance.now(),mt=await Rci({absolutePathToDocsWorkspace:this.docsWorkspace.absoluteFilePath,mdxComponents:this._parsedDocsConfig.experimental.mdxComponents});Ee=Object.fromEntries(await Promise.all(mt.map(async Ht=>{let er=this.toRelativeFilepath(Ht),Ce=(await(0,jhe.readFile)(Ht)).toString();return[er,await this.bundleJsFileContents(Ht,Ce)]})));let At=performance.now()-qe;this.taskContext.logger.debug(`Processed ${mt.length} MDX component files in ${At.toFixed(0)}ms`)}if(this.referencedMarkdownFiles.length>0){this.taskContext.logger.debug(`Adding ${this.referencedMarkdownFiles.length} referenced markdown files to jsFiles...`);for(let qe of this.referencedMarkdownFiles)Ee[qe.relativeFilePath]=qe.content}if(this._parsedDocsConfig.header!=null){let qe=this.toRelativeFilepath(this._parsedDocsConfig.header),mt=(await(0,jhe.readFile)(this._parsedDocsConfig.header)).toString();Ee[qe]=await this.bundleJsFileContents(this._parsedDocsConfig.header,mt),this.taskContext.logger.debug(`Added custom header component: ${qe}`)}if(this._parsedDocsConfig.footer!=null){let qe=this.toRelativeFilepath(this._parsedDocsConfig.footer),mt=(await(0,jhe.readFile)(this._parsedDocsConfig.footer)).toString();Ee[qe]=await this.bundleJsFileContents(this._parsedDocsConfig.footer,mt),this.taskContext.logger.debug(`Added custom footer component: ${qe}`)}let Fe=performance.now()-t,Le=process.memoryUsage();return this.taskContext.logger.debug(`Total resolve time: ${Fe.toFixed(0)}ms, Memory delta: RSS=${((Le.rss-r.rss)/1024/1024).toFixed(2)}MB`),{config:ce,pages:Be,jsFiles:Ee}}resolveFilepath(t){if(t!=null)return Mn(this.docsWorkspace.absoluteFilePath,t)}toRelativeFilepath(t){if(t!=null)return mo(this.docsWorkspace.absoluteFilePath,t)}extractAllFrontmatterData(t){for(let[r,n]of Object.entries(t)){let i=(0,xTu.default)(n),o=this.resolveFilepath(r),s=i.data.slug;if(typeof s=="string"&&s.trim().length>0){let p=s.trim();mvt(p)?this.markdownFilesToFullSlugs.set(o,p):this.taskContext.logger.warn(`Ignoring absolute URL slug "${p}" in ${r}. Absolute URLs are not allowed for frontmatter slugs.`)}let a=i.data["sidebar-title"];typeof a=="string"&&a.trim().length>0&&this.markdownFilesToSidebarTitle.set(o,a.trim());let c=i.data.noindex;typeof c=="boolean"&&this.markdownFilesToNoIndex.set(o,c);let l=i.data.tags;typeof l=="string"?this.markdownFilesToTags.set(o,l.split(",").map(p=>p.trim()).filter(p=>p.length>0)):Array.isArray(l)&&this.markdownFilesToTags.set(o,l);let u=i.data.availability;if(typeof u=="string"){let p=this.parseAvailabilityFromFrontmatter(u);p!=null&&this.markdownFilesToAvailability.set(o,p)}}}parseAvailabilityFromFrontmatter(t){switch(t.toLowerCase().trim()){case"stable":return"stable";case"generally-available":return"generally-available";case"in-development":return"in-development";case"pre-release":return"pre-release";case"deprecated":return"deprecated";case"beta":return"beta";default:this.taskContext.logger.warn(`Invalid availability value "${t}" in frontmatter. Valid values are: stable, generally-available, in-development, pre-release, deprecated, beta`);return}}async getMarkdownFilesToFullyQualifiedPathNames(t){let r={},n=Gt.migrate.FernNavigationV1ToLatest.create().root(t),i=new Set;Gt.traverseDF(n,a=>{a.type==="version"&&!a.default&&i.add(a.slug)});let o=a=>{let c=a.split("/");return c.some((l,u)=>i.has(c.slice(0,u+1).join("/")))};return Gt.NodeCollector.collect(n).slugMap.forEach((a,c)=>{if(a==null||!Gt.isPage(a))return;let l=Gt.getPageId(a);if(l==null)return;let u=Re(this.docsWorkspace.absoluteFilePath,be.of(l)),p=r[u];(p==null||o(p)&&!o(c))&&(r[u]=c)}),r}getDocsBasePath(){return new URL(xN(this.domain)).pathname}async convertDocsConfiguration(t){let r=this.parsedDocsConfig.integrations!=null||this.parsedDocsConfig.context7File!=null?{...this.parsedDocsConfig.integrations,context7:this.getFileId(this.parsedDocsConfig.context7File)}:void 0;return{aiChatConfig:this.parsedDocsConfig.aiChatConfig!=null?{model:this.parsedDocsConfig.aiChatConfig.model,systemPrompt:this.parsedDocsConfig.aiChatConfig.systemPrompt,location:this.parsedDocsConfig.aiChatConfig.location?.filter(i=>i==="slack"||i==="docs"),datasources:this.parsedDocsConfig.aiChatConfig.datasources?.map(i=>({url:i.url,title:i.title})),maskPii:this.parsedDocsConfig.aiChatConfig.maskPii,disclaimer:this.parsedDocsConfig.aiChatConfig.disclaimer}:void 0,hideNavLinks:void 0,title:this.parsedDocsConfig.title,logoHeight:this.parsedDocsConfig.logo?.height,logoHref:this.parsedDocsConfig.logo?.href?BS.Url(this.parsedDocsConfig.logo?.href):void 0,logoRightText:this.parsedDocsConfig.logo?.rightText,favicon:this.getFileId(this.parsedDocsConfig.favicon),navigation:void 0,root:t,colorsV3:this.convertColorConfigImageReferences(),navbarLinks:this.parsedDocsConfig.navbarLinks?.map(i=>i.type==="dropdown"?{...i,links:i.links?.map(o=>({...o,url:BS.Url(o.url),icon:this.resolveIconFileId(o.icon),rightIcon:this.resolveIconFileId(o.rightIcon)})),icon:this.resolveIconFileId(i.icon),rightIcon:this.resolveIconFileId(i.rightIcon)}:i.type==="github"?{...i,url:BS.Url(i.url)}:{...i,url:BS.Url(i.url),icon:this.resolveIconFileId(i.icon),rightIcon:this.resolveIconFileId(i.rightIcon)}),typographyV2:this.convertDocsTypographyConfiguration(),layout:this.parsedDocsConfig.layout,settings:this.convertDocsSettings(),css:this.parsedDocsConfig.css,js:this.convertJavascriptConfiguration(),agents:this.parsedDocsConfig.agents!=null||this.parsedDocsConfig.llmsTxtFile!=null||this.parsedDocsConfig.llmsFullTxtFile!=null||this.parsedDocsConfig.robotsTxtFile!=null||this.parsedDocsConfig.experimental?.robotsTxtOnInstanceUrl===!0?{...this.parsedDocsConfig.agents,llmsTxt:this.getFileId(this.parsedDocsConfig.llmsTxtFile),llmsFullTxt:this.getFileId(this.parsedDocsConfig.llmsFullTxtFile),robotsTxt:this.getFileId(this.parsedDocsConfig.robotsTxtFile),robotsTxtOnInstanceUrl:this.parsedDocsConfig.experimental?.robotsTxtOnInstanceUrl}:void 0,metadata:this.convertMetadata(),redirects:this.parsedDocsConfig.redirects,integrations:r,footerLinks:this.parsedDocsConfig.footerLinks?.map(i=>({...i,value:BS.Url(i.value)})),defaultLanguage:this.parsedDocsConfig.defaultLanguage,languages:this.parsedDocsConfig.languages,translations:this.getDocsTranslationsConfig(),analyticsConfig:{...this.parsedDocsConfig.analyticsConfig,segment:this.parsedDocsConfig.analyticsConfig?.segment,fullstory:this.parsedDocsConfig.analyticsConfig?.fullstory,intercom:this.parsedDocsConfig.analyticsConfig?.intercom?{appId:this.parsedDocsConfig.analyticsConfig.intercom.appId,apiBase:this.parsedDocsConfig.analyticsConfig.intercom.apiBase}:void 0,posthog:this.parsedDocsConfig.analyticsConfig?.posthog?{apiKey:this.parsedDocsConfig.analyticsConfig.posthog.apiKey,endpoint:this.parsedDocsConfig.analyticsConfig.posthog.endpoint}:void 0,gtm:this.parsedDocsConfig.analyticsConfig?.gtm?{containerId:this.parsedDocsConfig.analyticsConfig.gtm.containerId}:void 0,ga4:this.parsedDocsConfig.analyticsConfig?.ga4?{measurementId:this.parsedDocsConfig.analyticsConfig.ga4.measurementId}:void 0,amplitude:void 0,mixpanel:void 0,hotjar:void 0,koala:void 0,logrocket:void 0,pirsch:void 0,plausible:void 0,fathom:void 0,clearbit:void 0,heap:void 0},announcement:this.parsedDocsConfig.announcement!=null?{text:this.parsedDocsConfig.announcement.message}:void 0,editThisPageLaunch:this.editThisPage?.launch,embedding:this.parsedDocsConfig.settings?.embedding!=null?{allowedOrigins:this.parsedDocsConfig.settings.embedding.allowedOrigins}:void 0,pageActions:this.convertPageActions(),theme:this.parsedDocsConfig.theme!=null?{sidebar:this.parsedDocsConfig.theme.sidebar,body:this.parsedDocsConfig.theme.body,tabs:g6h(this.parsedDocsConfig.theme.tabs),"page-actions":this.parsedDocsConfig.theme.pageActions,footerNav:this.parsedDocsConfig.theme.footerNav,"language-switcher":this.parsedDocsConfig.theme.languageSwitcher,"product-switcher":this.parsedDocsConfig.theme.productSwitcher,"site-switcher":A6h(this.parsedDocsConfig.theme.siteSwitcher),...y6h(this.parsedDocsConfig.theme.codeBlocks)}:void 0,logo:void 0,logoV2:void 0,colors:void 0,colorsV2:void 0,typography:void 0,backgroundImage:void 0,header:this.parsedDocsConfig.header?this.toRelativeFilepath(this.parsedDocsConfig.header):void 0,footer:this.parsedDocsConfig.footer?this.toRelativeFilepath(this.parsedDocsConfig.footer):void 0}}async bundleJsFileContents(t,r){try{return await Dci({absoluteFilePath:t,contents:r,context:this.taskContext})??r}catch(n){throw new w({message:`Failed to bundle third-party imports in ${t}: ${tn(n)}`,code:w.Code.ParseError})}}async resolveApiWorkspaces(t){if(t==null)return{apiWorkspaces:this.apiWorkspaces,ossWorkspaces:this.ossWorkspaces};let r=t.absolutePathToFernFolder,n=this.refWorkspacesByFernFolder.get(r);if(n!=null)return n;if(this.cliVersion==null)throw new w({message:`Cannot load API definitions for version '${t.displayVersion}' (ref '${t.ref}'): the CLI version is unavailable in this context.`,code:w.Code.InternalError});let i=this.cliVersion,o=(async()=>{let s=await Nci({cliName:this.cliName,fernDirectory:r,context:this.taskContext,cliVersion:i,commandLineApiWorkspace:void 0,defaultToAllApiWorkspaces:!0}),a=s.filter(c=>c instanceof gl);return{apiWorkspaces:s,ossWorkspaces:a}})();return this.refWorkspacesByFernFolder.set(r,o),o}getFernWorkspaceForApiSection(t,r){if(t.apiName!=null){let i=r.find(o=>o.workspaceName===t.apiName);if(i!=null)return i}else if(r.length===1&&r[0]!=null)return r[0];let n=t.apiName?`Failed to load API Definition '${t.apiName}' referenced in docs.
|
|
1843
|
+
${i.description}`;return this.#f.set(s,c),this.markdownFilesToNoIndex.set(s,!1),this.markdownFilesToTags.set(s,[n]),a}#h(t,r,n,i){r=this.#e.resolveSubpackage(r);let o=r!=null?kRe.getSubpackageId(r):void 0;return t.map(s=>YY(s)._visit({link:a=>({id:this.#p.get(a.url),type:"link",collapsed:void 0,title:a.text,icon:this.resolveIconFileId(a.icon),url:Gt.Url(a.url),target:a.target}),page:a=>this.#g(a,n,i),package:a=>this.#E(a,n,i),section:a=>this.#b(a,n,i),item:({value:a})=>this.#C(a,o,n,i),endpoint:a=>this.#I(a,o,n,i),operation:a=>this.#y(a,o,n,i)})).filter(ea)}#g(t,r,n){return H1u({page:{...t,availability:t.availability??n},parentSlug:r,docsWorkspace:this.docsWorkspace,markdownFilesToFullSlugs:this.markdownFilesToFullSlugs,markdownFilesToNoIndex:this.markdownFilesToNoIndex,idgen:this.#p,hideChildren:this.hideChildren,resolveIconFileId:this.resolveIconFileId.bind(this)})}#E(t,r,n){let i=t.overviewAbsolutePath!=null?Gt.V1.PageId(Mvt(this.docsWorkspace,t.overviewAbsolutePath)):void 0,o=t.overviewAbsolutePath!=null?this.markdownFilesToFullSlugs.get(t.overviewAbsolutePath):void 0,s=t.availability??n,a=this.#e.getSubpackageByIdOrLocator(t.package);if(a!=null){let c=kRe.getSubpackageId(a),l=i??this.createTagDescriptionPageId(a,t.package),u=this.#p.get(l??`${this.apiDefinitionId}:${c}`);this.#s.has(c)&&this.taskContext.logger.warn(Mci(t.package)),this.#s.add(c),this.#a.set(u,[c]);let p=t.slug??(gJ(a)?a.urlSlug:this.apiSection.slug??op(this.apiSection.title)),d=r.apply({fullSlug:o?.split("/"),skipUrlSlug:t.skipUrlSlug,urlSlug:p}),f=this.#h(t.contents,a,d,s);return{id:u,type:"apiPackage",collapsed:void 0,children:f,title:t.title??(gJ(a)?a.displayName??WO(a.name):this.apiSection.title),slug:d.get(),icon:this.resolveIconFileId(t.icon),hidden:this.hideChildren||t.hidden,overviewPageId:l,collapsible:void 0,collapsedByDefault:void 0,availability:Gg(s),apiDefinitionId:this.apiDefinitionId,pointsTo:void 0,noindex:void 0,playground:this.#T(t.playground),authed:void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}}else{this.taskContext.logger.warn(Qci(t.package,this.#e.subpackageLocators));let c=t.slug??op(t.package),l=r.apply({fullSlug:o?.split("/"),skipUrlSlug:t.skipUrlSlug,urlSlug:c}),u=this.#h(t.contents,void 0,l,s);return{id:this.#p.get(i??`${this.apiDefinitionId}:${op(t.package)}`),type:"apiPackage",collapsed:void 0,children:u,title:t.title??t.package,slug:l.get(),icon:this.resolveIconFileId(t.icon),hidden:this.hideChildren||t.hidden,overviewPageId:i,collapsible:void 0,collapsedByDefault:void 0,availability:Gg(s),apiDefinitionId:this.apiDefinitionId,pointsTo:void 0,noindex:void 0,playground:this.#T(t.playground),authed:void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}}}#b(t,r,n){let i=t.overviewAbsolutePath!=null?Gt.V1.PageId(Mvt(this.docsWorkspace,t.overviewAbsolutePath)):void 0,o=t.overviewAbsolutePath!=null?this.markdownFilesToFullSlugs.get(t.overviewAbsolutePath):void 0,s=t.overviewAbsolutePath!=null?this.markdownFilesToNoIndex.get(t.overviewAbsolutePath):void 0,a=this.#p.get(i??o??r.get()),c=t.referencedSubpackages.map(f=>{let m=this.#e.getSubpackageByIdOrLocator(f),g=m!=null?kRe.getSubpackageId(m):void 0;if(g===void 0){this.taskContext.logger.error(Qci(f,this.#e.subpackageLocators));return}return{subpackageId:g,locator:f}}).filter(f=>f!=null).filter(ea);this.#a.set(a,c.map(f=>f.subpackageId)),c.forEach(f=>{this.#s.has(f.subpackageId)&&this.taskContext.logger.error(Mci(f.locator)),this.#s.add(f.subpackageId)});let l=t.slug??op(t.title),u=r.apply({fullSlug:o?.split("/"),skipUrlSlug:t.skipUrlSlug,urlSlug:l}),p=t.availability??n,d=this.#h(t.contents,void 0,u,p);return{id:a,type:"apiPackage",children:d,title:t.title,slug:u.get(),icon:this.resolveIconFileId(t.icon),hidden:this.hideChildren||t.hidden,overviewPageId:i,collapsed:t.collapsed,collapsible:t.collapsible,collapsedByDefault:t.collapsedByDefault,availability:Gg(p),apiDefinitionId:this.apiDefinitionId,pointsTo:void 0,noindex:s,playground:this.#T(t.playground),authed:void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}}#C(t,r,n,i){t=t.trim();let o=this.#e.getSubpackageByIdOrLocator(t)??this.#e.getSubpackageByIdOrLocator(oo(t));if(o!=null){let s=kRe.getSubpackageId(o),a=this.#p.get(`${this.apiDefinitionId}:${s}`);this.#s.has(s)&&this.taskContext.logger.error(Mci(t)),this.#s.add(s),this.#a.set(a,[s]);let c=gJ(o)?o.urlSlug:"",l=n.apply({urlSlug:c});return{id:a,type:"apiPackage",collapsed:void 0,children:[],title:gJ(o)?o.displayName??WO(o.name):this.apiSection.title,slug:l.get(),icon:void 0,hidden:this.hideChildren,overviewPageId:this.createTagDescriptionPageId(o,t),collapsible:void 0,collapsedByDefault:void 0,availability:Gg(i),apiDefinitionId:this.apiDefinitionId,pointsTo:void 0,noindex:void 0,playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}}return this.#I({type:"endpoint",endpoint:t,title:void 0,icon:void 0,slug:void 0,hidden:void 0,availability:void 0,playground:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0},r,n,i)}#I(t,r,n,i){let o=(r!=null?this.#e.subpackages.get(Tb.SubpackageId(r))?.endpoints.get(Tb.EndpointId(t.endpoint)):void 0)??this.#e.endpointsByLocator.get(t.endpoint);if(o!=null){let l=this.#e.getEndpointId(o);if(l==null)this.taskContext.logger.debug(`Expected Endpoint ID for ${o.id} at path: ${jci(o.method,o.path.parts)}. Got undefined.`);else{this.#t.has(l)&&this.taskContext.logger.error(`Duplicate endpoint found in the API Reference layout: ${l}`),this.#t.add(l);let u=t.slug!=null?n.append(t.slug):n.apply(o);return{id:this.#p.get(`${this.apiDefinitionId}:${l}`),type:"endpoint",collapsed:void 0,method:o.method,endpointId:l,apiDefinitionId:this.apiDefinitionId,availability:Gg(t.availability)??Gt.V1.convertAvailability(o.availability)??Gg(i),isResponseStream:o.response?.type.type==="stream",title:t.title??o.name??xk(o.path.parts),slug:u.get(),icon:this.resolveIconFileId(t.icon),hidden:this.hideChildren||t.hidden,playground:this.#T(o.includeInApiExplorer===!1?{...t.playground,hidden:!0}:t.playground),authed:void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}}}let s=(r!=null?this.#e.subpackages.get(Tb.SubpackageId(r))?.webSockets.get(Tb.WebSocketId(t.endpoint)):void 0)??this.#e.webSocketsByLocator.get(t.endpoint);if(s!=null){let l=this.#e.getWebSocketId(s);if(l==null)this.taskContext.logger.error(`Expected WebSocket ID for ${s.id}. Got undefined.`);else return this.#r.has(l)&&this.taskContext.logger.error(`Duplicate web socket found in the API Reference layout: ${l}`),this.#r.add(l),{id:this.#p.get(`${this.apiDefinitionId}:${l}`),type:"webSocket",collapsed:void 0,webSocketId:l,title:t.title??s.name??xk(s.path.parts),slug:(t.slug!=null?n.append(t.slug):n.apply(s)).get(),icon:this.resolveIconFileId(t.icon),hidden:this.hideChildren||t.hidden,apiDefinitionId:this.apiDefinitionId,availability:Gg(t.availability)??Gt.V1.convertAvailability(s.availability)??Gg(i),playground:this.#T(t.playground),authed:void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}}let a=(r!=null?this.#e.subpackages.get(Tb.SubpackageId(r))?.webhooks.get(Tb.WebhookId(t.endpoint)):void 0)??this.#e.webhooks.get(Gt.V1.WebhookId(t.endpoint));if(a!=null){let l=this.#e.getWebhookId(a);if(l==null)this.taskContext.logger.error(`Expected Webhook ID for ${a.id}. Got undefined.`);else return this.#n.has(l)&&this.taskContext.logger.error(`Duplicate webhook found in the API Reference layout: ${l}`),this.#n.add(l),{id:this.#p.get(`${this.apiDefinitionId}:${l}`),type:"webhook",collapsed:void 0,webhookId:l,method:a.method,title:t.title??a.name??(0,Y1u.default)("/",...a.path),slug:(t.slug!=null?n.append(t.slug):n.apply(a)).get(),icon:this.resolveIconFileId(t.icon),hidden:this.hideChildren||t.hidden,apiDefinitionId:this.apiDefinitionId,availability:Gg(t.availability)??Gt.V1.convertAvailability(a.availability)??Gg(i),authed:void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}}let c=this.#e.api.rootPackage.graphqlOperations?.find(l=>l.id===t.endpoint||l.name===t.endpoint);if(c!=null){let l=Tb.GraphQlOperationId(c.id);if(this.#o.has(l)){this.taskContext.logger.error(`Duplicate GraphQL operation found in the API Reference layout: ${l}`);return}this.#o.add(l);let u=t.slug!=null?n.append(t.slug):n.append(c.name??c.id);return this.#S({id:this.#p.get(`${this.apiDefinitionId}:${l}`),operationType:c.operationType,graphqlOperationId:Tb.GraphQlOperationId(c.id),title:t.title??c.displayName??c.name??c.id,slug:u.get(),availability:t.availability??i,icon:this.resolveIconFileId(t.icon),hidden:this.hideChildren||t.hidden,playground:this.#T(t.playground),viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags})}this.taskContext.logger.error("Unknown identifier in the API Reference layout: ",t.endpoint)}#y(t,r,n,i){let o=t.operation.trim().split(/\s+/,2);if(o.length!==2){this.taskContext.logger.error(`Invalid operation format in the API Reference layout: ${t.operation}. Expected format: "OPERATION_TYPE operationName" (e.g., "QUERY account")`);return}let[s,a]=o;if(!a){this.taskContext.logger.error(`Invalid operation format in the API Reference layout: ${t.operation}. Expected format: "OPERATION_TYPE operationName" (e.g., "QUERY account")`);return}let c=this.#e.api.rootPackage.graphqlOperations??[],l=c.filter(f=>{if(f.operationType!==s)return!1;if(a.includes(".")){if(f.id===a||f.name===a)return!0;let m=a.split("."),g=m[m.length-1],A=m.slice(0,-1).join(".");if(f.name===g||f.id===g)return f.id.startsWith(A+".")||this.#u.get(sn.GraphQlOperationId(f.id))===A}else return f.name===a||f.id===a;return!1});if(!a.includes(".")){let f=c.filter(m=>m.operationType===s&&(m.name===a||m.id===a));if(f.length>1){let m=f.map(g=>{let A=this.#u.get(sn.GraphQlOperationId(g.id));if(A)return`"${s} ${A}.${a}"`;let y=g.id.split("_");if(y.length>=3){let I=y[0];return`"${s} ${I}.${a}"`}return`"${s} ${g.id}"`}).join(", ");this.taskContext.logger.warn(`Ambiguous operation reference: "${t.operation}". Found ${f.length} operations with name "${a}". Using first match: "${m.split(", ")[0]}". Please use the full namespaced format for clarity. Available options: ${m}`)}}let u=l[0];if(u==null){this.taskContext.logger.error(`GraphQL operation not found in the API Reference layout: ${t.operation}`);return}let p=Tb.GraphQlOperationId(u.id);if(this.#o.has(p)){this.taskContext.logger.error(`Duplicate GraphQL operation found in the API Reference layout: ${p}`);return}this.#o.add(p);let d=t.slug!=null?n.append(t.slug):n.append(u.name??u.id);return this.#S({id:this.#p.get(`${this.apiDefinitionId}:${p}`),operationType:u.operationType,graphqlOperationId:Tb.GraphQlOperationId(u.id),title:t.title??u.displayName??u.name??u.id,slug:d.get(),availability:t.availability??i,hidden:this.hideChildren||t.hidden,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags})}#v(t,r){return U1u({left:t,right:r,findEndpointById:n=>this.#e.endpoints.get(n),stringifyEndpointPathParts:n=>xk(n.path.parts),disableEndpointPairs:this.disableEndpointPairs,apiDefinitionId:this.apiDefinitionId})}#x(t,r){return Pls({child:t,nodeIdToSubpackageId:this.#a,convertApiDefinitionPackageId:(n,i,o)=>this.#N(n,i,o),mergeAndFilterChildren:this.#v.bind(this)})}#w(t,r,n){let i=[];if(t.endpoints.forEach(o=>{if(o.protocol?.type==="grpc"){let s=this.#e.getGrpcId(o);if(s==null){this.taskContext.logger.error(`Expected Grpc ID for ${o.id} at path: ${jci(o.method,o.path.parts)}. Got undefined.`);return}if(this.#i.has(s))return;let a=r.apply(o);i.push({id:Gt.V1.NodeId(`${this.apiDefinitionId}:${s}`),type:"grpc",collapsed:void 0,grpcId:s,title:o.name??xk(o.path.parts),method:o.protocol?.methodType??"UNARY",apiDefinitionId:this.apiDefinitionId,availability:Gg(n),slug:a.get(),icon:void 0,hidden:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0})}else{let s=this.#e.getEndpointId(o);if(s==null){this.taskContext.logger.debug(`Expected Endpoint ID for ${o.id} at path: ${jci(o.method,o.path.parts)}. Got undefined.`);return}if(this.#t.has(s))return;let a=r.apply(o);i.push({id:Gt.V1.NodeId(`${this.apiDefinitionId}:${s}`),type:"endpoint",collapsed:void 0,method:o.method,endpointId:s,apiDefinitionId:this.apiDefinitionId,availability:Gt.V1.convertAvailability(o.availability)??Gg(n),isResponseStream:o.response?.type.type==="stream",title:o.name??xk(o.path.parts),slug:a.get(),icon:void 0,hidden:this.hideChildren,playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0})}}),t.websockets.forEach(o=>{let s=this.#e.getWebSocketId(o);if(s==null){this.taskContext.logger.error(`Expected WebSocket ID for ${o.id}. Got undefined.`);return}this.#r.has(s)||i.push({id:Gt.V1.NodeId(`${this.apiDefinitionId}:${s}`),type:"webSocket",collapsed:void 0,webSocketId:s,title:o.name??xk(o.path.parts),slug:r.apply(o).get(),icon:void 0,hidden:this.hideChildren,apiDefinitionId:this.apiDefinitionId,availability:Gt.V1.convertAvailability(o.availability)??Gg(n),playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0})}),t.webhooks.forEach(o=>{let s=this.#e.getWebhookId(o);if(s==null){this.taskContext.logger.error(`Expected Webhook ID for ${o.id}. Got undefined.`);return}this.#n.has(s)||i.push({id:Gt.V1.NodeId(`${this.apiDefinitionId}:${s}`),type:"webhook",collapsed:void 0,webhookId:s,method:o.method,title:o.name??WO(o.id),slug:r.apply(o).get(),icon:void 0,hidden:this.hideChildren,apiDefinitionId:this.apiDefinitionId,availability:Gt.V1.convertAvailability(o.availability)??Gg(n),authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0})}),t.subpackages.forEach(o=>{if(this.#s.has(o))return;let s=this.#e.getSubpackageByIdOrLocator(o);if(s==null){this.taskContext.logger.error(`Subpackage ${o} not found in ${this.apiDefinitionId}`);return}let a=gJ(s)?r.apply(s):r,c=this.#N(o,a,n),l=this.createTagDescriptionPageId(s),u=this.#e.subpackages.get(Tb.SubpackageId(o)),p=u?Array.from(u.endpoints.values()).some(d=>{let f=this.#e.getEndpointId(d);return f!=null&&this.#t.has(f)}):!1;(c.length>0||l!=null&&p)&&i.push({id:Gt.V1.NodeId(`${this.apiDefinitionId}:${o}`),type:"apiPackage",collapsed:void 0,children:c,title:gJ(s)?s.displayName??WO(s.name):this.apiSection.title,slug:a.get(),icon:void 0,hidden:this.hideChildren,overviewPageId:l,collapsible:void 0,collapsedByDefault:void 0,availability:Gg(n),apiDefinitionId:this.apiDefinitionId,pointsTo:void 0,noindex:void 0,playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0})}),t.graphqlOperations!=null&&t.graphqlOperations.length>0){let o=this.#A(t.graphqlOperations,r,n);i.push(...o)}if(t===this.#e.api.rootPackage){let o=this.#D(r,n);o!=null&&i.push(o)}return i=this.mergeEndpointPairs(i),this.apiSection.alphabetized&&(i=i.sort((o,s)=>{let a=o.type==="endpointPair"?o.nonStream.title:o.title,c=s.type==="endpointPair"?s.nonStream.title:s.title;return a.localeCompare(c)})),this.apiSection.sortByAvailability!=null&&(i=q1u(i,this.apiSection.sortByAvailability)),i}#A(t,r,n){let i={},o={};for(let l of t){let u=Tb.GraphQlOperationId(l.id);if(this.#o.has(u))continue;this.#o.add(u);let p=this.#u.get(sn.GraphQlOperationId(l.id)),d=l.operationType;p!=null?(i[p]==null&&(i[p]={}),i[p][d]==null&&(i[p][d]=[]),i[p][d].push(l)):(o[d]==null&&(o[d]=[]),o[d].push(l))}let s=[],a=["QUERY","MUTATION","SUBSCRIPTION"],c={QUERY:"Queries",MUTATION:"Mutations",SUBSCRIPTION:"Subscriptions"};for(let[l,u]of Object.entries(i)){let p=r.append(op(l)),d=[];for(let m of a){let g=u[m];if(g==null||g.length===0)continue;let A=c[m],y=p.append(op(A)),I=this.#O(g,y,n,m),C={id:this.#p.get(`${this.apiDefinitionId}:graphql:${l}:${m}`),type:"apiPackage",collapsed:void 0,children:I,title:A,slug:y.get(),icon:void 0,hidden:this.hideChildren,overviewPageId:void 0,collapsible:void 0,collapsedByDefault:void 0,availability:Gg(n),apiDefinitionId:this.apiDefinitionId,pointsTo:void 0,noindex:void 0,playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0};d.push(C)}let f={id:this.#p.get(`${this.apiDefinitionId}:graphql:namespace:${l}`),type:"apiPackage",collapsed:void 0,children:d,title:WO(l),slug:p.get(),icon:void 0,hidden:this.hideChildren,overviewPageId:void 0,collapsible:void 0,collapsedByDefault:void 0,availability:Gg(n),apiDefinitionId:this.apiDefinitionId,pointsTo:void 0,noindex:void 0,playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0};s.push(f)}for(let l of a){let u=o[l];if(u==null||u.length===0)continue;let p=c[l],d=r.append(op(p)),f=this.#O(u,d,n,l),m={id:this.#p.get(`${this.apiDefinitionId}:graphql:${l}`),type:"apiPackage",collapsed:void 0,children:f,title:p,slug:d.get(),icon:void 0,hidden:this.hideChildren,overviewPageId:void 0,collapsible:void 0,collapsedByDefault:void 0,availability:Gg(n),apiDefinitionId:this.apiDefinitionId,pointsTo:void 0,noindex:void 0,playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0};s.push(m)}return s}#D(t,r){let n=new Map;for(let[s,a]of Object.entries(this.#m)){let c=sn.TypeId(s);if(this.#e.api.types[c]==null)continue;let l=n.get(a);l!=null?l.push(c):n.set(a,[c])}if(n.size===0)return;let i=t.append(PLh),o=[];for(let{category:s,title:a,urlSlug:c}of OLh){let l=n.get(s);if(l==null||l.length===0)continue;let u=i.append(c),p=l.map(d=>this.#B(d,s,u,r)).filter(ea).sort((d,f)=>d.title.localeCompare(f.title));p.length!==0&&o.push({id:this.#p.get(`${this.apiDefinitionId}:graphql:types:${s}`),type:"apiPackage",collapsed:void 0,children:p,title:a,slug:u.get(),icon:void 0,hidden:this.hideChildren,overviewPageId:void 0,collapsible:void 0,collapsedByDefault:void 0,availability:Gg(r),apiDefinitionId:this.apiDefinitionId,pointsTo:void 0,noindex:void 0,playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0})}if(o.length!==0)return{id:this.#p.get(`${this.apiDefinitionId}:graphql:types`),type:"apiPackage",collapsed:void 0,children:o,title:BLh,slug:i.get(),icon:void 0,hidden:this.hideChildren,overviewPageId:void 0,collapsible:void 0,collapsedByDefault:void 0,availability:Gg(r),apiDefinitionId:this.apiDefinitionId,pointsTo:void 0,noindex:void 0,playground:void 0,authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}}#B(t,r,n,i){let o=this.#e.api.types[t];if(o==null)return;let s=o.displayName??o.name??t;return{id:this.#p.get(`${this.apiDefinitionId}:graphqlType:${t}`),type:"graphqlType",collapsed:void 0,typeId:Gt.TypeId(t),typeCategory:r,title:s,slug:n.append(op(s)).get(),icon:void 0,hidden:this.hideChildren,apiDefinitionId:this.apiDefinitionId,availability:Gt.V1.convertAvailability(o.availability)??Gg(i),authed:void 0,viewers:void 0,orphaned:void 0,featureFlags:void 0}}#S({id:t,operationType:r,graphqlOperationId:n,graphqlOperationIds:i,title:o,slug:s,availability:a,hidden:c,icon:l,playground:u,viewers:p,orphaned:d,featureFlags:f}){return{id:t,type:"graphql",collapsed:void 0,operationType:r,graphqlOperationId:n,graphqlOperationIds:i,apiDefinitionId:this.apiDefinitionId,availability:Gg(a),title:o,slug:s,icon:l,hidden:c,playground:u,authed:void 0,viewers:p,orphaned:d,featureFlags:f}}#O(t,r,n,i){let o=i==="QUERY",s=new Map,a=[];for(let u of t){let p=kls(u)?.[0];if(o&&p!=null){let d=s.get(p);d!=null?d.push(u):(s.set(p,[u]),a.push({type:"group",parentField:p}))}else a.push({type:"flat",operation:u})}let c=new Map;for(let u of a)if(u.type==="flat"){let p=J1u(u.operation);s.has(p)&&kls(u.operation)==null&&c.set(p,u.operation)}let l=[];for(let u of a)if(u.type==="flat"){let p=J1u(u.operation);if(c.has(p))continue;let d=kls(u.operation),f=r;if(d!=null&&d.length>0)for(let m of d)f=f.append(op(m));f=f.append(op(p)),l.push(this.#S({id:Gt.V1.NodeId(`${this.apiDefinitionId}:${u.operation.id}`),operationType:u.operation.operationType,graphqlOperationId:Tb.GraphQlOperationId(u.operation.id),title:u.operation.displayName??u.operation.name??u.operation.id,slug:f.get(),availability:n,hidden:this.hideChildren}))}else{let p=s.get(u.parentField)??[],f=c.get(u.parentField)??p[0];if(f==null)continue;let m=r.append(op(u.parentField));l.push(this.#S({id:Gt.V1.NodeId(`${this.apiDefinitionId}:${f.id}`),operationType:f.operationType,graphqlOperationId:Tb.GraphQlOperationId(f.id),graphqlOperationIds:p.map(g=>Tb.GraphQlOperationId(g.id)),title:u.parentField,slug:m.get(),availability:n,hidden:this.hideChildren}))}return l}#N(t,r,n){let i=t!=null?this.#e.resolveSubpackage(this.#e.getSubpackageByIdOrLocator(t)):void 0;return i==null?(this.taskContext.logger.debug(Qci(t||"unknown",[])),[]):this.#w(i,r,n)}#T(t){return O1u(t)}mergeEndpointPairs(t){return Lci({children:t,findEndpointById:r=>this.#e.endpoints.get(r),stringifyEndpointPathParts:r=>xk(r.path.parts),disableEndpointPairs:this.disableEndpointPairs,apiDefinitionId:this.apiDefinitionId})}getFileId(t){let r=this.collectedFileIds.get(t);return r??this.taskContext.failAndThrow("Failed to locate file after uploading: "+t,void 0,{code:w.Code.InternalError})}resolveIconFileId(t){if(t!=null)return this.collectedFileIds.has(t)?`file:${this.getFileId(t)}`:t}}});function DLh(e){return Z1u.default.createHash("sha256").update(e).digest("hex")}var Z1u,_ci,$1u=h(()=>{"use strict";Mm();Dt();Z1u=Ae(require("crypto"),1);_ci=class e{static init(){return new e}constructor(){}#e=new Map;#t=new Set;#r(t){let r=this.#e.get(t)??0;return this.#e.set(t,r+1),DLh(r===0?t:`${t}-${r}`)}#n(t){let r=this.#r(t),n=0;for(;this.#t.has(r);)if(r=this.#r(t),n++,n>100)throw new w({message:`Infinite loop detected for id: ${t}`,code:w.Code.ReferenceError});return r}get(t){return Gt.V1.NodeId(this.#n(t))}}});async function eTu({absolutePathToFernFolder:e}){let t=[];for(let r of RLh){let n=Re(e,r);if(await Ut(n)){let i=await BRt(n);t.push(...i.map(Zt.of))}}return t}var RLh,tTu=h(()=>{"use strict";tr();RLh=[be.of(".well-known/skills"),be.of(".well-known/agent-skills")]});function rTu(e){return e==null?{}:{pythonSdk:e.python!=null?{package:typeof e.python=="string"?e.python:e.python.package,version:typeof e.python=="string"?void 0:e.python.version}:void 0,typescriptSdk:e.typescript!=null?{package:typeof e.typescript=="string"?e.typescript:e.typescript.package,version:typeof e.typescript=="string"?void 0:e.typescript.version}:void 0,goSdk:e.go!=null?{githubRepo:typeof e.go=="string"?e.go:e.go.package,version:typeof e.go=="string"?void 0:e.go.version}:void 0,javaSdk:e.java!=null?{coordinate:typeof e.java=="string"?e.java:e.java.package,version:typeof e.java=="string"?void 0:e.java.version}:void 0,rubySdk:e.ruby!=null?{gem:typeof e.ruby=="string"?e.ruby:e.ruby.package,version:typeof e.ruby=="string"?void 0:e.ruby.version}:void 0,csharpSdk:e.csharp!=null?{package:typeof e.csharp=="string"?e.csharp:e.csharp.package,version:typeof e.csharp=="string"?void 0:e.csharp.version}:void 0,phpSdk:e.php!=null?{package:typeof e.php=="string"?e.php:e.php.package,version:typeof e.php=="string"?void 0:e.php.version}:void 0,swiftSdk:e.swift!=null?{package:typeof e.swift=="string"?e.swift:e.swift.package,version:typeof e.swift=="string"?void 0:e.swift.version}:void 0,rustSdk:e.rust!=null?{package:typeof e.rust=="string"?e.rust:e.rust.package,version:typeof e.rust=="string"?void 0:e.rust.version}:void 0,cliSdk:e.cli!=null?{package:typeof e.cli=="string"?e.cli:e.cli.package,version:typeof e.cli=="string"?void 0:e.cli.version}:void 0}}var nTu=h(()=>{"use strict"});function Uci(e){return typeof e=="string"?e:e.name}function FRe(e){if(e!=null)return typeof e=="string"?e:e.originalName}var Lvt=h(()=>{"use strict";tc()});function iTu({auth:e,playgroundConfig:t,context:r}){if(e.schemes.length>0&&e.schemes[0]!=null){let n=e.schemes[0];return oTu({scheme:n,playgroundConfig:t,context:r})}}function oTu({scheme:e,playgroundConfig:t,context:r}){switch(e.type){case"basic":return{type:"basicAuth",passwordName:jr(e.password),usernameName:jr(e.username),description:e.docs,playgroundDescription:e.playgroundDocs,passwordAlwaysEmpty:e.passwordOmit};case"bearer":return{type:"bearerAuth",tokenName:jr(e.token),description:e.docs,playgroundDescription:e.playgroundDocs};case"header":return{type:"header",headerWireValue:cr(e.name),nameOverride:jr(Uci(e.name)),prefix:e.prefix,description:e.docs,playgroundDescription:e.playgroundDocs};case"oauth":{let n=e.configuration;if(n.type!=="clientCredentials")return{type:"bearerAuth",tokenName:"token",description:e.docs,playgroundDescription:e.playgroundDocs};let i=n.tokenEndpoint.responseProperties.accessToken.propertyPath?.map(o=>jr(o.name)).join(".")||"$.body.access_token";return t?.oauth?{type:"oAuth",value:{type:"clientCredentials",value:{type:"referencedEndpoint",endpointId:sn.EndpointId(n.tokenEndpoint.endpointReference.endpointId),accessTokenLocator:i,headerName:n.tokenHeader,tokenPrefix:n.tokenPrefix,description:e.docs,playgroundDescription:e.playgroundDocs}}}:{type:"bearerAuth",tokenName:"token",description:e.docs,playgroundDescription:e.playgroundDocs}}case"inferred":{e.tokenEndpoint.authenticatedRequestHeaders.length>1&&r.logger.warn("Inferred auth scheme has multiple authenticated request headers. Only the `Authentication` or first header will be pushed to FDR.");let n=e.tokenEndpoint.authenticatedRequestHeaders.find(o=>o.headerName.toLowerCase()==="authorization");if(n)return n.responseProperty.propertyPath!=null&&n.responseProperty.propertyPath.length>0&&r.logger.warn("Inferred Authentication header has a property path. The property wirevalue will be pushed to FDR without property path."),{type:"bearerAuth",tokenName:cr(n.responseProperty.property.name),description:e.docs,playgroundDescription:e.playgroundDocs};let i=e.tokenEndpoint.authenticatedRequestHeaders[0];return i?{type:"header",headerWireValue:i.headerName,prefix:i.valuePrefix,nameOverride:void 0,description:e.docs,playgroundDescription:e.playgroundDocs}:{type:"bearerAuth",tokenName:"token",description:e.docs,playgroundDescription:e.playgroundDocs}}default:rt(e)}}function sTu({auth:e,playgroundConfig:t,context:r}){let n={};for(let i of e.schemes){let o=oTu({scheme:i,playgroundConfig:t,context:r});o!=null&&(n[sn.AuthSchemeId(i.key)]=o)}return n}var aTu=h(()=>{"use strict";It();Mm();Lvt()});function cTu(e){return e._visit({alias:t=>({type:"alias",value:of(t.aliasOf)}),enum:t=>({type:"enum",default:t.default!=null?cr(t.default.name):void 0,values:t.values.map(r=>({description:r.docs??void 0,value:cr(r.name),availability:eE(r.availability)}))}),object:t=>({type:"object",extends:t.extends.map(r=>sn.TypeId(r.typeId)),properties:t.properties.map(r=>({description:r.docs??void 0,key:sn.PropertyKey(cr(r.name)),valueType:of(r.valueType,r.defaultValue),availability:eE(r.availability),propertyAccess:r.propertyAccess})),extraProperties:LLh(t.extraProperties)}),union:t=>{let r=t.baseProperties.map(n=>({key:sn.PropertyKey(cr(n.name)),valueType:of(n.valueType,n.defaultValue),availability:eE(n.availability),description:n.docs,propertyAccess:n.propertyAccess}));return{type:"discriminatedUnion",discriminant:cr(t.discriminant),variants:t.types.map(n=>({description:n.docs??void 0,discriminantValue:cr(n.discriminantValue),displayName:n.displayName,availability:n.availability!=null?eE(n.availability):void 0,additionalProperties:Xt.types.SingleUnionTypeProperties._visit(n.shape,{samePropertiesAsObject:i=>({extends:[sn.TypeId(i.typeId)],properties:r,extraProperties:void 0}),singleProperty:i=>({extends:[],properties:[{key:sn.PropertyKey(cr(i.name)),valueType:of(i.type),description:void 0,availability:void 0,propertyAccess:void 0},...r],extraProperties:void 0}),noProperties:()=>({extends:[],properties:r,extraProperties:void 0}),_other:()=>{throw new w({message:"Unknown SingleUnionTypeProperties: "+n.shape.propertiesType,code:w.Code.InternalError})}})}))}},undiscriminatedUnion:t=>({type:"undiscriminatedUnion",variants:t.members.map(r=>({typeName:r.type.type==="named"?jr(r.type.name):void 0,description:r.docs??void 0,type:of(r.type),availability:void 0,displayName:r.type.type==="named"?r.type.displayName:void 0}))}),_other:()=>{throw new w({message:"Unknown Type shape: "+e.type,code:w.Code.InternalError})}})}function of(e,t){return e._visit({container:r=>Xt.types.ContainerType._visit(r,{list:n=>({type:"list",itemType:of(n),minItems:void 0,maxItems:void 0}),map:({keyType:n,valueType:i})=>({type:"map",keyType:of(n),valueType:of(i),minProperties:void 0,maxProperties:void 0}),optional:n=>({type:"optional",itemType:of(n),defaultValue:t}),nullable:n=>({type:"nullable",itemType:of(n)}),set:n=>({type:"set",itemType:of(n),minItems:void 0,maxItems:void 0}),literal:n=>Xt.types.Literal._visit(n,{boolean:i=>({type:"literal",value:{type:"booleanLiteral",value:i}}),string:i=>({type:"literal",value:{type:"stringLiteral",value:i}}),_other:()=>{throw new w({message:"Unknown literal type: "+n.type,code:w.Code.InternalError})}}),_other:()=>{throw new w({message:"Unknown container reference: "+r.type,code:w.Code.InternalError})}}),named:r=>({type:"id",value:sn.TypeId(r.typeId),default:void 0}),primitive:r=>({type:"primitive",value:Xt.types.PrimitiveTypeV1._visit(r.v1,{integer:()=>FLh(r.v2),float:()=>NLh(r.v2),double:()=>jLh(r.v2),string:()=>kLh(r.v2),long:()=>zLh(r.v2),boolean:()=>({type:"boolean",default:r.v2?.type==="boolean"?r.v2.default:void 0}),dateTime:()=>({type:"datetime",default:void 0}),date:()=>({type:"date",default:void 0}),uuid:()=>({type:"uuid",default:void 0}),base64:()=>({type:"base64",mimeType:void 0,default:void 0}),bigInteger:()=>({type:"bigInteger",default:r.v2?.type==="bigInteger"?r.v2.default:void 0}),uint:()=>QLh(r.v2),uint64:()=>MLh(r.v2),dateTimeRfc2822:()=>({type:"datetime",default:void 0}),_other:()=>{throw new w({message:"Unknown primitive: "+r.v1,code:w.Code.InternalError})}})}),unknown:()=>({type:"unknown"}),_other:()=>{throw new w({message:"Unknown Type reference: "+e.type,code:w.Code.InternalError})}})}function kLh(e){let t=e!=null&&e.type==="string"?e.validation:void 0;return{type:"string",format:t?.format,regex:t?.pattern,minLength:t?.minLength,maxLength:t?.maxLength,default:e!=null&&e.type==="string"?e.default:void 0}}function FLh(e){let t=e!=null&&e.type==="integer"?e.validation:void 0;return{type:"integer",minimum:t?.exclusiveMin===!0?void 0:t?.min,maximum:t?.exclusiveMax===!0?void 0:t?.max,exclusiveMinimum:t?.exclusiveMin===!0?t?.min:void 0,exclusiveMaximum:t?.exclusiveMax===!0?t?.max:void 0,multipleOf:t?.multipleOf,default:e!=null&&e.type==="integer"?e.default:void 0}}function NLh(e){return{type:"scalar",name:"float",description:void 0,default:e!=null&&e.type==="float"?e.default:void 0}}function jLh(e){let t=e!=null&&e.type==="double"?e.validation:void 0;return{type:"double",minimum:t?.exclusiveMin===!0?void 0:t?.min,maximum:t?.exclusiveMax===!0?void 0:t?.max,exclusiveMinimum:t?.exclusiveMin===!0?t?.min:void 0,exclusiveMaximum:t?.exclusiveMax===!0?t?.max:void 0,multipleOf:t?.multipleOf,default:e!=null&&e.type==="double"?e.default:void 0}}function zLh(e){let t=e!=null&&e.type==="long"?e.validation:void 0;return{type:"long",minimum:t?.exclusiveMin===!0?void 0:t?.min,maximum:t?.exclusiveMax===!0?void 0:t?.max,exclusiveMinimum:t?.exclusiveMin===!0?t?.min:void 0,exclusiveMaximum:t?.exclusiveMax===!0?t?.max:void 0,multipleOf:t?.multipleOf,default:e!=null&&e.type==="long"?e.default:void 0}}function QLh(e){let t=e!=null&&e.type==="uint"?e.validation:void 0;return{type:"uint",minimum:t?.exclusiveMin===!0?void 0:t?.min,maximum:t?.exclusiveMax===!0?void 0:t?.max,exclusiveMinimum:t?.exclusiveMin===!0?t?.min:void 0,exclusiveMaximum:t?.exclusiveMax===!0?t?.max:void 0,multipleOf:t?.multipleOf,default:e!=null&&e.type==="uint"?e.default:void 0}}function MLh(e){let t=e!=null&&e.type==="uint64"?e.validation:void 0;return{type:"uint64",minimum:t?.exclusiveMin===!0?void 0:t?.min,maximum:t?.exclusiveMax===!0?void 0:t?.max,exclusiveMinimum:t?.exclusiveMin===!0?t?.min:void 0,exclusiveMaximum:t?.exclusiveMax===!0?t?.max:void 0,multipleOf:t?.multipleOf,default:e!=null&&e.type==="uint64"?e.default:void 0}}function LLh(e){return typeof e=="boolean"?e?Wr.unknown():void 0:typeof e=="string"?{type:"id",value:sn.TypeId(e),default:void 0}:of(e)}var Fls=h(()=>{"use strict";Mm();jn();Dt();Nls();Lvt()});function Qls(e,t,r,n){let i=e.service!=null?t.services[e.service]:void 0,o=e.webhooks!=null?t.webhookGroups[e.webhooks]:void 0,s=e.websocket!=null&&t.websocketChannels!=null?t.websocketChannels[e.websocket]:void 0;return{endpoints:i!=null?ULh(i,t):[],webhooks:o!=null?_Lh(o):[],websockets:s!=null?[GLh(s,t)]:[],types:[...e.types.map(c=>sn.TypeId(c)),...Object.keys(n??{}).map(c=>sn.TypeId(c))],subpackages:e.subpackages.map(c=>sn.SubpackageId(c)),pointsTo:e.navigationConfig!=null?sn.SubpackageId(e.navigationConfig.pointsTo):void 0,graphqlOperations:r?Object.values(r):[]}}function _Lh(e){return e.map(t=>{let r=[];if(t.v2Examples!=null){for(let[n,i]of Object.entries(t.v2Examples.userSpecifiedExamples))r.push({name:i.name??n,payload:i.payload});for(let[n,i]of Object.entries(t.v2Examples.autogeneratedExamples))r.push({name:i.name??n,payload:i.payload})}else r.push(...t.examples?.map(n=>({name:FRe(n.name),payload:n.payload.jsonExample}))??[]);return{description:t.docs??void 0,availability:eE(t.availability),id:sn.WebhookId(jr(t.name)),path:[],method:t.method,name:t.displayName??hje(jr(t.name)),headers:t.headers.map(n=>({description:n.docs??void 0,key:cr(n.name),type:of(n.valueType,n.defaultValue),availability:eE(n.availability)})),payload:r6h(t.payload,t.fileUploadPayload),examples:r,responses:t.responses?.map(zls).filter(ea)}})}function ULh(e,t){let r=[];for(let n of e.endpoints){let i=n.autogeneratedExamples[0],o=[];if(n.v2Examples!=null){let a,c=n.v2Examples.userSpecifiedExamples,l=n.v2Examples.autogeneratedExamples,u=Object.values(c).map(d=>d.response?.statusCode).filter((d,f,m)=>m.indexOf(d)!==f).length>0;for(let[d,f]of Object.entries(c))a=uTu({shouldUseExampleName:f.displayName!=null||u,exampleName:f.displayName??d,example:f,irEndpoint:n,irService:e,ir:t}),a!=null&&o.push(a);let p=Object.values(l).map(d=>d.response?.statusCode).filter((d,f,m)=>m.indexOf(d)!==f).length>0;for(let[d,f]of Object.entries(l))a=uTu({shouldUseExampleName:p,exampleName:f.displayName??d,example:f,irEndpoint:n,irService:e,ir:t}),a!=null&&o.push(a)}else if(n.userSpecifiedExamples.length>0)o.push(...n.userSpecifiedExamples.map(a=>jls({userSpecifiedExample:a,...i!=null&&{autogeneratedExample:i},irEndpoint:n,ir:t})).filter(ea));else if(i!=null){let a=jls({autogeneratedExample:i,irEndpoint:n,ir:t});a!=null&&o.push(a)}else if(n.response?.body?.type==="fileDownload"){let a=Qot({ir:t,service:e,endpoint:{...n,response:void 0},typeDeclarations:t.types,skipOptionalRequestProperties:!0,generationResponse:{type:"success"}});if(a.type==="success"){let c=jls({autogeneratedExample:a,irEndpoint:n,ir:t});if(c!=null){let l={...c,responseBodyV3:{type:"filename",value:"<bytes>"}};o.push(l)}}}o.push(...e6h({irEndpoint:n,ir:t,examples:o}));let s={slug:void 0,availability:eE(n.availability??e.availability),auth:n.auth,authV2:qLh(n.security),multiAuth:WLh(n.security,t.auth),description:n.docs??void 0,method:XLh(n.method),defaultEnvironment:t.environments?.defaultEnvironment!=null?sn.EnvironmentId(t.environments.defaultEnvironment):void 0,environments:t.environments!=null?HLh({environmentsConfig:t.environments,endpoint:n}):void 0,id:sn.EndpointId(jr(n.name)),originalEndpointId:n.id,name:n.displayName??hje(jr(n.name)),path:n.basePath!=null?{pathParameters:n.pathParameters.map(a=>({description:a.docs??void 0,key:sn.PropertyKey(jr(a.name)),type:of(a.valueType),availability:void 0,explode:a.explode})),parts:[..._vt(n.basePath),..._vt(n.path)]}:{pathParameters:[...t.pathParameters,...e.pathParameters,...n.pathParameters].map(a=>({description:a.docs??void 0,key:sn.PropertyKey(jr(a.name)),type:of(a.valueType),availability:void 0,explode:a.explode})),parts:[...t.basePath!=null?_vt(t.basePath):[],..._vt(e.basePath),..._vt(n.path)]},queryParameters:n.queryParameters.map(a=>({description:a.docs??void 0,key:cr(a.name),type:of(a.valueType,a.defaultValue),availability:eE(a.availability),explode:a.explode})),headers:[...e.headers,...n.headers].map(a=>({description:a.docs??void 0,key:cr(a.name),type:of(a.valueType,a.defaultValue),availability:eE(a.availability)})),responseHeaders:n.responseHeaders?.map(a=>({description:a.docs??void 0,key:cr(a.name),type:of(a.valueType,a.defaultValue),availability:eE(a.availability)})),request:n.requestBody!=null?lTu(n.requestBody):void 0,requestsV2:{requests:n.v2RequestBodies?.requestBodies?.map(lTu).filter(ea)},response:n.response!=null?zls(n.response):void 0,responsesV2:{responses:n.v2Responses?.responses?.map(zls).filter(ea)},errors:void 0,errorsV2:ZLh(n.errors,t),examples:o,protocol:n.source?._visit({openapi:()=>({type:"rest"}),openrpc:a=>({type:"openrpc",methodName:n.id,paramStructure:JLh(a.paramStructure)}),proto:a=>({type:"grpc",methodName:n.id,methodType:a.methodType}),_other:()=>{}}),includeInApiExplorer:n.apiPlayground,subtitle:n.subtitle??void 0};VLh(s,n),r.push(s)}return r}function VLh(e,t){let r=t.v2Examples?.userSpecifiedExamples;if(r==null||Object.keys(r).length===0)return;let n=e;n.v2Examples={userSpecifiedExamples:r,autogeneratedExamples:{}}}function GLh(e,t){let r=[];if(e.v2Examples!=null&&(Object.keys(e.v2Examples.userSpecifiedExamples).length>0||Object.keys(e.v2Examples.autogeneratedExamples).length>0)){let n=Object.entries(e.v2Examples.userSpecifiedExamples),i=Object.entries(e.v2Examples.autogeneratedExamples),o=n.length>0?n[0]:i[0];if(o!=null){let[s,a]=o;r.push({name:s,description:"",path:a.baseUrl??"",pathParameters:a.pathParameters??{},queryParameters:a.queryParameters??{},headers:a.headers??{},messages:a.messages?.map(c=>({type:sn.WebSocketMessageId(c.type),body:c.body}))??[]})}}else r=e.examples.map(n=>({name:FRe(n.name),description:n.docs,path:n.url,pathParameters:n.pathParameters.reduce((i,o)=>(i[sn.PropertyKey(jr(o.name))]=o.value.jsonExample,i),{}),queryParameters:n.queryParameters.reduce((i,o)=>(i[cr(o.name)]=o.value.jsonExample,i),{}),headers:n.headers.reduce((i,o)=>(i[cr(o.name)]=o.value.jsonExample,i),{}),messages:n.messages.map(i=>({type:sn.WebSocketMessageId(i.type),body:i.body.jsonExample}))}));return{auth:e.auth,availability:eE(e.availability),description:e.docs??void 0,defaultEnvironment:t.environments?.defaultEnvironment!=null?sn.EnvironmentId(t.environments.defaultEnvironment):void 0,environments:t.environments!=null?KLh({environmentsConfig:t.environments,channel:e}):[],id:sn.WebSocketId(jr(e.name)),name:e.displayName??hje(jr(e.name)),path:{pathParameters:e.pathParameters.map(n=>({description:n.docs??void 0,key:sn.PropertyKey(jr(n.name)),type:of(n.valueType),availability:void 0,explode:n.explode})),parts:_vt(e.path)},headers:e.headers.map(n=>({key:cr(n.name),type:of(n.valueType,n.defaultValue),description:n.docs,availability:eE(n.availability)})),queryParameters:e.queryParameters.map(n=>({description:n.docs??void 0,key:cr(n.name),type:of(n.valueType,n.defaultValue),availability:eE(n.availability),explode:n.explode})),messages:e.messages.map(n=>({type:sn.WebSocketMessageId(n.type),displayName:n.displayName,origin:n.origin,body:i6h(n.body),description:n.docs,availability:eE(n.availability)})),examples:r,includeInApiExplorer:e.apiPlayground}}function qLh(e){if(e==null)return;if(e.length===0)return[];let t=new Set(e.flatMap(r=>Object.keys(r)));return Array.from(t).map(r=>sn.AuthSchemeId(r))}function WLh(e,t){return e==null?t!=null&&t.requirement==="ANY"&&t.schemes.length>0?t.schemes.map(r=>({schemes:[sn.AuthSchemeId(r.key)]})):void 0:e.length===0?[]:e.map(r=>({schemes:Object.keys(r).map(n=>sn.AuthSchemeId(n))}))}function eE(e){if(e!=null)switch(e.status){case"DEPRECATED":return sn.Availability.Deprecated;case"LEGACY":return sn.Availability.Legacy;case"PRE_RELEASE":case"BETA":return sn.Availability.Beta;case"GENERAL_AVAILABILITY":return sn.Availability.GenerallyAvailable;case"IN_DEVELOPMENT":return sn.Availability.Beta;case"ALPHA":return sn.Availability.Alpha;case"PREVIEW":return sn.Availability.Preview;default:rt(e.status)}}function HLh({environmentsConfig:e,endpoint:t}){let r=e.environments,n=t.baseUrl,i=t.v2BaseUrls;switch(r.type){case"singleBaseUrl":return r.environments.map(o=>({id:sn.EnvironmentId(o.id),baseUrl:o.url,audiences:o.audiences}));case"multipleBaseUrls":if(i!=null)return i.flatMap(s=>r.environments.map(a=>{let c=a.urls[s];if(c==null)throw new w({message:`Encountered undefined server name "${s}" at endpoint ${t.method.toUpperCase()} ${t.path}. Expected environment ${a.id} to contain url for ${s}`,code:w.Code.ValidationError});return{id:sn.EnvironmentId(s),baseUrl:c,audiences:a.audiences}})).filter((s,a,c)=>a===c.findIndex(l=>l.id===s.id&&l.baseUrl===s.baseUrl));if(n==null)throw new w({message:`Expected endpoint ${jr(t.name)} to have base url.`,code:w.Code.IrConversionError});return r.environments.map(o=>{let s=o.urls[n];if(s==null)throw new w({message:`Encountered undefined server name "${n}" at endpoint ${t.method.toUpperCase()} ${t.path.head}. Expected environment ${o.id} to contain url for ${n}`,code:w.Code.ValidationError});return{id:sn.EnvironmentId(o.id),baseUrl:s,audiences:o.audiences}});default:rt(r)}}function KLh({environmentsConfig:e,channel:t}){let r=e.environments,n=t.baseUrl;switch(r.type){case"singleBaseUrl":return r.environments.map(i=>({id:sn.EnvironmentId(i.id),baseUrl:YLh(i.url,"wss"),audiences:i.audiences}));case"multipleBaseUrls":if(n==null)throw new w({message:`Expected channel ${jr(t.name)} to have base url.`,code:w.Code.IrConversionError});return r.environments.map(i=>{let o=i.urls[n];if(o==null)throw new w({message:`Encountered undefined server name ${o} at channel ${jr(t.name)} ${t.path.head}. Expected environment ${i.id} to contain url for ${n}`,code:w.Code.IrConversionError});return{id:sn.EnvironmentId(i.id),baseUrl:o,audiences:i.audiences}});default:rt(r)}}function JLh(e){switch(e){case"BY_NAME":return"by-name";case"BY_POSITION":return"by-position";case"EITHER":return"either";case void 0:return;default:rt(e)}}function YLh(e,t){return e.replace(/^[^:]+/,t)}function XLh(e){return Xt.http.HttpMethod._visit(e,{get:()=>sn.HttpMethod.Get,post:()=>sn.HttpMethod.Post,put:()=>sn.HttpMethod.Put,patch:()=>sn.HttpMethod.Patch,delete:()=>sn.HttpMethod.Delete,head:()=>sn.HttpMethod.Head,_other:()=>{throw new w({message:"Unknown http method: "+e,code:w.Code.InternalError})}})}function _vt(e){let t=e.parts.flatMap(r=>[{type:"pathParameter",value:sn.PropertyKey(r.pathParameter)},{type:"literal",value:r.tail}]);return[{type:"literal",value:e.head},...t]}function lTu(e){let t=Xt.http.HttpRequestBody._visit(e,{inlinedRequestBody:r=>({type:"json",contentType:r.contentType??Fp.APPLICATION_JSON,shape:{type:"object",extends:r.extends.map(n=>sn.TypeId(n.typeId)),properties:r.properties.map(n=>({description:n.docs??void 0,key:sn.PropertyKey(cr(n.name)),valueType:of(n.valueType,n.defaultValue),availability:eE(n.availability),propertyAccess:n.propertyAccess})),extraProperties:r.extraProperties?{type:"unknown"}:void 0}}),reference:r=>({type:"json",contentType:r.contentType??Fp.APPLICATION_JSON,shape:{type:"reference",value:of(r.requestBodyType)},description:r.docs??void 0}),fileUpload:r=>({type:"fileUpload",value:{name:jr(r.name),description:void 0,availability:void 0,properties:r.properties.map(n=>n._visit({file:i=>{let o=i._visit({file:s=>({type:"file",key:sn.PropertyKey(cr(s.key)),isOptional:s.isOptional,contentType:s.contentType,description:s.docs??void 0,availability:void 0}),fileArray:s=>({type:"fileArray",key:sn.PropertyKey(cr(s.key)),isOptional:s.isOptional,contentType:s.contentType,description:s.docs??void 0,availability:void 0}),_other:()=>{}});if(o!=null)return{type:"file",value:o}},bodyProperty:i=>({type:"bodyProperty",key:sn.PropertyKey(cr(i.name)),valueType:of(i.valueType,i.defaultValue),contentType:i.contentType,description:i.docs??void 0,availability:eE(i.availability),exploded:i.style==="exploded",propertyAccess:void 0}),_other:()=>{}})).filter(ea)},contentType:r.contentType,description:r.docs??void 0}),bytes:r=>({type:"bytes",description:r.docs??void 0,availability:void 0,isOptional:r.isOptional,contentType:r.contentType}),_other:()=>{throw new w({message:"Unknown HttpRequestBody: "+e.type,code:w.Code.InternalError})}});return t!=null?{type:t,description:e.docs}:void 0}function zls(e){let t=e.docs,r;return e.body!=null&&(r=Xt.http.HttpResponseBody._visit(e.body,{fileDownload:n=>(t=n.docs,{type:"fileDownload",contentType:void 0}),json:n=>(t=n.docs,{type:"reference",value:of(n.responseBodyType)}),text:()=>{},bytes:()=>{},streamParameter:()=>{},streaming:n=>{if(n.type==="text")return t=n.docs,{type:"streamingText"};if(n.type==="json")return t=n.docs,{type:"stream",shape:{type:"reference",value:of(n.payload)},terminator:n.terminator};if(n.type==="sse")return t=n.docs,{type:"stream",shape:{type:"reference",value:of(n.payload)},terminator:n.terminator}},_other:()=>{throw new w({message:"Unknown HttpResponse: "+e.body,code:w.Code.InternalError})}})),r!=null?{type:r,statusCode:e.statusCode,isWildcard:e.isWildcardStatusCode===!0?!0:void 0,description:t}:e.statusCode!=null?{statusCode:e.statusCode,isWildcard:e.isWildcardStatusCode===!0?!0:void 0,description:t,type:{type:"object",extends:[],properties:[],extraProperties:void 0}}:void 0}function ZLh(e,t){let r=[];if(t.errorDiscriminationStrategy.type==="statusCode")for(let n of e){let i=t.errors[n.error.errorId];i&&r.push({type:i.type==null?void 0:{type:"alias",value:of(i.type)},statusCode:i.statusCode,isWildcard:i.isWildcardStatusCode===!0?!0:void 0,description:i.docs??void 0,name:i.displayName??jr(i.name.name),availability:void 0,examples:pTu(i,t),headers:i.headers!=null&&i.headers.length>0?i.headers.map(o=>({description:o.docs??void 0,key:cr(o.name),type:of(o.valueType,o.defaultValue),availability:eE(o.availability)})):void 0})}else for(let n of e){let i=t.errors[n.error.errorId];if(i){let o=[{key:sn.PropertyKey(cr(t.errorDiscriminationStrategy.discriminant)),valueType:{type:"literal",value:{type:"stringLiteral",value:jr(Uci(i.discriminantValue))}},description:i.docs,availability:void 0,propertyAccess:void 0}];i.type!=null&&o.push({key:sn.PropertyKey(cr(t.errorDiscriminationStrategy.contentProperty)),valueType:of(i.type),description:i.docs,availability:void 0,propertyAccess:void 0}),r.push({type:i.type==null?void 0:{type:"object",extends:[],properties:o,extraProperties:void 0},statusCode:i.statusCode,isWildcard:i.isWildcardStatusCode===!0?!0:void 0,description:i.docs??void 0,availability:void 0,name:i.displayName??jr(i.name.name),examples:i.examples.map(s=>({name:FRe(s.name),responseBody:{type:"json",value:s.jsonExample},description:s.docs})),headers:i.headers!=null&&i.headers.length>0?i.headers.map(s=>({description:s.docs??void 0,key:cr(s.name),type:of(s.valueType,s.defaultValue),availability:eE(s.availability)})):void 0})}}return r}function Mls(e){let t={};for(let r of e??[]){let n=Object.values(r.v2Examples?.userSpecifiedExamples??{})[0]??Object.values(r.v2Examples?.autogeneratedExamples??{})[0];n!==void 0&&(t[cr(r.name)]=n)}return Object.keys(t).length>0?t:void 0}function $Lh({irEndpoint:e,ir:t,statusCode:r}){let n;for(let i of e.errors??[]){let o=t.errors[i.error.errorId];if(o!=null){if(o.isWildcardStatusCode!==!0&&o.statusCode===r)return o.headers;o.isWildcardStatusCode===!0&&Math.floor(o.statusCode/100)===Math.floor(r/100)&&(n=o)}}return n?.headers}function e6h({irEndpoint:e,ir:t,examples:r}){let n=r.find(s=>s.responseStatusCode<400)??r[0];if(n==null)return[];let i=new Set(r.map(s=>s.responseStatusCode)),o=[];for(let s of e.errors??[]){let a=t.errors[s.error.errorId];if(a==null||a.isWildcardStatusCode===!0||i.has(a.statusCode))continue;let c=Mls(a.headers);c!=null&&(o.push({...n,name:void 0,description:void 0,codeSamples:void 0,responseStatusCode:a.statusCode,responseBody:void 0,responseBodyV3:pTu(a,t)[0]?.responseBody,responseHeaders:c}),i.add(a.statusCode))}return o}function uTu({shouldUseExampleName:e,exampleName:t,example:r,irEndpoint:n,irService:i,ir:o}){if(r==null)return;let s=d=>{if(d.valueType.type==="container"&&d.valueType.container.type==="literal")return d.valueType.container.literal._visit({boolean:f=>`${f}`,string:f=>f,_other:()=>{}});if(d.valueType.type==="container"&&d.valueType.container.type==="optional"&&d.valueType.container.optional.type==="container"&&d.valueType.container.optional.container.type==="literal")return d.valueType.container.optional.container.literal._visit({boolean:f=>`${f}`,string:f=>f,_other:()=>{}})},a={};o.headers.forEach(d=>{let f=s(d);f!=null&&(a[cr(d.name)]=f)}),i.headers.forEach(d=>{let f=s(d);f!=null&&(a[cr(d.name)]=f)}),n.headers.forEach(d=>{let f=s(d);f!=null&&(a[cr(d.name)]=f)});let c=r.response?.body!=null?r.response.body.value:void 0,l=r.response?.statusCode??n.response?.statusCode??200,u=n.response?.statusCode??200,p=l>=400?$Lh({irEndpoint:n,ir:o,statusCode:l}):l===u?n.responseHeaders:void 0;return{name:e?t:void 0,description:"",path:r.request?.endpoint.path??"",pathParameters:r.request?.pathParameters??{},queryParameters:r.request?.queryParameters??{},headers:(()=>{let f={...r.request?.headers??{}};for(let[m,g]of Object.entries(a))(f[m]===null||f[m]===void 0)&&(f[m]=g);return f})(),requestBody:r.request?.requestBody,requestBodyV3:n.requestBody?._visit({inlinedRequestBody:()=>r.request!=null?{type:"json",value:r.request.requestBody}:void 0,reference:()=>r.request!=null?{type:"json",value:r.request.requestBody}:void 0,fileUpload:d=>{if(r.request==null)return;let f={};if(si(r.request.requestBody)){let m=r.request.requestBody;for(let g of d.properties)g._visit({file:A=>{let y=m[cr(A.key)];if(A.type==="file")f[cr(A.key)]={type:"filename",value:typeof y=="string"?y:"<file1>"};else if(A.type==="fileArray"){let I=(Array.isArray(y)?y:[y]).filter(C=>typeof C=="string");f[cr(A.key)]={type:"filenames",value:I}}},bodyProperty:A=>{if(A.style==="exploded"){let y=m[cr(A.name)];f[cr(A.name)]={type:"exploded",value:Array.isArray(y)?y:[y]}}else f[cr(A.name)]={type:"json",value:m[cr(A.name)]}},_other:Q_})}return{type:"form",value:f}},bytes:()=>{},_other:()=>{}}),responseStatusCode:l,responseBody:c??void 0,responseBodyV3:c!=null?r.response?.body?._visit({json:d=>({type:"json",value:d}),stream:d=>Array.isArray(d)&&d.length>0&&d.every(t6h)?{type:"sse",value:d}:{type:"stream",value:d},error:()=>{},_other:()=>{throw new w({message:"Unknown ExampleResponseBody: "+r.response?.body?.type,code:w.Code.InternalError})}}):void 0,responseHeaders:Mls(p),codeSamples:r.codeSamples?.map(d=>({name:d.name,description:d.docs??void 0,install:void 0,language:d.language,code:d.code})).filter(ea)}}function t6h(e){return typeof e=="object"&&e!==null&&"event"in e&&typeof e?.event=="string"&&"data"in e}function jls({userSpecifiedExample:e,autogeneratedExample:t,irEndpoint:r,ir:n}){let i=n.headers.map(c=>{let l;if(c.valueType.type==="container"&&c.valueType.container.type==="literal"?l=c.valueType.container.literal._visit({boolean:u=>`${u}`,string:u=>u,_other:()=>{}}):c.valueType.type==="container"&&c.valueType.container.type==="optional"&&c.valueType.container.optional.type==="container"&&c.valueType.container.optional.container.type==="literal"&&(l=c.valueType.container.optional.container.literal._visit({boolean:u=>`${u}`,string:u=>u,_other:()=>{}})),l!=null)return{name:c.name,value:{jsonExample:l,shape:Xt.ExampleTypeReferenceShape.primitive(Xt.ExamplePrimitive.string({original:l}))}}}).filter(ea),o=e?.example??t?.example;if(o==null)return;let{codeSamples:s}=e??{codeSamples:[]},a=Xt.http.ExampleResponse._visit(o.response,{ok:()=>r.responseHeaders,error:({error:c})=>n.errors[c.errorId]?.headers,_other:()=>r.responseHeaders});return{name:FRe(o.name),description:o.docs,path:o.url,pathParameters:[...o.rootPathParameters,...o.servicePathParameters,...o.endpointPathParameters].reduce((c,l)=>(c[sn.PropertyKey(jr(l.name))]=l.value.jsonExample,c),{}),queryParameters:o.queryParameters.reduce((c,l)=>(c[cr(l.name)]=l.value.jsonExample,c),{}),headers:[...i,...o.serviceHeaders,...o.endpointHeaders].reduce((c,l)=>(c[cr(l.name)]=l.value.jsonExample,c),{}),requestBody:o.request?.jsonExample,requestBodyV3:r.requestBody?._visit({inlinedRequestBody:()=>o.request!=null?{type:"json",value:o.request.jsonExample}:void 0,reference:()=>o.request!=null?{type:"json",value:o.request.jsonExample}:void 0,fileUpload:c=>{if(o.request==null)return;let l={};if(si(o.request.jsonExample)){let u=o.request.jsonExample;for(let p of c.properties)p._visit({file:d=>{let f=u[cr(d.key)];if(d.type==="file")l[cr(d.key)]={type:"filename",value:typeof f=="string"?f:"<file1>"};else if(d.type==="fileArray"){let m=(Array.isArray(f)?f:[f]).filter(g=>typeof g=="string");l[cr(d.key)]={type:"filenames",value:m}}},bodyProperty:d=>{if(d.style==="exploded"){let f=u[cr(d.name)];l[cr(d.name)]={type:"exploded",value:Array.isArray(f)?f:[f]}}else l[cr(d.name)]={type:"json",value:u[cr(d.name)]}},_other:Q_})}return{type:"form",value:l}},bytes:()=>{},_other:()=>{}}),responseStatusCode:Xt.http.ExampleResponse._visit(o.response,{ok:c=>r.response?.statusCode??c._visit({body:l=>l!=null?200:204,stream:l=>l.length>0?200:204,sse:l=>l.length>0?200:204,_other:()=>{throw new w({message:"Unknown ExampleResponseBody: "+c.type,code:w.Code.InternalError})}}),error:({error:c})=>{let l=n.errors[c.errorId];if(l==null)throw new w({message:"Cannot find error "+c.errorId,code:w.Code.ResolutionError});return l.statusCode},_other:()=>{throw new w({message:"Unknown ExampleResponse: "+o.response.type,code:w.Code.InternalError})}}),responseBody:o.response._visit({ok:c=>c._visit({body:l=>l?.jsonExample,stream:()=>{},sse:()=>{},_other:()=>{}}),error:c=>c.body?.jsonExample,_other:()=>{}}),responseBodyV3:o.response._visit({ok:c=>c._visit({body:l=>l!=null?{type:"json",value:l.jsonExample}:void 0,stream:l=>({type:"stream",value:l.map(u=>u.jsonExample)}),sse:l=>({type:"sse",value:l.map(({event:u,data:p})=>({event:u,data:p.jsonExample}))}),_other:()=>{throw new w({message:"Unknown ExampleResponseBody: "+c.type,code:w.Code.InternalError})}}),error:c=>c.body!=null?{type:"json",value:c.body.jsonExample}:void 0,_other:()=>{throw new w({message:"Unknown ExampleResponse: "+o.response.type,code:w.Code.InternalError})}}),responseHeaders:Mls(a),codeSamples:s?.map(c=>U6._visit(c,{language:l=>({language:l.language,code:l.code,name:FRe(l.name),description:l.docs??void 0,install:l.install}),sdk:l=>({language:l.sdk,code:l.code,name:FRe(l.name),description:l.docs??void 0,install:void 0}),_other:()=>{}})).filter(ea)}}function r6h(e,t){return t!=null?{type:{type:"formData",name:jr(t.name),description:t.docs??void 0,availability:void 0,properties:t.properties.map(r=>r._visit({file:n=>{let i=n._visit({file:o=>({type:"file",key:sn.PropertyKey(cr(o.key)),isOptional:o.isOptional,contentType:o.contentType,description:o.docs??void 0,availability:void 0}),fileArray:o=>({type:"fileArray",key:sn.PropertyKey(cr(o.key)),isOptional:o.isOptional,contentType:o.contentType,description:o.docs??void 0,availability:void 0}),_other:()=>{}});if(i!=null)return{type:"file",value:i}},bodyProperty:n=>({type:"bodyProperty",key:sn.PropertyKey(cr(n.name)),valueType:of(n.valueType,n.defaultValue),contentType:n.contentType,description:n.docs??void 0,availability:eE(n.availability),exploded:n.style==="exploded",propertyAccess:void 0}),_other:()=>{}})).filter(ea)},description:t.docs??void 0}:n6h(e)}function n6h(e){switch(e.type){case"inlinedPayload":return{type:{type:"object",extends:e.extends.map(t=>sn.TypeId(t.typeId)),properties:e.properties.map(t=>({description:t.docs??void 0,key:sn.PropertyKey(cr(t.name)),valueType:of(t.valueType),availability:eE(t.availability),propertyAccess:void 0})),extraProperties:void 0},description:void 0};case"reference":return{type:{type:"reference",value:of(e.payloadType)},description:e.docs};default:rt(e)}}function i6h(e){switch(e.type){case"inlinedBody":return{type:"object",extends:e.extends.map(t=>sn.TypeId(t.typeId)),properties:e.properties.map(t=>({description:t.docs??void 0,key:sn.PropertyKey(cr(t.name)),valueType:of(t.valueType),availability:eE(t.availability),propertyAccess:void 0})),extraProperties:void 0};case"reference":return{type:"reference",value:of(e.bodyType)};default:rt(e)}}function pTu(e,t){let r=e.v2Examples?.userSpecifiedExamples,n=e.v2Examples?.autogeneratedExamples,i=e.examples;if(r!=null&&Object.keys(r).length>0)return Object.entries(r).map(([s,a])=>({name:s,responseBody:{type:"json",value:a},description:void 0}));if(n!=null&&Object.keys(n).length>0)return Object.entries(n).map(([s,a])=>({name:s,responseBody:{type:"json",value:a},description:void 0}));if(i.length>0)return i.map(s=>({name:FRe(s.name),responseBody:{type:"json",value:s.jsonExample},description:s.docs}));let o=o6h(e,t);return o!=null?[o]:[]}function o6h(e,t){if(e.type==null||e.type.type!=="named")return;let r=e.type.typeId,n=t.types[r];if(n==null||n.shape.type!=="object")return;let i={},o=!1;for(let s of n.shape.properties){let a=cr(s.name),c=s.v2Examples;if(c?.userSpecifiedExamples!=null){let l=Object.values(c.userSpecifiedExamples);if(l.length>0){i[a]=l[0],o=!0;continue}}if(c?.autogeneratedExamples!=null){let l=Object.values(c.autogeneratedExamples);if(l.length>0){i[a]=l[0];continue}}}if(o)return{name:void 0,responseBody:{type:"json",value:i},description:void 0}}var Nls=h(()=>{"use strict";It();Mm();jn();tc();Dt();Io();Fls();Lvt()});function aO({ir:e,snippetsConfig:t,playgroundConfig:r,graphqlOperations:n={},graphqlTypes:i={},context:o,apiNameOverride:s}){let a={types:{},subpackages:{},rootPackage:Qls(e.rootPackage,e,n,i),apiName:s??jr(e.apiName),auth:iTu({auth:e.auth,playgroundConfig:r,context:o}),authSchemes:sTu({auth:e.auth,playgroundConfig:r,context:o}),snippetsConfiguration:t,globalHeaders:e.headers.map(c=>({availability:eE(c.availability),description:c.docs??void 0,key:cr(c.name),type:of(c.valueType,c.defaultValue)})),navigation:void 0};for(let[c,l]of Object.entries(e.types))a.types[sn.TypeId(c)]={description:l.docs??void 0,name:jr(l.name.name),shape:cTu(l.shape),availability:eE(l.availability),displayName:l.name.displayName};for(let[c,l]of Object.entries(i))a.types[sn.TypeId(c)]=l;for(let[c,l]of Object.entries(e.subpackages)){let u=l.service!=null?e.services[l.service]:void 0;a.subpackages[sn.SubpackageId(c)]={subpackageId:sn.SubpackageId(c),displayName:u?.displayName??l.displayName,name:jr(l.name),description:l.docs??void 0,...Qls(l,e)}}return a}var Lls=h(()=>{"use strict";Mm();aTu();Nls();Fls();Lvt()});async function _ls({organization:e,workspace:t,context:r,token:n,audiences:i,snippetsConfig:o,playgroundConfig:s,graphqlOperations:a={},graphqlTypes:c={}}){let l=Mg({workspace:t,audiences:i,generationLanguage:void 0,keywords:void 0,smartCasing:!1,exampleGeneration:{disabled:!1},readme:void 0,version:void 0,packageName:void 0,context:r,sourceResolver:new Dh(r,t)}),u=dF({token:n.value}),p=aO({ir:l,snippetsConfig:o,playgroundConfig:s,graphqlOperations:a,graphqlTypes:c,context:r});try{let d=await u.api.register.registerApiDefinition({orgId:sn.OrgId(e),apiId:sn.ApiId(jr(l.apiName)),definition:p});return r.logger.debug(`Registered API Definition ${d.apiDefinitionId}`),{id:d.apiDefinitionId,ir:l}}catch(d){return r.failAndThrow("Failed to register API",d,{code:w.Code.NetworkError})}}var fTu=h(()=>{"use strict";P2();ef();Mm();ep();Dt();Lls();Lvt()});var Nhe=h(()=>{"use strict";Lls();fTu()});function THt({ir:e,apiDefinitionId:t,playgroundConfig:r,context:n,graphqlOperations:i={},graphqlTypes:o={}}){return y7(g7(aO({ir:e,snippetsConfig:{typescriptSdk:void 0,pythonSdk:void 0,javaSdk:void 0,rubySdk:void 0,goSdk:void 0,csharpSdk:void 0,phpSdk:void 0,swiftSdk:void 0,rustSdk:void 0},playgroundConfig:r,graphqlOperations:i,graphqlTypes:o,context:n}),gfr.ApiDefinitionId(t),s6h))}var s6h,Uls=h(()=>{"use strict";Mm();Nhe();s6h=new A7({snippetsBySdkId:{},snippetsConfigWithSdkId:{},snippetTemplatesByEndpoint:{},snippetsBySdkIdAndEndpointId:{},snippetTemplatesByEndpointId:{}})});async function Iw({iconPath:e,filepaths:t}){e!=null&&typeof e=="string"&&dTu.default.isAbsolute(e)&&t.add(e)}async function mTu({parsedDocsConfig:e}){let t=new Set;if(e.logo?.dark!=null&&t.add(e.logo.dark),e.logo?.light!=null&&t.add(e.logo.light),e.favicon!=null&&t.add(e.favicon),e.backgroundImage?.dark!=null&&t.add(e.backgroundImage.dark),e.backgroundImage?.light!=null&&t.add(e.backgroundImage.light),e.metadata?.["og:image"]!=null&&e.metadata["og:image"].type==="filepath"&&t.add(e.metadata["og:image"].value),e.metadata?.["og:logo"]!=null&&e.metadata["og:logo"].type==="filepath"&&t.add(e.metadata["og:logo"].value),e.metadata?.["twitter:image"]!=null&&e.metadata["twitter:image"].type==="filepath"&&t.add(e.metadata["twitter:image"].value),e.metadata?.["og:dynamic:background-image"]!=null&&e.metadata["og:dynamic:background-image"].type==="filepath"&&t.add(e.metadata["og:dynamic:background-image"].value),e.typography?.bodyFont!=null&&e.typography.bodyFont.variants.forEach(n=>{t.add(n.absolutePath)}),e.typography?.headingsFont!=null&&e.typography.headingsFont.variants.forEach(n=>{t.add(n.absolutePath)}),e.typography?.codeFont!=null&&e.typography.codeFont.variants.forEach(n=>{t.add(n.absolutePath)}),e.navigation.type==="productgroup"&&e.navigation.products.forEach(n=>{n.image!=null&&t.add(n.image)}),(await Vls({navigation:e.navigation})).forEach(n=>{t.add(n)}),e.navbarLinks&&await Promise.all(e.navbarLinks.map(async n=>{n.type==="dropdown"&&n.links.map(async i=>{i.icon&&await Iw({iconPath:i.icon,filepaths:t}),i.rightIcon&&await Iw({iconPath:i.rightIcon,filepaths:t})}),n.type!=="github"&&(n.icon&&await Iw({iconPath:n.icon,filepaths:t}),n.rightIcon&&await Iw({iconPath:n.rightIcon,filepaths:t}))})),e.js!=null&&e.js.files.forEach(n=>{t.add(n.absolutePath)}),e.context7File!=null&&t.add(e.context7File),e.llmsTxtFile!=null&&t.add(e.llmsTxtFile),e.llmsFullTxtFile!=null&&t.add(e.llmsFullTxtFile),e.robotsTxtFile!=null&&t.add(e.robotsTxtFile),e.pageActions?.options?.custom!=null&&await Promise.all(e.pageActions.options.custom.map(async n=>{n.icon!=null&&await Iw({iconPath:n.icon,filepaths:t})})),e.translationNavigationOverlays!=null)for(let n of Object.values(e.translationNavigationOverlays))await a6h({navbarLinks:n.navbarLinks,filepaths:t});return t}async function a6h({navbarLinks:e,filepaths:t}){e!=null&&await Promise.all(e.map(async r=>{if(r.type!=="github"){if(r.type==="dropdown"){await Promise.all(r.links.map(async n=>{n.icon!=null&&await Iw({iconPath:n.icon,filepaths:t}),n.rightIcon!=null&&await Iw({iconPath:n.rightIcon,filepaths:t})})),r.icon!=null&&await Iw({iconPath:r.icon,filepaths:t}),r.rightIcon!=null&&await Iw({iconPath:r.rightIcon,filepaths:t});return}r.icon!=null&&await Iw({iconPath:r.icon,filepaths:t}),r.rightIcon!=null&&await Iw({iconPath:r.rightIcon,filepaths:t})}}))}async function Vls({navigation:e}){let t=new Set;switch(e.type){case"untabbed":await Promise.all(e.items.map(r=>$Ve({item:r,filepaths:t})));break;case"tabbed":await Promise.all(e.items.map(async r=>{r.icon!=null&&await Iw({iconPath:r.icon,filepaths:t}),r.child.type==="layout"&&r.child.layout!=null?await Promise.all(r.child.layout.map(n=>$Ve({item:n,filepaths:t}))):r.child.type==="variants"&&r.child.variants!=null&&await Promise.all(r.child.variants.flatMap(n=>{let i=[];return n.icon!=null&&i.push(Iw({iconPath:n.icon,filepaths:t})),i.push(...n.layout.map(o=>$Ve({item:o,filepaths:t}))),i}))}));break;case"versioned":await Promise.all(e.versions.map(async r=>{r.landingPage!=null&&await $Ve({item:r.landingPage,filepaths:t}),(await Vls({navigation:r.navigation})).forEach(i=>t.add(i))}));break;case"productgroup":await Promise.all(e.products.map(async r=>{r.icon!=null&&await Iw({iconPath:r.icon,filepaths:t}),r.type==="internal"&&(r.landingPage!=null&&await $Ve({item:r.landingPage,filepaths:t}),(await Vls({navigation:r.navigation})).forEach(i=>t.add(i)))})),e.changelog!=null&&await $Ve({item:e.changelog,filepaths:t});break}return t}async function $Ve({item:e,filepaths:t}){switch(e.type){case"page":e.icon!=null&&await Iw({iconPath:e.icon,filepaths:t});break;case"section":e.icon!=null&&await Iw({iconPath:e.icon,filepaths:t}),await Promise.all(e.contents.map(r=>$Ve({item:r,filepaths:t})));break;case"apiSection":e.icon!=null&&await Iw({iconPath:e.icon,filepaths:t});break;case"link":e.icon!=null&&await Iw({iconPath:e.icon,filepaths:t});break;case"changelog":e.icon!=null&&await Iw({iconPath:e.icon,filepaths:t});break}}var dTu,hTu=h(()=>{"use strict";dTu=Ae(require("path"),1)});async function gTu(e,t,r){let n=new Array(e.length),i=0,o=!1,s,a=async()=>{for(;i<e.length&&!o;){let l=i++;try{n[l]=await r(e[l],l)}catch(u){o||(o=!0,s=u)}}},c=Math.min(Math.max(1,Math.floor(t)),e.length);if(await Promise.all(Array.from({length:c},a)),o)throw s;return n}var ATu=h(()=>{"use strict"});function c6h(e,t,r){return e.replace(/\[([^\]]*)\]\(([^)]+\.mdx?(?:#[^)]*)?)\)/g,(n,i,o)=>{let s=o.indexOf("#"),a=s>=0?o.substring(0,s):o,c=s>=0?o.substring(s):"",l=CVe({href:a,metadata:r,markdownFilesToPathName:t});return l!=null&&l.type==="replace"?`[${i}](${l.slug}${c})`:n})}function Vci(e,t,r){if(e==null||typeof e!="object")return;if(Array.isArray(e)){for(let i of e)Vci(i,t,r);return}let n=e;for(let[i,o]of Object.entries(n))typeof o=="string"&&o.includes(".md")?n[i]=c6h(o,t,r):typeof o=="object"&&Vci(o,t,r)}function e5e(e,t,r){if(e==null||typeof e!="object")return;if(Array.isArray(e)){for(let i of e)e5e(i,t,r);return}let n=e;n.apiDefinitionId===t&&(n.apiDefinitionId=r);for(let i of Object.values(n))typeof i=="object"&&e5e(i,t,r)}var Gls=h(()=>{"use strict";i4()});async function yTu({navigation:e,apiWorkspaces:t,visitor:r,context:n}){u6h(e)?await Promise.all(e.map(async i=>{gde(i)?await Promise.all(i.layout.map(async o=>{await Gci({navigationItem:o,visitor:r,apiWorkspaces:t,context:n})})):Ade(i)&&await Promise.all(i.variants.flatMap(o=>o.layout.map(async s=>{await Gci({navigationItem:s,visitor:r,apiWorkspaces:t,context:n})})))})):await Promise.all(e.map(async i=>{await Gci({navigationItem:i,visitor:r,apiWorkspaces:t,context:n})}))}async function Gci({navigationItem:e,visitor:t,apiWorkspaces:r,context:n}){if(await V_(e,{alphabetized:Ot,sortByAvailability:Ot,api:Ot,apiName:Ot,specs:Ot,audiences:Ot,displayErrors:Ot,tagDescriptionPages:Ot,snippets:Ot,summary:Ot,title:Ot,layout:Ot,collapsed:Ot,icon:Ot,slug:Ot,hidden:Ot,skipSlug:Ot,paginated:Ot,playground:Ot,flattened:Ot,path:Ot,page:Ot,featureFlag:Ot,openrpc:Ot,postman:Ot,contents:async i=>{i!=null&&await Promise.all(i.map(async o=>{await Gci({navigationItem:o,visitor:t,apiWorkspaces:r,context:n})}))},viewers:Ot,orphaned:Ot,availability:Ot}),l6h(e)){let i=r.find(o=>o.workspaceName===e.apiName);i!=null&&await t.apiSection?.({config:e,workspace:i,context:n})}}function l6h(e){return e.api!=null}function u6h(e){return e[0]?.tab!=null}var bTu=h(()=>{"use strict";Zn();It()});function xN(e){return Uh(e)?e:`https://${e}`}var qls=h(()=>{"use strict";It()});function qci(){let e=process.env.FERN_DOCS_API_REGISTRATION_CONCURRENCY?.trim();return e!=null&&/^[1-9]\d*$/.test(e)?Number(e):p6h}function m6h(e){if(e!=null)return{schema:e.schema,...e.name==null?{}:{name:e.name},...e.applyTo==null?{}:{"apply-to":e.applyTo},...e.ensure==null?{}:{ensure:e.ensure.map(t=>({"status-code":t.statusCode,...t.methods==null?{}:{methods:t.methods}}))}}}function h6h(e,t){let r=e?.launch;if(e?.github==null)return{url:void 0,launch:r};let{owner:n,repo:i,branch:o="main",host:s="https://github.com"}=e.github;return{url:`${xN(s)}/${n}/${i}/blob/${o}/fern/${t}?plain=1`,launch:r}}function g6h(e){return e==null||typeof e=="string"?e:{style:e.style,alignment:e.alignment?.toUpperCase(),placement:e.placement?.toUpperCase()}}function A6h(e){if(e!=null)return{enabled:e.enabled,order:e.order,hide:e.hide,labels:e.labels,"show-products":e.showProducts}}function y6h(e){return e==null||e.light==null&&e.dark==null?{}:{"code-blocks":{light:e.light,dark:e.dark}}}function b6h(e){let t=e.findIndex(n=>n.default===!0);if(t!==-1)return t;let r=e.findIndex(n=>n.hidden!==!0);return r===-1?0:r}function E6h(e){switch(e){case"beta":return Gt.V1.NavigationV1Availability.Beta;case"deprecated":return Gt.V1.NavigationV1Availability.Deprecated;case"ga":return Gt.V1.NavigationV1Availability.GenerallyAvailable;case"stable":return Gt.V1.NavigationV1Availability.Stable;case"alpha":return Gt.V1.NavigationV1Availability.Alpha;case"preview":return Gt.V1.NavigationV1Availability.Preview;case"legacy":return Gt.V1.NavigationV1Availability.Legacy;default:rt(e)}}function STu(e){return e.flatMap(t=>{switch(t.type){case"page":case"link":return[t];case"section":case"package":{let r=STu(t.contents);return r.length===0&&t.overviewAbsolutePath==null?[]:[{type:"section",title:t.title??(t.type==="package"?t.package:""),referencedSubpackages:[],overviewAbsolutePath:t.overviewAbsolutePath,contents:r,slug:t.slug??(t.type==="package"?op(t.package):void 0),hidden:t.hidden,icon:t.icon,skipUrlSlug:t.skipUrlSlug,collapsed:t.type==="section"?t.collapsed:void 0,collapsible:t.type==="section"?t.collapsible:void 0,collapsedByDefault:t.type==="section"?t.collapsedByDefault:void 0,availability:t.availability,playground:void 0,viewers:t.viewers,orphaned:t.orphaned,featureFlags:t.featureFlags}]}case"item":case"endpoint":case"operation":return[];default:rt(t)}})}var ITu,vTu,CTu,Uvt,jhe,xTu,p6h,f6h,ETu,d6h,a4,wTu=h(()=>{"use strict";yc();P2();Zn();It();i4();Mm();tr();a5o();ep();tc();fd();Cls();Dt();ITu=require("crypto"),vTu=Ae(Kkt(),1),CTu=Ae(Jkt(),1),Uvt=require("fs"),jhe=require("fs/promises"),xTu=Ae(eQ(),1);Ko();Io();X1u();Ols();$1u();gls();Als();tTu();zci();nTu();Uls();hTu();ATu();Gls();bTu();qls();vTu.default.extend(CTu.default);p6h=4;f6h=e=>e.map(t=>({...t,fileId:String(t.relativeFilePath)})),ETu=0,d6h=async({ir:e})=>(ETu++,`${_zo(e.apiName)}-${ETu}`),a4=class{domain;docsWorkspace;ossWorkspaces;apiWorkspaces;taskContext;editThisPage;uploadFiles;registerApi;onApiRegistrationQueued;onNavigationTreeBuilt;targetAudiences;docsVisibility;buildTranslatedApiDefinitions;buildRefVersions;skipApiReferences;cliVersion;cliName;refWorkspacesByFernFolder=new Map;markdownFilesToPathName={};constructor({domain:t,docsWorkspace:r,ossWorkspaces:n,apiWorkspaces:i,taskContext:o,editThisPage:s,uploadFiles:a=f6h,registerApi:c=d6h,onApiRegistrationQueued:l,onNavigationTreeBuilt:u,targetAudiences:p,docsVisibility:d="public",buildTranslatedApiDefinitions:f=!1,buildRefVersions:m=!0,skipApiReferences:g=!1,cliVersion:A,cliName:y="fern"}){this.domain=t,this.docsWorkspace=r,this.ossWorkspaces=n,this.apiWorkspaces=i,this.taskContext=o,this.editThisPage=s,this.uploadFiles=a,this.registerApi=c,this.onApiRegistrationQueued=l,this.onNavigationTreeBuilt=u,this.targetAudiences=p,this.docsVisibility=d,this.buildTranslatedApiDefinitions=f,this.buildRefVersions=m,this.skipApiReferences=g,this.cliVersion=A,this.cliName=y}#e=_ci.init();shouldIncludeByAudience(t){return!t||t.length===0||!this.targetAudiences||this.targetAudiences.length===0?!0:t.some(r=>this.targetAudiences?.includes(r))}applyAudienceFiltering(t){let r=this.filterNavigationByAudience(t.navigation);return{...t,navigation:r}}filterNavigationByAudience(t){return t.type==="untabbed"||t.type==="tabbed"?t:t.type==="versioned"?{...t,versions:t.versions.filter(r=>this.shouldIncludeByAudience(this.getRawVersionAudiences(r.version)))}:t.type==="productgroup"?{...t,products:t.products.filter(r=>{let n=this.getRawProductAudiences(r.product);return this.shouldIncludeByAudience(n)})}:t}getRawProductAudiences(t){let n=this.docsWorkspace.config.products?.find(i=>i.displayName===t);return oUt(n?.audiences)}getRawVersionAudiences(t){let n=this.docsWorkspace.config.versions?.find(i=>i.displayName===t);return oUt(n?.audiences)}_parsedDocsConfig;get parsedDocsConfig(){if(this._parsedDocsConfig==null)throw new w({message:"parsedDocsConfig is not set",code:w.Code.InternalError});return this._parsedDocsConfig}getTranslationPages(){return this._parsedDocsConfig?.translationPages}getTranslationNavigationOverlays(){return this._parsedDocsConfig?.translationNavigationOverlays}getCollectedFileIds(){return this.collectedFileIds}getDocsWorkspacePath(){return this.docsWorkspace.absoluteFilePath}getSkippedApiDefinitions(){return this.skippedApiDefinitions}getTranslatedApiSpecs(){return this.translatedApiSpecs}getMarkdownFilesToPathName(){return this.markdownFilesToPathName}getDocsTranslationsConfig(){let t=this.parsedDocsConfig.translations;if(t==null||t.length===0)return;let r=t.map(i=>Fa.DocsYmlSchemas.normalizeTranslationConfig(i)),n=r.find(i=>i.default===!0)??r[0];if(n!=null)return{defaultLocale:n.lang,translations:r.map(i=>i.lang)}}collectedFileIds=new Map;markdownFilesToFullSlugs=new Map;markdownFilesToSidebarTitle=new Map;markdownFilesToNoIndex=new Map;markdownFilesToTags=new Map;markdownFilesToAvailability=new Map;rawMarkdownFiles={};referencedMarkdownFiles=[];pendingApiRegistrations=[];pendingApiCounter=0;skippedApiCounter=0;skippedApiDefinitions={};translatedApiSpecs=new Map;async resolve(){let t=performance.now(),r=process.memoryUsage();this.referencedMarkdownFiles=[],this.taskContext.logger.debug("Parsing docs configuration...");let n=performance.now();this._parsedDocsConfig=await r4e({rawDocsConfiguration:this.docsWorkspace.config,context:this.taskContext,absolutePathToFernFolder:this.docsWorkspace.absoluteFilePath,absoluteFilepathToDocsConfig:this.docsWorkspace.absoluteFilepathToDocsConfig,buildRefVersions:this.buildRefVersions});let i=performance.now()-n,o=Object.keys(this.parsedDocsConfig.pages).length;this.taskContext.logger.debug(`Parsed docs configuration in ${i.toFixed(0)}ms: ${o} pages`),this.targetAudiences&&this.targetAudiences.length>0&&(this._parsedDocsConfig=this.applyAudienceFiltering(this._parsedDocsConfig)),this.taskContext.logger.debug("Storing raw markdown content...");for(let[qe,mt]of Object.entries(this.parsedDocsConfig.pages))this.rawMarkdownFiles[be.of(qe)]=sO(mt);let s=this.parsedDocsConfig.experimental?.openapiParserV3,a=s!=null&&!s;if(this.docsWorkspace.config.navigation!=null&&a&&!this.skipApiReferences){this.taskContext.logger.debug("Visiting navigation AST for changelog files...");let qe=performance.now();await yTu({navigation:this.docsWorkspace.config.navigation,visitor:{apiSection:async({workspace:At})=>{(await At.toFernWorkspace({context:this.taskContext},{enableUniqueErrorsPerEndpoint:!0,detectGlobalHeaders:!1,preserveSchemaIds:!0,objectQueryParameters:!0,respectReadonlySchemas:!0,docsVisibility:this.docsVisibility})).changelog?.files.forEach(er=>{let Ce=mo(this.docsWorkspace.absoluteFilePath,er.absoluteFilepath);this.parsedDocsConfig.pages[Ce]=er.contents,this.rawMarkdownFiles[be.of(Ce)]=sO(er.contents)})}},apiWorkspaces:this.apiWorkspaces,context:this.taskContext});let mt=performance.now()-qe;this.taskContext.logger.debug(`Visited navigation AST in ${mt.toFixed(0)}ms`)}this.taskContext.logger.debug("Building markdown file maps...");let c=performance.now();this.extractAllFrontmatterData(this.parsedDocsConfig.pages);let l=performance.now()-c;this.taskContext.logger.debug(`Built markdown file maps in ${l.toFixed(0)}ms`),this.taskContext.logger.debug("Replacing referenced markdown and code files...");let u=performance.now(),p=new Set,d=Object.entries(this.parsedDocsConfig.pages),f=[];for(let[,qe]of d)f.push(...xci(qe));let m=Date.now(),g=await Sci(f,this.taskContext);if(g.size>0){let qe=new Set(f).size;this.taskContext.logger.info(`Prefetched ${qe} external code URLs in ${Date.now()-m}ms`)}for(let[qe,mt]of d){let At=await Ck({markdown:mt,absolutePathToFernFolder:this.docsWorkspace.absoluteFilePath,absolutePathToMarkdownFile:this.resolveFilepath(qe),context:this.taskContext});for(let Ce of At.referencedFiles)p.has(Ce.absoluteFilePath)||(p.add(Ce.absoluteFilePath),this.referencedMarkdownFiles.push(Ce));let Ht=await r4({markdown:At.markdown,absolutePathToFernFolder:this.docsWorkspace.absoluteFilePath,absolutePathToMarkdownFile:this.resolveFilepath(qe),context:this.taskContext,urlCache:g}),er=n4({markdown:Ht,absolutePathToFernFolder:this.docsWorkspace.absoluteFilePath,absolutePathToMarkdownFile:this.resolveFilepath(qe),context:this.taskContext});this.parsedDocsConfig.pages[be.of(qe)]=er}let A=performance.now()-u;this.taskContext.logger.debug(`Replaced referenced content in ${A.toFixed(0)}ms, found ${this.referencedMarkdownFiles.length} referenced markdown files`),this.taskContext.logger.debug("Collecting files from docs config...");let y=performance.now(),I=await mTu({parsedDocsConfig:this.parsedDocsConfig}),C=performance.now()-y;this.taskContext.logger.debug(`Collected ${I.size} files in ${C.toFixed(0)}ms`);let x=await eTu({absolutePathToFernFolder:this.docsWorkspace.absoluteFilePath});x.length>0&&(this.taskContext.logger.debug(`Collected ${x.length} well-known agent skills files`),x.forEach(qe=>I.add(qe))),this.taskContext.logger.debug("Parsing image paths from markdown files...");let S=performance.now();for(let[qe,mt]of Object.entries(this.parsedDocsConfig.pages))try{let{filepaths:At,markdown:Ht}=pJ(mt,{absolutePathToMarkdownFile:this.resolveFilepath(qe),absolutePathToFernFolder:this.docsWorkspace.absoluteFilePath});this.parsedDocsConfig.pages[be.of(qe)]=Ht;for(let er of At)I.add(er)}catch(At){throw this.taskContext.logger.error(`Failed to parse ${qe}: ${tn(At)}`),new w({message:`Failed to parse markdown file ${qe}: ${tn(At)}`,code:w.Code.ParseError})}let B=performance.now()-S;this.taskContext.logger.debug(`Parsed image paths in ${B.toFixed(0)}ms`);let D=Array.from(I).map(qe=>({absoluteFilePath:qe,relativeFilePath:this.toRelativeFilepath(qe)}));this.taskContext.logger.info(`Uploading ${D.length} files...`);let R=performance.now(),O=await this.uploadFiles(D),z=performance.now()-R;this.taskContext.logger.info(`Uploaded ${O.length} files in ${z.toFixed(0)}ms`),O.forEach(qe=>{this.collectedFileIds.set(qe.absoluteFilePath,qe.fileId)}),this.resolveTranslationOverlayNavbarLinkIcons(),this.taskContext.logger.debug("Building navigation tree...");let Y=performance.now(),$=await this.toRootNode(),ee=performance.now()-Y;this.taskContext.logger.debug(`Built navigation tree in ${ee.toFixed(0)}ms`),this.onNavigationTreeBuilt?.(),this.taskContext.logger.debug("Getting fully qualified path names...");let se=performance.now(),ue=await this.getMarkdownFilesToFullyQualifiedPathNames($);this.markdownFilesToPathName=ue;let oe=performance.now()-se;if(this.taskContext.logger.debug(`Got path names in ${oe.toFixed(0)}ms`),this.pendingApiRegistrations.length>0){this.taskContext.logger.debug(`Processing ${this.pendingApiRegistrations.length} deferred API registrations...`);let qe=performance.now(),mt=this.pendingApiRegistrations,At=[],Ht=new Map;for(let ut of mt){this.resolveLinksInIrDocs(ut.ir,ue);let Ie=ut.workspace?.getSources().map(pt=>[pt.absoluteFilePath,pt.absoluteFilePathToOverrides]),we=(0,ITu.createHash)("sha256").update(JSON.stringify({ir:ut.ir,snippetsConfig:ut.snippetsConfig,playgroundConfig:ut.playgroundConfig,apiName:ut.apiName,workspace:Ie,graphqlOperations:ut.graphqlOperations,graphqlTypes:ut.graphqlTypes})).digest("hex");At.push(we),Ht.has(we)||Ht.set(we,ut)}let er=[...Ht.entries()],Ce=await gTu(er,qci(),async([,ut])=>await this.registerApi({ir:ut.ir,snippetsConfig:ut.snippetsConfig,playgroundConfig:ut.playgroundConfig,apiName:ut.apiName,workspace:ut.workspace,graphqlOperations:ut.graphqlOperations,graphqlTypes:ut.graphqlTypes})),ge=new Map(er.map(([ut],Ie)=>[ut,Ce[Ie]]));for(let[ut,Ie]of mt.entries()){let we=At[ut],pt=we!=null?ge.get(we):void 0;if(pt==null)throw new Error(`Registering API ${Ie.apiName??Ie.tempApiDefinitionId} returned no definition id`);if(e5e(Ie.apiReferenceNode,Ie.tempApiDefinitionId,pt),Ie.translatedIrsByLocale!=null)for(let[We,je]of Ie.translatedIrsByLocale){this.resolveLinksInIrDocs(je,ue);let it=this.translatedApiSpecs.get(We);it==null&&(it=new Map,this.translatedApiSpecs.set(We,it)),it.set(pt,{ir:je,snippetsConfig:Ie.snippetsConfig,playgroundConfig:Ie.playgroundConfig,apiName:Ie.apiName,graphqlOperations:Ie.graphqlOperations,graphqlTypes:Ie.graphqlTypes,workspace:Ie.workspace})}}let nt=performance.now()-qe;this.taskContext.logger.debug(`Processed deferred API registrations in ${nt.toFixed(0)}ms`),this.pendingApiRegistrations=[]}this.taskContext.logger.debug("Replacing image paths and URLs in markdown...");let me=performance.now();for(let[qe,mt]of Object.entries(this.parsedDocsConfig.pages))try{this.parsedDocsConfig.pages[be.of(qe)]=X3(mt,this.collectedFileIds,ue,{absolutePathToMarkdownFile:this.resolveFilepath(qe),absolutePathToFernFolder:this.docsWorkspace.absoluteFilePath},this.taskContext)}catch(At){throw new w({message:`Failed to replace image paths in markdown file ${qe}: ${tn(At)}`,code:w.Code.ParseError})}let xe=performance.now()-me;this.taskContext.logger.debug(`Replaced image paths in ${xe.toFixed(0)}ms`),this.taskContext.logger.debug("Building page content...");let Be={};Object.entries(this.parsedDocsConfig.pages).forEach(([qe,mt])=>{let{url:At,launch:Ht}=h6h(this.editThisPage,qe),er=this.rawMarkdownFiles[be.of(qe)];Be[BS.PageId(qe)]={markdown:sO(mt),editThisPageUrl:At?BS.Url(At):void 0,editThisPageLaunch:Ht,rawMarkdown:er}}),this.taskContext.logger.debug("Converting docs configuration...");let pe=performance.now(),ce=await this.convertDocsConfiguration($),Pe=performance.now()-pe;this.taskContext.logger.debug(`Converted docs configuration in ${Pe.toFixed(0)}ms`);let Ee={};if(this._parsedDocsConfig.experimental?.mdxComponents!=null){this.taskContext.logger.debug("Processing MDX components...");let qe=performance.now(),mt=await Rci({absolutePathToDocsWorkspace:this.docsWorkspace.absoluteFilePath,mdxComponents:this._parsedDocsConfig.experimental.mdxComponents});Ee=Object.fromEntries(await Promise.all(mt.map(async Ht=>{let er=this.toRelativeFilepath(Ht),Ce=(await(0,jhe.readFile)(Ht)).toString();return[er,await this.bundleJsFileContents(Ht,Ce)]})));let At=performance.now()-qe;this.taskContext.logger.debug(`Processed ${mt.length} MDX component files in ${At.toFixed(0)}ms`)}if(this.referencedMarkdownFiles.length>0){this.taskContext.logger.debug(`Adding ${this.referencedMarkdownFiles.length} referenced markdown files to jsFiles...`);for(let qe of this.referencedMarkdownFiles)Ee[qe.relativeFilePath]=qe.content}if(this._parsedDocsConfig.header!=null){let qe=this.toRelativeFilepath(this._parsedDocsConfig.header),mt=(await(0,jhe.readFile)(this._parsedDocsConfig.header)).toString();Ee[qe]=await this.bundleJsFileContents(this._parsedDocsConfig.header,mt),this.taskContext.logger.debug(`Added custom header component: ${qe}`)}if(this._parsedDocsConfig.footer!=null){let qe=this.toRelativeFilepath(this._parsedDocsConfig.footer),mt=(await(0,jhe.readFile)(this._parsedDocsConfig.footer)).toString();Ee[qe]=await this.bundleJsFileContents(this._parsedDocsConfig.footer,mt),this.taskContext.logger.debug(`Added custom footer component: ${qe}`)}let Fe=performance.now()-t,Le=process.memoryUsage();return this.taskContext.logger.debug(`Total resolve time: ${Fe.toFixed(0)}ms, Memory delta: RSS=${((Le.rss-r.rss)/1024/1024).toFixed(2)}MB`),{config:ce,pages:Be,jsFiles:Ee}}resolveFilepath(t){if(t!=null)return Mn(this.docsWorkspace.absoluteFilePath,t)}toRelativeFilepath(t){if(t!=null)return mo(this.docsWorkspace.absoluteFilePath,t)}extractAllFrontmatterData(t){for(let[r,n]of Object.entries(t)){let i=(0,xTu.default)(n),o=this.resolveFilepath(r),s=i.data.slug;if(typeof s=="string"&&s.trim().length>0){let p=s.trim();mvt(p)?this.markdownFilesToFullSlugs.set(o,p):this.taskContext.logger.warn(`Ignoring absolute URL slug "${p}" in ${r}. Absolute URLs are not allowed for frontmatter slugs.`)}let a=i.data["sidebar-title"];typeof a=="string"&&a.trim().length>0&&this.markdownFilesToSidebarTitle.set(o,a.trim());let c=i.data.noindex;typeof c=="boolean"&&this.markdownFilesToNoIndex.set(o,c);let l=i.data.tags;typeof l=="string"?this.markdownFilesToTags.set(o,l.split(",").map(p=>p.trim()).filter(p=>p.length>0)):Array.isArray(l)&&this.markdownFilesToTags.set(o,l);let u=i.data.availability;if(typeof u=="string"){let p=this.parseAvailabilityFromFrontmatter(u);p!=null&&this.markdownFilesToAvailability.set(o,p)}}}parseAvailabilityFromFrontmatter(t){switch(t.toLowerCase().trim()){case"stable":return"stable";case"generally-available":return"generally-available";case"in-development":return"in-development";case"pre-release":return"pre-release";case"deprecated":return"deprecated";case"beta":return"beta";default:this.taskContext.logger.warn(`Invalid availability value "${t}" in frontmatter. Valid values are: stable, generally-available, in-development, pre-release, deprecated, beta`);return}}async getMarkdownFilesToFullyQualifiedPathNames(t){let r={},n=Gt.migrate.FernNavigationV1ToLatest.create().root(t),i=new Set;Gt.traverseDF(n,a=>{a.type==="version"&&!a.default&&i.add(a.slug)});let o=a=>{let c=a.split("/");return c.some((l,u)=>i.has(c.slice(0,u+1).join("/")))};return Gt.NodeCollector.collect(n).slugMap.forEach((a,c)=>{if(a==null||!Gt.isPage(a))return;let l=Gt.getPageId(a);if(l==null)return;let u=Re(this.docsWorkspace.absoluteFilePath,be.of(l)),p=r[u];(p==null||o(p)&&!o(c))&&(r[u]=c)}),r}getDocsBasePath(){return new URL(xN(this.domain)).pathname}async convertDocsConfiguration(t){let r=this.parsedDocsConfig.integrations!=null||this.parsedDocsConfig.context7File!=null?{...this.parsedDocsConfig.integrations,context7:this.getFileId(this.parsedDocsConfig.context7File)}:void 0;return{aiChatConfig:this.parsedDocsConfig.aiChatConfig!=null?{model:this.parsedDocsConfig.aiChatConfig.model,systemPrompt:this.parsedDocsConfig.aiChatConfig.systemPrompt,location:this.parsedDocsConfig.aiChatConfig.location?.filter(i=>i==="slack"||i==="docs"),datasources:this.parsedDocsConfig.aiChatConfig.datasources?.map(i=>({url:i.url,title:i.title})),maskPii:this.parsedDocsConfig.aiChatConfig.maskPii,disclaimer:this.parsedDocsConfig.aiChatConfig.disclaimer,buttonText:this.parsedDocsConfig.aiChatConfig.buttonText}:void 0,hideNavLinks:void 0,title:this.parsedDocsConfig.title,logoHeight:this.parsedDocsConfig.logo?.height,logoHref:this.parsedDocsConfig.logo?.href?BS.Url(this.parsedDocsConfig.logo?.href):void 0,logoRightText:this.parsedDocsConfig.logo?.rightText,favicon:this.getFileId(this.parsedDocsConfig.favicon),navigation:void 0,root:t,colorsV3:this.convertColorConfigImageReferences(),navbarLinks:this.parsedDocsConfig.navbarLinks?.map(i=>i.type==="dropdown"?{...i,links:i.links?.map(o=>({...o,url:BS.Url(o.url),icon:this.resolveIconFileId(o.icon),rightIcon:this.resolveIconFileId(o.rightIcon)})),icon:this.resolveIconFileId(i.icon),rightIcon:this.resolveIconFileId(i.rightIcon)}:i.type==="github"?{...i,url:BS.Url(i.url)}:{...i,url:BS.Url(i.url),icon:this.resolveIconFileId(i.icon),rightIcon:this.resolveIconFileId(i.rightIcon)}),typographyV2:this.convertDocsTypographyConfiguration(),layout:this.parsedDocsConfig.layout,settings:this.convertDocsSettings(),css:this.parsedDocsConfig.css,js:this.convertJavascriptConfiguration(),agents:this.parsedDocsConfig.agents!=null||this.parsedDocsConfig.llmsTxtFile!=null||this.parsedDocsConfig.llmsFullTxtFile!=null||this.parsedDocsConfig.robotsTxtFile!=null||this.parsedDocsConfig.experimental?.robotsTxtOnInstanceUrl===!0?{...this.parsedDocsConfig.agents,llmsTxt:this.getFileId(this.parsedDocsConfig.llmsTxtFile),llmsFullTxt:this.getFileId(this.parsedDocsConfig.llmsFullTxtFile),robotsTxt:this.getFileId(this.parsedDocsConfig.robotsTxtFile),robotsTxtOnInstanceUrl:this.parsedDocsConfig.experimental?.robotsTxtOnInstanceUrl}:void 0,metadata:this.convertMetadata(),redirects:this.parsedDocsConfig.redirects,integrations:r,footerLinks:this.parsedDocsConfig.footerLinks?.map(i=>({...i,value:BS.Url(i.value)})),defaultLanguage:this.parsedDocsConfig.defaultLanguage,languages:this.parsedDocsConfig.languages,translations:this.getDocsTranslationsConfig(),analyticsConfig:{...this.parsedDocsConfig.analyticsConfig,segment:this.parsedDocsConfig.analyticsConfig?.segment,fullstory:this.parsedDocsConfig.analyticsConfig?.fullstory,intercom:this.parsedDocsConfig.analyticsConfig?.intercom?{appId:this.parsedDocsConfig.analyticsConfig.intercom.appId,apiBase:this.parsedDocsConfig.analyticsConfig.intercom.apiBase}:void 0,posthog:this.parsedDocsConfig.analyticsConfig?.posthog?{apiKey:this.parsedDocsConfig.analyticsConfig.posthog.apiKey,endpoint:this.parsedDocsConfig.analyticsConfig.posthog.endpoint}:void 0,gtm:this.parsedDocsConfig.analyticsConfig?.gtm?{containerId:this.parsedDocsConfig.analyticsConfig.gtm.containerId}:void 0,ga4:this.parsedDocsConfig.analyticsConfig?.ga4?{measurementId:this.parsedDocsConfig.analyticsConfig.ga4.measurementId}:void 0,amplitude:void 0,mixpanel:void 0,hotjar:void 0,koala:void 0,logrocket:void 0,pirsch:void 0,plausible:void 0,fathom:void 0,clearbit:void 0,heap:void 0},announcement:this.parsedDocsConfig.announcement!=null?{text:this.parsedDocsConfig.announcement.message}:void 0,editThisPageLaunch:this.editThisPage?.launch,embedding:this.parsedDocsConfig.settings?.embedding!=null?{allowedOrigins:this.parsedDocsConfig.settings.embedding.allowedOrigins}:void 0,pageActions:this.convertPageActions(),theme:this.parsedDocsConfig.theme!=null?{sidebar:this.parsedDocsConfig.theme.sidebar,body:this.parsedDocsConfig.theme.body,tabs:g6h(this.parsedDocsConfig.theme.tabs),"page-actions":this.parsedDocsConfig.theme.pageActions,footerNav:this.parsedDocsConfig.theme.footerNav,"language-switcher":this.parsedDocsConfig.theme.languageSwitcher,"product-switcher":this.parsedDocsConfig.theme.productSwitcher,"site-switcher":A6h(this.parsedDocsConfig.theme.siteSwitcher),...y6h(this.parsedDocsConfig.theme.codeBlocks)}:void 0,logo:void 0,logoV2:void 0,colors:void 0,colorsV2:void 0,typography:void 0,backgroundImage:void 0,header:this.parsedDocsConfig.header?this.toRelativeFilepath(this.parsedDocsConfig.header):void 0,footer:this.parsedDocsConfig.footer?this.toRelativeFilepath(this.parsedDocsConfig.footer):void 0}}async bundleJsFileContents(t,r){try{return await Dci({absoluteFilePath:t,contents:r,context:this.taskContext})??r}catch(n){throw new w({message:`Failed to bundle third-party imports in ${t}: ${tn(n)}`,code:w.Code.ParseError})}}async resolveApiWorkspaces(t){if(t==null)return{apiWorkspaces:this.apiWorkspaces,ossWorkspaces:this.ossWorkspaces};let r=t.absolutePathToFernFolder,n=this.refWorkspacesByFernFolder.get(r);if(n!=null)return n;if(this.cliVersion==null)throw new w({message:`Cannot load API definitions for version '${t.displayVersion}' (ref '${t.ref}'): the CLI version is unavailable in this context.`,code:w.Code.InternalError});let i=this.cliVersion,o=(async()=>{let s=await Nci({cliName:this.cliName,fernDirectory:r,context:this.taskContext,cliVersion:i,commandLineApiWorkspace:void 0,defaultToAllApiWorkspaces:!0}),a=s.filter(c=>c instanceof gl);return{apiWorkspaces:s,ossWorkspaces:a}})();return this.refWorkspacesByFernFolder.set(r,o),o}getFernWorkspaceForApiSection(t,r){if(t.apiName!=null){let i=r.find(o=>o.workspaceName===t.apiName);if(i!=null)return i}else if(r.length===1&&r[0]!=null)return r[0];let n=t.apiName?`Failed to load API Definition '${t.apiName}' referenced in docs.
|
|
1843
1844
|
A valid API configuration was not found at the path: fern/apis/${t.apiName}.
|
|
1844
1845
|
Learn more about project structure:
|
|
1845
1846
|
https://buildwithfern.com/learn/docs/getting-started/project-structure#api-definitions`:`Failed to load API Definition referenced in docs.
|
|
@@ -3470,7 +3471,7 @@ ${_Yl.default.cursorShow}`)}releaseCursor(){this.extraLinesUnderPrompt>0&&OGo(th
|
|
|
3470
3471
|
`).length),this}updateBottomBar(t){return SGt(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+`
|
|
3471
3472
|
`}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&&OXr(this.rl,t.length+this.rl.line.length),this.rl.output.write(t)}};var zd=Ae(F3(),1),sZl=Ae(rGt(),1);var aZr=Ae(F3(),1),iZl=Ae(rGt(),1),cZr=function(e,t,r){return typeof e[t]!="function"?(0,aZr.of)(e):(0,aZr.from)((0,iZl.default)(e[t])(r).then(n=>(e[t]=n,e)))};var oZl={set:(e,t="",r)=>{let n=e;t.split(".").forEach((i,o,s)=>{i==="__proto__"||i==="constructor"||(o===s.length-1?n[i]=r:(!(i in n)||typeof n[i]!="object")&&(n[i]={}),n=n[i])})},get:(e,t="",r)=>{let n=o=>String.prototype.split.call(t,o).filter(Boolean).reduce((s,a)=>s!=null?s[a]:s,e),i=n(/[,[\]]+?/)||n(/[,.[\]]+?/);return i===void 0||i===e?r:i}},Jct=class extends X_e{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,zd.from)(t):(0,zd.isObservable)(t)?n=t:Object.values(t).every(i=>typeof i=="object"&&!Array.isArray(i)&&i!=null)?n=(0,zd.from)(Object.entries(t).map(([i,o])=>({name:i,...o}))):n=(0,zd.from)([t]),this.process=n.pipe((0,zd.concatMap)(this.processQuestion.bind(this)),(0,zd.publish)()),this.process.connect(),this.process.pipe((0,zd.reduce)((i,o)=>(oZl.set(i,o.name,o.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,zd.defer)(()=>(0,zd.of)(t).pipe((0,zd.concatMap)(this.setDefaultType.bind(this)),(0,zd.concatMap)(this.filterIfRunnable.bind(this)),(0,zd.concatMap)(()=>cZr(t,"message",this.answers)),(0,zd.concatMap)(()=>cZr(t,"default",this.answers)),(0,zd.concatMap)(()=>cZr(t,"choices",this.answers)),(0,zd.concatMap)(this.fetchAnswer.bind(this))))}fetchAnswer(t){let r=this.prompts[t.type];return this.activePrompt=new r(t,this.rl,this.answers),(0,zd.defer)(()=>(0,zd.from)(this.activePrompt.run().then(n=>({name:t.name,answer:n}))))}setDefaultType(t){return this.prompts[t.type]||(t.type="input"),(0,zd.defer)(()=>(0,zd.of)(t))}filterIfRunnable(t){if(t.askAnswered!==!0&&oZl.get(this.answers,t.name)!==void 0)return zd.EMPTY;if(t.when===!1)return zd.EMPTY;if(typeof t.when!="function")return(0,zd.of)(t);let{answers:r}=this;return(0,zd.defer)(()=>(0,zd.from)((0,sZl.default)(t.when)(r).then(n=>{if(n)return t})).pipe((0,zd.filter)(n=>n!=null)))}};function aZl(e){let t=function(r,n){let i;try{i=new Jct(t.prompts,e)}catch(s){return Promise.reject(s)}let o=i.run(r,n);return o.ui=i,o};return t.prompts={},t.registerPrompt=function(r,n){return t.prompts[r]=n,this},t.restoreDefaultPrompts=function(){this.registerPrompt("list",TGt),this.registerPrompt("input",W_e),this.registerPrompt("number",OGt),this.registerPrompt("confirm",PGt),this.registerPrompt("rawlist",BGt),this.registerPrompt("expand",DGt),this.registerPrompt("checkbox",RGt),this.registerPrompt("password",kGt),this.registerPrompt("editor",_Gt)},t.restoreDefaultPrompts(),t}var Y9o=aZl();function U$m(e,t){Y9o.registerPrompt(e,t)}function V$m(){Y9o.restoreDefaultPrompts()}var G$m={prompt:Y9o,ui:{BottomBar:UGt,Prompt:Jct},createPromptModule:aZl,registerPrompt:U$m,restoreDefaultPrompts:V$m,Separator:EQ},yl=G$m;var q$m=["prod","pre-prod","beta","dev","local"];function W$m(e){return q$m.some(t=>t===e)}function wK(e="prod"){let t=e?.trim();return t!=null&&W$m(t)?t:"local"}function lZr(){let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal";return e==null||e.trim().length===0?!1:process.env.FERN_DISABLE_TELEMETRY!=="true"}var Yct=require("path");function lZl(){let e=H$m();return async t=>{for(let r of t)r.module=e(r.filename);return t}}function H$m(e=process.argv[1]?(0,Yct.dirname)(process.argv[1]):process.cwd(),t=Yct.sep==="\\"){let r=t?cZl(e):e;return n=>{if(!n)return;let i=t?cZl(n):n,{dir:o,base:s,ext:a}=Yct.posix.parse(i);(a===".js"||a===".mjs"||a===".cjs")&&(s=s.slice(0,-1*a.length));let c=decodeURIComponent(s);o||(o=".");let l=o.lastIndexOf("/node_modules");if(l>-1)return`${o.slice(l+14).replace(/\//g,".")}:${c}`;if(o.startsWith(r)){let u=o.slice(r.length+1).replace(/\//g,".");return u?`${u}:${c}`:c}return c}}function cZl(e){return e.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}var mT={};ne(mT,{DEFAULT_EXCEPTION_STEPS_CONFIG:()=>TZr,DOMExceptionCoercer:()=>dqo,EXCEPTION_STEP_INTERNAL_FIELDS:()=>ZGt,ErrorCoercer:()=>KGt,ErrorEventCoercer:()=>mqo,ErrorPropertiesBuilder:()=>HGt,EventCoercer:()=>hqo,ExceptionStepsBuffer:()=>bqo,ObjectCoercer:()=>YGt,PrimitiveCoercer:()=>XGt,PromiseRejectionEventCoercer:()=>gqo,ReduceableCache:()=>Aqo,StringCoercer:()=>JGt,chromeStackLineParser:()=>lqo,createDefaultStackParser:()=>fqo,createStackParser:()=>XZl,geckoStackLineParser:()=>uqo,getInjectedReleaseId:()=>ath,getUtf8ByteLength:()=>$Zl,nodeStackLineParser:()=>qZl,opera10StackLineParser:()=>UZl,opera11StackLineParser:()=>VZl,resolveExceptionStepsConfig:()=>yqo,reverseAndStripFrames:()=>YZl,stripReservedExceptionStepFields:()=>ith,winjsStackLineParser:()=>_Zl});var vQ=(function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",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.AiQueue="ai_queue",e.AiCaptureQueue="ai_capture_queue",e.LogsQueue="logs_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.PushRegistered="push_registered",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysInProgress="surveys_in_progress",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e})({});function ySe(e){let t=[];return JSON.stringify(e,function(r,n){if(typeof n=="bigint")return n.toString();if(!(typeof n=="function"||typeof n=="symbol")){if(n instanceof Error)return{name:n.name,message:n.message,stack:n.stack};if(n&&typeof n=="object"){for(;t.length>0&&t[t.length-1]!==this;)t.pop();if(t.includes(n))return"[Circular]";t.push(n)}return n}})??"null"}var K$m=Array.isArray,pZl=Object.prototype,X4v=pZl.hasOwnProperty,uZr=pZl.toString,j3=K$m||function(e){return uZr.call(e)==="[object Array]"};var VGt=e=>e===Object(e)&&!j3(e);var fme=e=>e===void 0,iR=e=>uZr.call(e)=="[object String]",X9o=e=>iR(e)&&e.trim().length===0,Z9o=e=>e===null,TK=e=>fme(e)||Z9o(e),Xct=e=>uZr.call(e)=="[object Number]"&&e===e;var fZl=e=>uZr.call(e)==="[object Boolean]";function pZr(e){return e===null||typeof e!="object"}function Z_e(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function bSe(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return hZl(e,Error)}}function dZl(e){return Z_e(e,"ErrorEvent")}function Zct(e){return"u">typeof Event&&hZl(e,Event)}function mZl(e){return Z_e(e,"Object")}function hZl(e,t){try{return e instanceof t}catch{return!1}}var J$m=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],fZr=new Map,Y$m=256;function X$m(e,t){let r="";for(let n=0;n<t.length;n++){let i=t[n];r+=i.length+":"+i}return e.length+":"+e+"|"+t.length+":"+r}var gZl=function(e,t=[]){if(!e)return!1;let r=X$m(e,t),n=fZr.get(r);if(n!==void 0)return n;let i=e.toLowerCase(),o=J$m.concat(t).some(s=>i.indexOf(s.toLowerCase())!==-1);return fZr.size>=Y$m&&fZr.clear(),fZr.set(r,o),o};function GGt(e,t,r,n,i){return t>r&&(n.warn("min cannot be greater than max."),t=r),Xct(e)?e>r?(n.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e<t?(n.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(n.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+i),GGt(i??r,t,r,n))}var Z$m=864e5,$$m=1,eeh=10;function AZl(e={}){return{refillRate:e.exceptionRateLimiterRefillRate??e.__exceptionRateLimiterRefillRate??$$m,bucketSize:e.exceptionRateLimiterBucketSize??e.__exceptionRateLimiterBucketSize??eeh}}var dZr=class{constructor(t){this._buckets={},this._onBucketRateLimited=t._onBucketRateLimited,this._bucketSize=GGt(t.bucketSize,0,100,t._logger),this._refillRate=GGt(t.refillRate,0,this._bucketSize,t._logger),this._refillInterval=GGt(t.refillInterval,0,Z$m,t._logger)}_applyRefill(t,r){let n=r-t.lastAccess,i=Math.floor(n/this._refillInterval);if(i>0){let o=i*this._refillRate;t.tokens=Math.min(t.tokens+o,this._bucketSize),t.lastAccess=t.lastAccess+i*this._refillInterval}}consumeRateLimit(t){let r=Date.now(),n=String(t),i=this._buckets[n];return i?this._applyRefill(i,r):(i={tokens:this._bucketSize,lastAccess:r},this._buckets[n]=i),i.tokens===0?!0:(i.tokens--,i.tokens===0&&this._onBucketRateLimited?.(t),i.tokens===0)}stop(){this._buckets={}}};var mZr="0123456789abcdef",hZr=class e{constructor(t){this.bytes=t}static ofInner(t){if(t.length===16)return new e(t);throw new TypeError("not 128-bit length")}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 o=new Uint8Array(16);return o[0]=t/2**40,o[1]=t/2**32,o[2]=t/2**24,o[3]=t/2**16,o[4]=t/256,o[5]=t,o[6]=112|r>>>8,o[7]=r,o[8]=128|n>>>24,o[9]=n>>>16,o[10]=n>>>8,o[11]=n,o[12]=i>>>24,o[13]=i>>>16,o[14]=i>>>8,o[15]=i,new e(o)}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;default:break}if(r){let n=new Uint8Array(16);for(let i=0;i<16;i+=4){let o=parseInt(r.substring(2*i,2*i+8),16);n[i+0]=o>>>24,n[i+1]=o>>>16,n[i+2]=o>>>8,n[i+3]=o}return new e(n)}throw new SyntaxError("could not parse UUID string")}toString(){let t="";for(let r=0;r<this.bytes.length;r++)t+=mZr.charAt(this.bytes[r]>>>4),t+=mZr.charAt(15&this.bytes[r]),(r===3||r===5||r===7||r===9)&&(t+="-");return t}toHex(){let t="";for(let r=0;r<this.bytes.length;r++)t+=mZr.charAt(this.bytes[r]>>>4),t+=mZr.charAt(15&this.bytes[r]);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}},$9o=class{constructor(t){this.timestamp=0,this.counter=0,this.random=t??teh()}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))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return hZr.fromFieldsV7(this.timestamp,Math.trunc(this.counter/2**30),this.counter&2**30-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}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,hZr.ofInner(t)}},teh=()=>({nextUint32:()=>65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random())>>>0}),yZl,w2=()=>reh().toString(),reh=()=>(yZl||(yZl=new $9o)).generate();var gZr=class{add(t){let r=w2(),n=++this.nextId;return this.promiseByIds[r]={id:n,promise:t},t.catch(()=>{}).finally(()=>{delete this.promiseByIds[r]}),t}async join(){let t=Object.values(this.promiseByIds).map(n=>n.promise),r=t.length;for(;r>0;)await Promise.all(t),t=Object.values(this.promiseByIds).map(n=>n.promise),r=t.length}getPromises(t=[],r=this.nextId){let n=new Set(t);return Object.values(this.promiseByIds).filter(i=>i.id<=r&&!n.has(i.promise)).map(i=>i.promise)}get maxId(){return this.nextId}get length(){return Object.keys(this.promiseByIds).length}constructor(){this.promiseByIds={},this.nextId=0}};function neh(e=console){return{log:e.log.bind(e),warn:e.warn.bind(e),error:e.error.bind(e),debug:e.debug.bind(e)}}var bZl=(e,t,r)=>{function n(o,...s){t(()=>{let a=r[o];a(e,...s)})}return{debug:(...o)=>{n("debug",...o)},info:(...o)=>{n("log",...o)},warn:(...o)=>{n("warn",...o)},error:(...o)=>{n("error",...o)},critical:(...o)=>{r.error(e,...o)},createLogger:o=>bZl(`${e} ${o}`,t,r)}},ieh=e=>e();function EZl(e,t=ieh){return bZl(e,t,neh())}var elt="Mobile",yZr="iOS",$ct="Android",SZl="Tablet",f_v=$ct+" "+SZl;var seh="Apple",d_v=seh+" Watch",wZl="Safari",bZr="BlackBerry",TZl="Samsung",aeh=TZl+"Browser",ceh=TZl+" Internet",EZr="Chrome",leh=EZr+" OS",ueh=EZr+" "+yZr,OZl="Internet Explorer",peh=OZl+" "+elt,rqo="Opera",m_v=rqo+" Mini",PZl="Edge",feh="Microsoft "+PZl,nqo="Firefox",deh=nqo+" "+yZr,iqo="Nintendo",oqo="PlayStation",AZr="Xbox",meh=$ct+" "+elt,heh=elt+" "+wZl,qGt="Windows",geh=qGt+" Phone";var BZl="Generic",h_v=BZl+" "+elt.toLowerCase(),g_v=BZl+" "+SZl.toLowerCase(),Aeh="Konqueror",yeh="Oculus Browser",IZl="Vivaldi",beh="Yandex",vZl="Whale",Eeh="DuckDuckGo",Ieh="Pale Moon",CZl="Waterfox",xZl="Brave",DZl="Claude",RZl="Codex",kZl="ChatGPT",veh="Google Search App",qb="(\\d+(\\.\\d+)?)",eqo=new RegExp("Version/"+qb),tqo=new RegExp("("+DZl+"|"+RZl+"|"+kZl+")\\/"+qb);var A_v=new RegExp(AZr,"i"),y_v=new RegExp(oqo+" \\w+","i"),b_v=new RegExp(iqo+" \\w+","i"),Ceh=new RegExp(bZr+"|PlayBook|BB10","i"),xeh={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000","5.1":"XP","5.2":"XP","6.0":"Vista","6.1":"7","6.2":"8","6.3":"8.1","6.4":"10","10.0":"10"};var E_v={[peh]:[new RegExp("rv:"+qb)],[feh]:[new RegExp(PZl+"?\\/"+qb)],[EZr]:[new RegExp("("+EZr+"|CrMo)\\/"+qb)],[ueh]:[new RegExp("CriOS\\/"+qb)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+qb)],[wZl]:[eqo],[heh]:[eqo],[rqo]:[new RegExp("("+rqo+"|OPR)\\/"+qb)],[nqo]:[new RegExp(nqo+"\\/"+qb)],[deh]:[new RegExp("FxiOS\\/"+qb)],[Aeh]:[new RegExp("Konqueror[:/]?"+qb,"i")],[bZr]:[new RegExp(bZr+" "+qb),eqo],[meh]:[new RegExp("android\\s"+qb,"i")],[ceh]:[new RegExp(aeh+"\\/"+qb)],[yeh]:[new RegExp("OculusBrowser\\/"+qb)],[IZl]:[new RegExp(IZl+"\\/"+qb)],[beh]:[new RegExp("YaBrowser\\/"+qb)],[vZl]:[new RegExp(vZl+"\\/"+qb)],[xZl]:[new RegExp(xZl+"\\/"+qb)],[DZl]:[tqo],[RZl]:[tqo],[kZl]:[tqo],[Eeh]:[new RegExp("(DuckDuckGo|Ddg)\\/"+qb)],[Ieh]:[new RegExp("PaleMoon\\/"+qb)],[CZl]:[new RegExp(CZl+"\\/"+qb)],[veh]:[new RegExp("GSA\\/"+qb)],[OZl]:[new RegExp("(rv:|MSIE )"+qb)],Mozilla:[new RegExp("rv:"+qb)]};var I_v=[[new RegExp(AZr+"; "+AZr+" (.*?)[);]","i"),e=>[AZr,e&&e[1]||""]],[new RegExp(iqo,"i"),[iqo,""]],[new RegExp(oqo,"i"),[oqo,""]],[Ceh,[bZr,""]],[new RegExp(qGt,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[geh,""];if(new RegExp(elt).test(t)&&!/IEMobile\b/.test(t))return[qGt+" "+elt,""];let r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){let n=r[1],i=xeh[n]||"";return/arm/i.test(t)&&(i="RT"),[qGt,i]}return[qGt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){let t=[e[3],e[4],e[5]||"0"];return[yZr,t.join(".")]}return[yZr,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{let t="";return e&&e.length>=3&&(t=fme(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+$ct+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+$ct+")","i"),e=>{if(e&&e[2]){let t=[e[2],e[3],e[4]||"0"];return[$ct,t.join(".")]}return[$ct,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{let t=["Mac OS X",""];if(e&&e[1]){let r=[e[1],e[2],e[3]||"0"];t[1]=r.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[leh,""]],[/Linux|debian/i,["Linux",""]]];var IZr="[Circular]",vZr="[Truncated]",M5="[Unserializable]",FZl="[Function]",x_v=Date.prototype.getTime,S_v=Date.prototype.toISOString;function Ute(e){let t="";for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n>=55296&&n<=56319){let i=e.charCodeAt(r+1);i>=56320&&i<=57343?(t+=e[r]+e[r+1],r++):t+="\uFFFD"}else t+=n>=56320&&n<=57343?"\uFFFD":e[r]}return t}function dme(e,t){if(!t)return e;let r=[];try{r=Object.keys(t)}catch{r=[]}for(let n of r){let i;try{i=t[n]}catch{i=M5}Object.defineProperty(e,n,{value:i,enumerable:!0,writable:!0,configurable:!0})}return e}function sqo(e,t=Date.now()){if(typeof e!="string"||!e)return;let r=e.trim(),n=/^\d+\s*,/.test(r)?r.slice(0,r.indexOf(",")).trim():r;if(/^\d+$/.test(n)){let s=1e3*Math.min(Number(n),300);return s>0?s:void 0}if(!/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(n))return;let i=/^\w{3} \w{3} /.test(n)?n+" GMT":n,o=Date.parse(i)-t;if(!(!Number.isFinite(o)||o<=0))return Math.min(o,3e5)}var $_e=class{record(t){if(t.kind==="too-large")return;if(t.kind!=="retry-later")return void this.reset();if(!t.retryAfterMs)return;let r=this.isOpen(),n=Date.now(),i=Math.min(t.retryAfterMs,3e5);if(!r){this._installedAt=n,this._until=n+i;return}this._until=Math.max(this._until,Math.min(n+i,this._installedAt+3e5))}remainingMs(){let t=Date.now();if(t<this._installedAt-5e3)return this.reset(),0;let r=Math.min(3e5,Math.max(0,this._until-t));return r===0&&this.reset(),r}isOpen(){return this.remainingMs()>0}reset(){this._until=0,this._installedAt=0}constructor(){this._until=0,this._installedAt=0}};var NZl="utf8",Seh=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function weh(e){return typeof e=="string"&&Seh.test(e)}function eUe(e,t){return weh(e)?e:t()}function tlt(e,t){let r=new Error(t);try{Object.defineProperty(r,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch{}return r}function jZl(e){return e?.replace(/\/+$/,"")}async function zZl(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 aqo(){return new Date().toISOString()}function T2(e,t){let r=setTimeout(e,t);return r?.unref&&r?.unref(),r}async function ESe(e,t,r){let n;try{return await Promise.race([e,new Promise((i,o)=>{n=T2(()=>{try{r?.(),i()}catch(s){o(s)}},t)})])}finally{clearTimeout(n)}}var QZl=e=>e&&typeof e.then=="function";function WGt(e){return Promise.all(e.map(t=>(t??Promise.resolve()).then(r=>({status:"fulfilled",value:r}),r=>({status:"rejected",reason:r}))))}var CZr,MZl,xZr;function LZl(e){let t=globalThis._posthogChunkIds;if(!t)return;let r=Object.keys(t);return xZr&&r.length===MZl||(MZl=r.length,xZr=r.reduce((n,i)=>{CZr||(CZr={});let o=CZr[i];if(o)n[o[0]]=o[1];else{let s=e(i);for(let a=s.length-1;a>=0;a--){let l=s[a]?.filename,u=t[i];if(l&&u){n[l]=u,CZr[i]=[l,u];break}}}return n},{})),xZr}var cqo=50,Teh=1e3,Oeh=100,Peh=4,HGt=class{constructor(t,r,n=[]){this.coercers=t,this.stackParser=r,this.modifiers=n}buildFromUnknown(t,r={}){let i=r&&r.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(i,r,0).apply(t),a=this.buildParsingContext(r),c=this.parseStacktrace(s,a);return{$exception_list:this.convertToExceptionList(c,i),$exception_level:"error"}}async modifyFrames(t){for(let r of t)r.stacktrace&&r.stacktrace.frames&&j3(r.stacktrace.frames)&&(r.stacktrace.frames=await this.applyModifiers(r.stacktrace.frames));return t}coerceFallback(t){return{type:"Error",value:"Unknown error",stack:t.syntheticException?.stack,synthetic:!0}}parseStacktrace(t,r){let n;t.cause!=null&&(n=this.parseStacktrace(t.cause,r));let i;if(t.stack!=""&&t.stack!=null)try{i=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?r.skipFirstLines:0),r.chunkIdMap)}catch{}return{...t,cause:n,stack:i,errors:t.errors?.map(o=>this.parseStacktrace(o,r))}}applyChunkIds(t,r){return t.map(n=>(n.filename&&r&&(n.chunk_id=r[n.filename]),n))}applyCoercers(t,r){for(let n of this.coercers)if(n.match(t))return n.coerce(t,r);return this.coerceFallback(r)}async applyModifiers(t){let r=t;for(let n of this.modifiers)r=await n(r);return r}convertToExceptionList(t,r){let n=[],i=(o,s,a)=>{let c=n.length,l=s===void 0?{type:typeof r.type=="string"&&r.type.length>0?r.type:"generic",...typeof r.handled=="boolean"?{handled:r.handled}:r.handled===void 0?{handled:!0}:{},synthetic:typeof r.synthetic=="boolean"?r.synthetic:o.synthetic,exception_id:c}:{type:"chained",source:a,synthetic:o.synthetic,exception_id:c,parent_id:s},u={type:o.type,value:o.value,mechanism:l};o.stack&&(u.stacktrace={type:"raw",frames:o.stack}),n.push(u),o.cause&&i(o.cause,c,"cause");for(let p of o.errors??[])i(p,c,"member")};return i(t),n}buildParsingContext(t){return{chunkIdMap:LZl(this.stackParser),skipFirstLines:t.skipFirstLines??1}}getAggregateErrors(t){try{if(bSe(t)){let r=Object.getPrototypeOf(t);for(let n=0;r&&n<Oeh;n++){let i=Object.getOwnPropertyDescriptor(r,"constructor")?.value;if(typeof i=="function"&&i.name==="AggregateError"){let o=t.errors;return j3(o)?o:void 0}r=Object.getPrototypeOf(r)}}}catch{}}buildCoercingContext(t,r,n=0){let i=0,o=0,s=!1,a=new Set,c=[],l={},u=(f,m,g=0)=>{let A=p(m,g),y=A.apply;if(A.apply=D=>{c.push(f);try{return y(D)}finally{c.pop()}},g>Peh||g>0&&c.indexOf(f)!==-1)return this.coerceFallback(A);let I=typeof f=="object"&&f!==null||typeof f=="function";if(g===0&&i>=cqo||I&&a.has(f))return;I&&a.add(f),g===0&&i++;let C=this.getAggregateErrors(f);s||=!!C;let x;try{if(x=this.applyCoercers(f,A),!x)throw l}catch(D){if(D===l){g===0&&i--;return}if(!s)throw D;x=this.coerceFallback(A)}if(!C||i>=cqo)return x;let S;try{S=C.length}catch{return x}if(!Number.isInteger(S)||S<0||S>4294967295)return x;let B=[];for(let D=0;i<cqo&&o<Teh&&D<S;D++){o++;let R;try{R=A.next(C[D])}catch{i++,R=this.coerceFallback(p(m+1))}R&&B.push(R)}return{...x,errors:B}},p=(f,m=0)=>({...r,syntheticException:f==0?r.syntheticException:void 0,mechanism:f==0?t:{},apply:g=>{let A=u(g,f,m+1);if(!A)throw l;return A},next:g=>u(g,f+1)}),d=p(n);return{...d,apply:f=>u(f,n)??this.coerceFallback(d)}}};var oB="?",Beh="<anonymous>",Deh=/^([a-z][a-z0-9.+-]+):/i,Reh=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function keh(e){if(!e||e===Beh)return!1;let t=Deh.exec(e);return!t||Reh.includes(t[1].toLowerCase())}function Vte(e,t,r,n,i){let o={platform:e,filename:t,function:r==="<anonymous>"?oB:r,in_app:keh(t)};return fme(n)||(o.lineno=n),fme(i)||(o.colno=i),o}var SZr=(e,t)=>{let r=e.indexOf("safari-extension")!==-1,n=e.indexOf("safari-web-extension")!==-1;return r||n?[e.indexOf("@")!==-1?e.split("@")[0]:oB,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};var Feh=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Neh=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,jeh=/\((\S*)(?::(\d+))(?::(\d+))\)/,lqo=(e,t)=>{let r=Feh.exec(e);if(r){let[,i,o,s]=r;return Vte(t,i,oB,+o,+s)}let n=Neh.exec(e);if(n){if(n[2]&&n[2].indexOf("eval")===0){let a=jeh.exec(n[2]);a&&(n[2]=a[1],n[3]=a[2],n[4]=a[3])}let[o,s]=SZr(n[1]||oB,n[2]);return Vte(t,s,o,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}};var zeh=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Qeh=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,uqo=(e,t)=>{let r=zeh.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){let s=Qeh.exec(r[3]);s&&(r[1]=r[1]||"eval",r[3]=s[1],r[4]=s[2],r[5]="")}let i=r[3],o=r[1]||oB;return[o,i]=SZr(o,i),Vte(t,i,o,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}};var Meh=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,_Zl=(e,t)=>{let r=Meh.exec(e);return r?Vte(t,r[2],r[1]||oB,+r[3],r[4]?+r[4]:void 0):void 0};var Leh=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,UZl=(e,t)=>{let r=Leh.exec(e);return r?Vte(t,r[2],r[3]||oB,+r[1]):void 0},_eh=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,VZl=(e,t)=>{let r=_eh.exec(e);return r?Vte(t,r[5],r[3]||r[4]||oB,+r[1],+r[2]):void 0};var Ueh=/^\s*[-]{4,}$/,Veh=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/,Geh=/^Promise\.(?:all|any)$/,qeh=/^index \d+$/,Weh="node:internal/promise",qZl=(e,t)=>{let r=e.match(Veh);if(r){let n,i,o,s,a;if(r[1]){o=r[1];let u=o.lastIndexOf(".");if(o[u-1]==="."&&u--,u>0){n=o.slice(0,u),i=o.slice(u+1);let p=n.indexOf(".Module");p>0&&(o=o.slice(p+1),n=n.slice(0,p))}s=void 0}i&&(s=n,a=i),i==="<anonymous>"&&(a=void 0,o=void 0),o===void 0&&(a=a||oB,o=s?`${s}.${a}`:a);let c=r[2]?.startsWith("file://")?r[2].slice(7):r[2],l=r[5]==="native";return c?.match(/\/[A-Z]:/)&&(c=c.slice(1)),!c&&r[5]&&!l&&(c=r[5]),Geh.test(o)&&qeh.test(c||"")&&(c=Weh),{filename:c?decodeURI(c):void 0,module:void 0,function:o,lineno:GZl(r[3]),colno:GZl(r[4]),in_app:Heh(c||"",l),platform:t}}if(e.match(Ueh))return{filename:e,platform:t}};function Heh(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 GZl(e){return parseInt(e||"",10)||void 0}var WZl=/\(error: (.*)\)/,HZl=50,Keh=10,Jeh=1e3;function pqo(e,t){return e.filename===t.filename&&e.function===t.function&&e.module===t.module&&e.lineno===t.lineno&&e.colno===t.colno}function Yeh(e){for(let t=1;t<=Keh;t++){let r=e.length-2*t;if(r<0)break;let n=!0;for(let i=0;i<t;i++){let o=e[r+i];if(!pqo(o,e[r+t+i])){n=!1;break}}if(n){for(let i=0;i<t;i++)e[r+i]=e[r+t+i];return e.length=r+t,{start:r,length:t}}}}function Xeh(e,t){let r=t.start+t.length,n=JZl(e,t);n&&e.splice(r+n===e.length?r:t.start,n)}function KZl(e,t){let r=t.start;for(;r>0&&pqo(e[r-1],e[r-1+t.length]);)r--;return t.start-r}function JZl(e,t){let r=t.start+t.length,n=r;for(;n<e.length&&pqo(e[n],e[n-t.length]);)n++;return n-r}function Zeh(e,t){let r=t[0],n=e.length-(r?KZl(e,r):0);for(let i of t)n-=JZl(e,i);return n}function $eh(e){let t=e.map(n=>`${n.function}|${n.filename}|${n.lineno}|${n.colno}|${n.module}`),r=0;for(let n=1;n<t.length;n++)eth(t,n,r)&&(r=n);e.push(...e.splice(0,r))}function eth(e,t,r){for(let n=0;n<e.length;n++){let i=e[(t+n)%e.length],o=e[(r+n)%e.length];if(i!==o)return i<o}return!1}function YZl(e){if(!e.length)return[];let t=Array.from(e);return t.reverse(),t.slice(0,HZl).map(r=>({...r,filename:r.filename||tth(t).filename,function:r.function||oB}))}function tth(e){return e[e.length-1]||{}}function fqo(){return XZl("web:javascript",lqo,uqo)}function XZl(e,...t){return(r,n=0)=>{let i=[],o=r.split(`
|
|
3472
3473
|
`),s=Math.min(o.length,n+Jeh),a=[];for(let u=n;u<s;u++){let p=o[u];if(p.length>1024)continue;let d=WZl.test(p)?p.replace(WZl,"$1"):p;if(!d.match(/\S*Error: /)){for(let f of t){let m=f(d,e);if(m){i.push(m);let g=Yeh(i);if(g){for(let A=a.length-1;A>=0;A--){let y=a[A];if(y.start+y.length<=g.start)break;a.pop()}a.push(g)}break}}if(Zeh(i,a)>=HZl)break}}let c=[...a].sort((u,p)=>p.start-u.start),l=c[c.length-1];if(l){let u=KZl(i,l);i.splice(l.start-u,u);for(let p of c)p.start-=u}for(let u of c)Xeh(i,u);return a.some(u=>u.start===0&&i.length===u.length)&&$eh(i),YZl(i)}}var dqo=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,r){let n=iR(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:n?t.stack:void 0,cause:t.cause?r.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){let r=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?`${r}: ${t.message}`:r}isDOMException(t){return Z_e(t,"DOMException")}isDOMError(t){return Z_e(t,"DOMError")}};var KGt=class{match(t){return bSe(t)}coerce(t,r){let n=this.getStack(t),i=n===void 0?r.syntheticException?.stack:void 0,o=!!i;return{type:this.getType(t),value:this.getMessage(t,r),stack:n??i,cause:t.cause?r.next(t.cause):void 0,synthetic:o}}getType(t){return t.name||t.constructor.name}getMessage(t,r){let n=t.message;return n.error&&typeof n.error.message=="string"?String(n.error.message):String(n)}getStack(t){try{let r=t.stacktrace;if(typeof r=="string"&&r.length>0)return r;let n=t.stack;return typeof n=="string"&&n.length>0?n:void 0}catch{return}}};var mqo=class{match(t){if(!dZl(t))return!1;let r=t;return r.error!=null||this._hasUsableMessage(r)}coerce(t,r){if(t.error!=null)return r.apply(t.error);let n=r.apply(t.message);return{...n,stack:this._buildLocationStack(t)??n.stack,synthetic:!0}}_hasUsableMessage(t){return iR(t.message)&&t.message.length>0}_buildLocationStack(t){let r=t,n=r.lineno??0,i=r.colno??0;if(!(!iR(r.filename)||r.filename.length===0)&&n!==0)return`Error
|
|
3473
|
-
at ${r.filename}:${n}:${i}`}};var rth=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,JGt=class{match(t){return typeof t=="string"}coerce(t,r){let[n,i]=this.getInfos(t);return{type:n??"Error",value:i??t,stack:r.syntheticException?.stack,synthetic:!0}}getInfos(t){let r="Error",n=t,i=t.match(rth);return i&&(r=i[1],n=i[2]),[r,n]}};var ZZl=["fatal","error","warning","log","info","debug"];function wZr(e,t=40){let r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(let n=r.length;n>0;n--){let i=r.slice(0,n).join(", ");if(!(i.length>t))return n===r.length||i.length<=t?i:`${i.slice(0,t)}...`}return""}var YGt=class{match(t){return typeof t=="object"&&t!==null}coerce(t,r){let n=this.getErrorPropertyFromObject(t);return n?r.apply(n):{type:this.getType(t),value:this.getValue(t),stack:this.getStack(t)??r.syntheticException?.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(Zct(t))return t.constructor.name;let r="name"in t?t.name:void 0;return iR(r)&&!X9o(r)?r:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){let i=`'${t.name}' captured as exception`;return"message"in t&&typeof t.message=="string"&&(i+=` with message: '${t.message}'`),i}if("message"in t&&typeof t.message=="string")return t.message;let r=this.getObjectClassName(t),n=wZr(t);return`${r&&r!=="Object"?`'${r}'`:"Object"} captured as exception with keys: ${n}`}isSeverityLevel(t){return iR(t)&&!X9o(t)&&ZZl.indexOf(t)>=0}getStack(t){try{return iR(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:iR(t.stack)&&t.stack.length>0?t.stack:void 0}catch{return}}getErrorPropertyFromObject(t){for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let n=t[r];if(bSe(n))return n}}getObjectClassName(t){try{let r=Object.getPrototypeOf(t);return r?r.constructor.name:void 0}catch{return}}};var hqo=class{match(t){return Zct(t)}coerce(t,r){let n=t.constructor.name;return{type:n,value:`${n} captured as exception with keys: ${wZr(t)}`,stack:r.syntheticException?.stack,synthetic:!0}}};var XGt=class{match(t){return pZr(t)}coerce(t,r){return{type:"Error",value:`Primitive value captured as exception: ${String(t)}`,stack:r.syntheticException?.stack,synthetic:!0}}};var gqo=class{match(t){return Z_e(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!Zct(t))return!1;try{let r=t.detail;return r!=null&&typeof r=="object"&&"reason"in r}catch{return!1}}coerce(t,r){let n=this.getUnhandledRejectionReason(t);return pZr(n)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(n)}`,stack:r.syntheticException?.stack,synthetic:!0}:r.apply(n)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&t.detail!=null&&typeof t.detail=="object"&&"reason"in t.detail)return t.detail.reason}catch{}return t}};var Aqo=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)}}};var ZGt={MESSAGE:"$message",TIMESTAMP:"$timestamp"},nth=new Set([ZGt.MESSAGE,ZGt.TIMESTAMP]),TZr={enabled:!0,max_bytes:32768};function yqo(e){return e?{enabled:e.enabled??TZr.enabled,max_bytes:oth(e.max_bytes,TZr.max_bytes)}:{...TZr}}function ith(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};let t=[];return{sanitizedProperties:Object.keys(e).reduce((n,i)=>nth.has(i)?(t.push(i),n):(n[i]=e[i],n),{}),droppedKeys:t}}var bqo=class{constructor(t){this._entries=[],this._totalBytes=0,this._config=yqo(t)}setConfig(t){this._config=yqo(t),this._trimToMaxBytes()}add(t){let r=sth(t);if(!r)return;let n=$Zl(r.json);n>this._config.max_bytes||(this._entries.push({step:r.step,bytes:n}),this._totalBytes+=n,this._trimToMaxBytes())}getAttachable(){return this._entries.map(t=>t.step)}clear(){this._entries=[],this._totalBytes=0}size(){return this._entries.length}_trimToMaxBytes(){for(;this._totalBytes>this._config.max_bytes&&this._entries.length>0;){let t=this._entries.shift();t&&(this._totalBytes-=t.bytes)}}};function oth(e,t){if(!Xct(e)||e===1/0||e===-1/0)return t;let r=Math.floor(e);return r<0?t:r}function sth(e){let t;try{t=ySe(e)}catch{return}try{let r=JSON.parse(t);if(!VGt(r))return;let n=r,i=n[ZGt.MESSAGE],o=n[ZGt.TIMESTAMP];return!iR(i)||i.trim().length===0||!iR(o)&&!Xct(o)?void 0:{step:n,json:t}}catch{return}}function $Zl(e){if("u">typeof TextEncoder)return new TextEncoder().encode(e).length;let t=encodeURIComponent(e),r=0;for(let n=0;n<t.length;n++)t[n]==="%"?(r+=1,n+=2):r+=1;return r}function ath(){let e=globalThis._posthogReleaseId;return typeof e=="string"&&e.length>0?e:void 0}var Eqo=e=>{if("flags"in e){let t=e$l(e.flags),r=t$l(e.flags);return{...e,featureFlags:t,featureFlagPayloads:r}}{let t=e.featureFlags??{},r=Object.fromEntries(Object.entries(e.featureFlagPayloads||{}).map(([i,o])=>[i,rlt(o)])),n=Object.fromEntries(Object.entries(t).map(([i,o])=>[i,cth(i,o,r[i])]));return{...e,featureFlags:t,featureFlagPayloads:r,flags:n}}};function cth(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 e$l=e=>Object.fromEntries(Object.entries(e??{}).map(([t,r])=>[t,$Gt(r)]).filter(([,t])=>t!==void 0)),t$l=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?rlt(n):void 0]}))},$Gt=e=>e===void 0?void 0:e.variant??e.enabled,rlt=e=>{if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}};var r$l=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","irclid","_kx"],lth=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain",...r$l,"$session_id","$window_id","$lib","$lib_version","$device_id","$is_server","$react_native_version"],e9t=(e,t=[])=>{let r={},n=i=>{e[i]!==void 0&&(r[i]=e[i])};return lth.forEach(n),t.forEach(n),r};var OZr=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)}};function Iqo(){return"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&typeof Response.prototype.blob=="function"}var pth="NativeGzipValidationError",fth=31,dth=139,mth=8,hth=e=>e.length>=2&&e[0]===fth&&e[1]===dth;var t9t,gth=()=>{if(t9t)return t9t;t9t=[];for(let e=0;e<256;e++){let t=e;for(let r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;t9t[e]=t>>>0}return t9t},Ath=e=>{let t=gth(),r=4294967295;for(let n=0;n<e.length;n++)r=t[(r^e[n])&255]^r>>>8;return(4294967295^r)>>>0},PZr=e=>{throw tlt(pth,`Native gzip produced invalid output: ${e}`)},yth=async(e,t)=>{e.size<18&&PZr("too-short");let r=new Uint8Array(await e.slice(0,10).arrayBuffer());(!hth(r)||r[2]!==mth)&&PZr("invalid-header");let n=new DataView(await e.slice(e.size-8).arrayBuffer());n.getUint32(0,!0)!==Ath(t)&&PZr("invalid-crc");let i=t.length>>>0;n.getUint32(4,!0)!==i&&PZr("invalid-size")};async function r9t(e,t=!0,r){try{let n=new TextEncoder().encode(e),i=new globalThis.CompressionStream("gzip"),o=i.writable.getWriter(),s=o.write(n).then(()=>o.close()).catch(async l=>{try{await o.abort(l)}catch{}throw l}),a=new Response(i.readable).blob(),[c]=await Promise.all([a,s]);return await yth(c,n),c}catch(n){if(r?.rethrow)throw n;return t&&console.error("Failed to gzip compress data",n),null}}var L5=class extends Error{constructor(t,r,n,i){super("HTTP error while fetching PostHog: status="+t.status+", reqByteLength="+r),this.response=t,this.reqByteLength=r,this.responseBodyDeadline=n,this.abortController=i,this.name="PostHogFetchHttpError",this._bodyReadTimedOut=!1}get status(){return this.response.status}get retryAfterMs(){try{return sqo(this.response.headers?.get("retry-after"))}catch{return}}get bodyReadTimedOut(){return this._bodyReadTimedOut}get text(){if(!this.responseBodyTextPromise)if(Date.now()>=this.responseBodyDeadline){this._bodyReadTimedOut=!0;let t=tlt("AbortError","Response body read timed out");this.cancelResponseBody(t),this.responseBodyTextPromise=Promise.reject(t)}else{let t=new Promise((n,i)=>{this.responseBodyTimer=T2(()=>{this._bodyReadTimedOut=!0;let o=tlt("AbortError","Response body read timed out");i(o),this.cancelResponseBody(o)},this.responseBodyDeadline-Date.now())}),r;try{r=Promise.resolve(this.response.text())}catch(n){r=Promise.reject(n)}this.responseBodyTextPromise=Promise.race([r,t]).finally(()=>clearTimeout(this.responseBodyTimer))}return this.responseBodyTextPromise}get json(){return this.text.then(t=>JSON.parse(t))}cancelResponseBody(t){clearTimeout(this.responseBodyTimer),this.abortController.signal.aborted||this.abortController.abort(t),(async()=>{try{await this.response.body?.cancel()}catch{}})()}},mme=class extends Error{constructor(t){super("Network error while fetching PostHog",t instanceof Error?{cause:t}:{}),this.error=t,this.name="PostHogFetchNetworkError"}};var a$l=(e,t)=>{for(let r of Object.keys(t))(r.startsWith("$feature/")||r==="$active_feature_flags")&&(e[r]=t[r])};async function n$l(e){if(e instanceof L5){let t="";try{t=await e.text}catch{e.bodyReadTimedOut&&(t="<response body read timed out>")}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 bth(e){return typeof e=="object"&&(e instanceof L5||c$l(e))}function c$l(e){return e instanceof mme}function Eth(e){if(e instanceof L5)return e.status===502||e.status===504;if(!(e instanceof mme))return!1;let t=e.error;return(t?.code??t?.cause?.code)!=="ECONNREFUSED"}var i$l=10485760;function o$l(e){try{return typeof e!="string"?e instanceof Uint8Array?e.byteLength:e.size:"u">typeof Buffer?Buffer.byteLength(e,NZl):new TextEncoder().encode(e).length}catch{return 0}}function nlt(e){return typeof e=="object"&&e instanceof L5&&e.status===413}function BZr(e){return e instanceof L5?e.status===408||e.status===429||e.status>=500:c$l(e)}function s$l(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var vqo="default",n9t=class{getErrorPropertiesBuilder(){return this._errorPropertiesBuilder||(this._errorPropertiesBuilder=this.createErrorPropertiesBuilder()),this._errorPropertiesBuilder}createErrorPropertiesBuilder(){return new HGt([new KGt,new YGt,new JGt,new XGt],fqo())}getEvaluationRuntime(){}constructor(t,r={}){this.flushPromise=null,this.pendingFlushPromise=null,this.flushPromises=new Set,this._dequeuedMessagesCount=0,this.shutdownPromise=null,this.promiseQueue=new gZr,this._events=new OZr,this._isInitialized=!1;let n=typeof t=="string"?t.trim():"",i=typeof r.host=="string"?r.host.trim():"",o=!n;this._logger=EZl("[PostHog]",this.logMsgIfDebug.bind(this)),o&&this._logger.error("You must pass your PostHog project's api key. The client will be disabled."),this.apiKey=n,this.host=jZl(i||"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.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:BZr},this.requestTimeout=r.requestTimeout??1e4,this.featureFlagsRequestTimeoutMs=r.featureFlagsRequestTimeoutMs??3e3,this.featureFlagsRequestMaxRetries=r.featureFlagsRequestMaxRetries??1,this.remoteConfigRequestTimeoutMs=r.remoteConfigRequestTimeoutMs??3e3,this.disableGeoip=r.disableGeoip??!0,this.disabled=(r.disabled??!1)||o,this.historicalMigration=r?.historicalMigration??!1,this._initPromise=Promise.resolve(),this._isInitialized=!0,this.evaluationContexts=r?.evaluationContexts??r?.evaluationEnvironments,r?.evaluationEnvironments&&!r?.evaluationContexts&&this._logger.warn("evaluationEnvironments is deprecated. Use evaluationContexts instead. This property will be removed in a future version."),this.disableCompression=!Iqo()||(r?.disableCompression??!1)}logMsgIfDebug(t){this.isDebug&&t()}wrap(t){if(this.disabled)return void this._logger.warn("The client is disabled");if(this._isInitialized)return t();this._initPromise.then(()=>t())}getCommonEventProperties(){return{$lib:this.getLibraryId(),$lib_version:this.getLibraryVersion()}}get optedOut(){return this.getPersistedProperty(vQ.OptedOut)??!this.defaultOptIn}async optIn(){this.wrap(()=>{this.setPersistedProperty(vQ.OptedOut,!1)})}async optOut(){this.wrap(()=>{this.setPersistedProperty(vQ.OptedOut,!0)})}on(t,r){return this._events.on(t,r)}debug(t=!0){if(this.removeDebugCallback?.(),t){let r=this.on("*",(n,i)=>this._logger.info(n,i));this.removeDebugCallback=()=>{r(),this.removeDebugCallback=void 0}}}get isDebug(){return!!this.removeDebugCallback}get isDisabled(){return this.disabled}buildPayload(t){let r=t.properties||{},n={...r,...this.getCommonEventProperties()};return a$l(n,r),t.event==="$feature_flag_called"&&n.$feature_flag_has_experiment===!1&&this.isMinimalFlagCalledEventsEnabled()&&(n=e9t(n)),{distinct_id:t.distinct_id,event:t.event,properties:n}}isMinimalFlagCalledEventsEnabled(){return!1}addPendingPromise(t){return this.promiseQueue.add(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 o=this.buildPayload({distinct_id:t,event:r,properties:n});this.enqueue("capture",o,i)})}async captureStatelessImmediate(t,r,n,i){let o=this.buildPayload({distinct_id:t,event:r,properties:n});await this.sendImmediate("capture",o,i)}aliasStateless(t,r,n,i){this.wrap(()=>{let o=this.buildPayload({event:"$create_alias",distinct_id:r,properties:{...n||{},distinct_id:r,alias:t}});this.enqueue("alias",o,i)})}async aliasStatelessImmediate(t,r,n,i){let o=this.buildPayload({event:"$create_alias",distinct_id:r,properties:{...n||{},distinct_id:r,alias:t}});await this.sendImmediate("alias",o,i)}groupIdentifyStateless(t,r,n,i,o,s){this.wrap(()=>{let a=this.buildPayload({distinct_id:o||`$${t}_${r}`,event:"$groupidentify",properties:{$group_type:t,$group_key:r,$group_set:n||{},...s||{}}});this.enqueue("capture",a,i)})}async groupIdentifyStatelessImmediate(t,r,n,i,o,s){let a=this.buildPayload({distinct_id:o||`$${t}_${r}`,event:"$groupidentify",properties:{$group_type:t,$group_key:r,$group_set:n||{},...s||{}}});await this.sendImmediate("capture",a,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,{type:"required",consume:i=>i.json()},{retryCount:0},this.remoteConfigRequestTimeoutMs).catch(i=>{this._logger.error("Remote config could not be loaded",i),this._events.emit("error",i)})}async getFlags(t,r={},n={},i={},o={},s=!1){await this._initPromise;let a=s?"&config=true":"",c=`${this.host}/flags/?v=2${a}`,l={token:this.apiKey,distinct_id:t,groups:r,person_properties:n,group_properties:i,...o};n.$device_id&&(l.$device_id=n.$device_id),this.evaluationContexts&&this.evaluationContexts.length>0&&(l.evaluation_contexts=this.evaluationContexts);let u=this.getEvaluationRuntime();u&&(l.evaluation_runtime=u);let p={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:JSON.stringify(l)};return this._logger.info("Flags URL",c),this.fetchWithRetry(c,p,{type:"required",consume:d=>d.json()},{retryCount:this.featureFlagsRequestMaxRetries,retryCheck:Eth},this.featureFlagsRequestTimeoutMs).then(d=>({success:!0,response:Eqo(d)})).catch(d=>(this._events.emit("error",d),{success:!1,error:this.categorizeRequestError(d)}))}categorizeRequestError(t){if(t instanceof L5)return{type:"api_error",statusCode:t.status};if(t instanceof mme){let r=t.error;return r instanceof Error&&(r.name==="AbortError"||r.name==="TimeoutError")?{type:"timeout"}:{type:"connection_error"}}return{type:"unknown_error"}}async getFeatureFlagStateless(t,r,n={},i={},o={},s){await this._initPromise;let a=await this.getFeatureFlagDetailStateless(t,r,n,i,o,s);if(a===void 0)return{response:void 0,requestId:void 0};let c=$Gt(a.response);return c===void 0&&(c=!1),{response:c,requestId:a.requestId}}async getFeatureFlagDetailStateless(t,r,n={},i={},o={},s){await this._initPromise;let a=await this.getFeatureFlagDetailsStateless(r,n,i,o,s,[t]);return a===void 0?void 0:{response:a.flags[t],requestId:a.requestId,evaluatedAt:a.evaluatedAt}}async getFeatureFlagPayloadStateless(t,r,n={},i={},o={},s){await this._initPromise;let a=await this.getFeatureFlagPayloadsStateless(r,n,i,o,s,[t]);if(!a)return;let c=a[t];return c===void 0?null:c}async getFeatureFlagPayloadsStateless(t,r={},n={},i={},o,s){return await this._initPromise,(await this.getFeatureFlagsAndPayloadsStateless(t,r,n,i,o,s)).payloads}async getFeatureFlagsStateless(t,r={},n={},i={},o,s){return await this._initPromise,await this.getFeatureFlagsAndPayloadsStateless(t,r,n,i,o,s)}async getFeatureFlagsAndPayloadsStateless(t,r={},n={},i={},o,s){await this._initPromise;let a=await this.getFeatureFlagDetailsStateless(t,r,n,i,o,s);return a?{flags:a.featureFlags,payloads:a.featureFlagPayloads,requestId:a.requestId}:{flags:void 0,payloads:void 0,requestId:void 0}}async getFeatureFlagDetailsStateless(t,r={},n={},i={},o,s){await this._initPromise;let a={geoip_disable:o??this.disableGeoip};s&&(a.flag_keys_to_evaluate=s);let c=await this.getFlags(t,r,n,i,a);if(!c.success)return;let l=c.response;return l.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"),l.quotaLimited?.includes("feature_flags")?(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:l?.requestId,quotaLimited:l.quotaLimited}):l}async getSurveysStateless(){if(await this._initPromise,this.disabled)return[];if(this.disableSurveys===!0)return this._logger.info("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,{type:"required",consume:o=>{if(o.status!==200||!o.json){let s=`Surveys API could not be loaded: ${o.status}`,a=new Error(s);return this._logger.error(a),this._events.emit("error",new Error(s)),Promise.resolve(void 0)}return o.json()}}).catch(o=>{this._logger.error("Surveys API could not be loaded",o),this._events.emit("error",o)}))?.surveys;return i&&this._logger.info("Surveys fetched from API: ",JSON.stringify(i)),i??[]}get props(){return this._props||(this._props=this.getPersistedProperty(vQ.Props)),this._props||{}}set props(t){this._props=t}async register(t){this.wrap(()=>{this.props={...this.props,...t},this.setPersistedProperty(vQ.Props,this.props)})}async unregister(t){this.wrap(()=>{delete this.props[t],this.setPersistedProperty(vQ.Props,this.props)})}processBeforeEnqueue(t){return t}async flushStorage(){}getQueueRouteKey(t){return vqo}persistedQueueKeyForRoute(t){return vQ.Queue}getActiveQueueRoutes(){return[vqo]}getRouteQueue(t){return this.getPersistedProperty(this.persistedQueueKeyForRoute(t))||[]}enqueue(t,r,n,i){this.wrap(()=>{if(this.optedOut)return void this._events.emit(t,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");let o=this.prepareMessage(r,n);if(o=this.processBeforeEnqueue(o),o===null)return;o=this.normalizeMessage(o);let s=this.persistedQueueKeyForRoute(i??this.getQueueRouteKey(o)),a=this.getPersistedProperty(s)||[];a.length>=this.maxQueueSize&&(a.shift(),this._logger.warn("Queue is full, the oldest event is dropped.")),a.push({message:o}),this.setPersistedProperty(s,a),this._events.emit(t,o),a.length>=this.flushAt&&this.flushBackground(),this.flushInterval&&!this._flushTimer&&(this._flushTimer=T2(()=>this.flushBackground(),this.flushInterval))})}async sendImmediate(t,r,n,i){if(this.disabled)return void this._logger.warn("The client is disabled");if(this._isInitialized||await this._initPromise,this.optedOut)return void this._events.emit(t,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");let o=this.prepareMessage(r,n);if(o=this.processBeforeEnqueue(o),o!==null){o=this.normalizeMessage(o);try{await this.sendBatch([o],void 0,i??this.getQueueRouteKey(o))}catch(s){this._events.emit("error",s)}}}normalizeMessage(t){let{type:r,library:n,library_version:i,...o}=t,s=s$l(o.properties)?o.properties:void 0;return n!==void 0&&s?.$lib===void 0&&(s={...s||{},$lib:n}),i!==void 0&&s?.$lib_version===void 0&&(s={...s||{},$lib_version:i}),s&&(o.properties=s),o.uuid=eUe(o.uuid,w2),o}normalizeTimestampForWire(t){let r=t instanceof Date?t:typeof t=="string"?new Date(t):null;if(!r||Number.isNaN(r.getTime()))return t;let n=r.toISOString(),i=typeof t=="string"?t.match(/\.(\d+)(?:Z|[+-]\d{2}:?\d{2})?$/i)?.[1]:void 0;return i&&i.length>3?n.replace(/\.\d{3}Z$/,`.${i}Z`):n}prepareMessage(t,r){let n={...t,timestamp:r?.timestamp?r?.timestamp:aqo(),uuid:eUe(r?.uuid,w2)};return(r?.disableGeoip??this.disableGeoip)&&(s$l(n.properties)||(n.properties={}),n.properties.$geoip_disable=!0),n.distinctId&&(n.distinct_id=n.distinctId,delete n.distinctId),n}clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}flushBackground(){this.pendingFlushPromise||this.flushAutomatic().catch(async t=>{await n$l(t)})}flushAutomatic(){return this.flush()}async waitForPendingPromises(t,r=[]){let n=r.filter(o=>!!o),i=0;for(;;){let o=this.promiseQueue.getPromises([...n,...this.flushPromises],t);if(o.length===0)return;i>0&&this._logger.debug(`flush() re-checking ${o.length} pending promise(s) before flushing`),await Promise.all(o.map(s=>s.catch(()=>{}))),i++}}flushWithPendingPromises(){return this.flushInternal(!0)}flush(){return this.flushInternal(!1)}flushInternal(t){if(this.disabled)return Promise.resolve();if(!t&&this.pendingFlushPromise)return this.pendingFlushPromise;let r=this.flushPromise,n=this.promiseQueue.maxId,i=Promise.resolve().then(()=>{if(t)return this.waitForPendingPromises(n,[r,i])}).then(()=>WGt([r])).then(()=>(this.pendingFlushPromise===i&&(this.pendingFlushPromise=null),this._flush()));return this.pendingFlushPromise=i,this.flushPromise=i,this.flushPromises.add(i),this.addPendingPromise(i),WGt([i]).then(()=>{this.flushPromises.delete(i),this.pendingFlushPromise===i&&(this.pendingFlushPromise=null),this.flushPromise===i&&(this.flushPromise=null)}),i}getCustomHeaders(){let t=this.getCustomUserAgent(),r={};return t&&t!==""&&(r["User-Agent"]=t),r}compressPayload(t){return r9t(t,this.isDebug)}getBatchEndpointPath(t){return"/batch/"}async sendBatch(t,r,n=vqo){let i={api_key:this.apiKey,batch:t.map(l=>{if(!l)return l;let u=this.normalizeTimestampForWire(l.timestamp);return u===l.timestamp?l:{...l,timestamp:u}}),sent_at:aqo()};this.historicalMigration&&(i.historical_migration=!0);let o=ySe(i),s=`${this.host}${this.getBatchEndpointPath(n)}`,a=this.disableCompression?null:await this.compressPayload(o),c={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",...a!==null&&{"Content-Encoding":"gzip"}},body:a||o};await this.fetchWithRetry(s,c,{type:"successful-write"},r)}async _flush(){this.clearFlushTimer(),await this._initPromise;let t=this.getActiveQueueRoutes();if(!t.some(i=>this.getRouteQueue(i).length>0))return;let r=[],n;for(let i of t)try{await this._flushRoute(i,r)}catch(o){n===void 0&&(n=o)}if(n!==void 0)throw n;this._events.emit("flush",r)}async _flushRoute(t,r){let n=this.persistedQueueKeyForRoute(t),i=this.getPersistedProperty(n)||[];if(!i.length)return;let o=i.length,s=0;for(;i.length>0&&s<o;){let a=i.slice(0,this.maxBatchSize),c=a.map(p=>p.message===void 0?p.message:this.normalizeMessage(p.message)),l=async()=>{let p=this.getPersistedProperty(n)||[],d=[...a],f=p.filter(m=>{let g=m.message?.uuid,A=d.findIndex(y=>y===m||typeof g=="string"&&g.length>0&&y.message?.uuid===g);return A===-1?!0:(d.splice(A,1),!1)});this.setPersistedProperty(n,f),i=f,this._dequeuedMessagesCount+=a.length,await this.flushStorage()},u={retryCheck:p=>nlt(p)?!1:BZr(p)};try{await this.sendBatch(c,u,t)}catch(p){if(nlt(p)&&c.length>1){this.maxBatchSize=Math.max(1,Math.floor(c.length/2)),this._logger.warn(`Received 413 when sending batch of size ${c.length}, reducing batch size to ${this.maxBatchSize}`);continue}throw p instanceof mme||await l(),this._events.emit("error",p),p}await l(),r.push(...c),s+=c.length}}async _sendOtlpBatch({path:t,auth:r,payload:n}){if(this.disabled)return{kind:"fatal",error:new Error("The client is disabled")};let i;try{i=JSON.stringify(n)}catch(u){return this.logMsgIfDebug(()=>console.warn(`[PostHog] Could not serialize a ${t} batch; reporting it as too large`,u)),{kind:"too-large",measuredLocally:!0}}let o=o$l(i);if(o>i$l)return this.logMsgIfDebug(()=>console.warn(`[PostHog] Not sending a ${t} batch of ${o} bytes: the endpoint accepts at most ${i$l}`)),{kind:"too-large",measuredLocally:!0};let s=r==="bearer"?`${this.host}/i/v1/${t}`:`${this.host}/i/v1/${t}?token=${encodeURIComponent(this.apiKey)}`,a=this.disableCompression?null:await this.compressPayload(i),c=a||i,l={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",...r==="bearer"&&{Authorization:`Bearer ${this.apiKey}`},...a!==null&&{"Content-Encoding":"gzip"}},body:c};try{return await this.fetchWithRetry(s,l,{type:"successful-write"},{retryCheck:u=>nlt(u)||u instanceof L5&&u.retryAfterMs!==void 0?!1:BZr(u)}),{kind:"ok"}}catch(u){if(nlt(u))return{kind:"too-large"};if(BZr(u)){let p=u instanceof L5?u.retryAfterMs:void 0;return{kind:"retry-later",error:u,...p!==void 0&&{retryAfterMs:p}}}return{kind:"fatal",error:u}}}async _sendLogsBatch(t){return this._sendOtlpBatch({path:"logs",auth:"query-token",payload:t})}async _sendMetricsBatch(t){return this._sendOtlpBatch({path:"metrics",auth:"query-token",payload:t})}async _sendTracesBatch(t){return this._sendOtlpBatch({path:"traces",auth:"bearer",payload:t})}async fetchWithRetry(t,r,n,i,o){let s=r.body?r.body:"",a=o$l(s),c={...this._retryOptions,...i},l=0;return await zZl(async()=>{l++;let u=new AbortController,p=o??this.requestTimeout,d=Date.now()+p,f,m=new Promise((C,x)=>{f=T2(()=>{let S=tlt("AbortError",`Request timed out after ${p}ms`);x(S),u.abort(S)},p)}),g,A=!1,y,I=()=>y??=(async()=>{try{await g?.body?.cancel()}catch{}})();try{let C;try{C=this.fetch(t,{signal:u.signal,...r})}catch(B){throw new mme(B)}C.then(B=>{u.signal.aborted&&!A&&Promise.resolve(B.body?.cancel()).catch(()=>{})}).catch(()=>{});try{g=await Promise.race([C,m]),A=!0}catch(B){throw new mme(B)}let x=r.mode==="no-cors",S=n.type==="successful-write"?300:400;if(!x&&(g.status<200||g.status>=S))throw new L5(g,a,d,u);if(n.type==="successful-write"){try{await Promise.race([I(),m])}catch{}return}try{return await Promise.race([n.consume(g),m])}catch(B){throw u.signal.aborted?new mme(B):B}}finally{clearTimeout(f),u.signal.aborted&&g&&I()}},{...c,retryCheck:u=>{let p=c.retryCheck(u);return p&&l<=c.retryCount&&u instanceof L5&&u.cancelResponseBody(),p}})}async _shutdown(t=3e4){await this._initPromise;let r=!1;return this.clearFlushTimer(),this.disabled?void 0:ESe((async()=>{try{for(await this.promiseQueue.join();this.getActiveQueueRoutes().some(s=>this.getRouteQueue(s).length>0);){let o=this._dequeuedMessagesCount;if(await this.flush(),r)break;if(this._dequeuedMessagesCount===o){this._logger.warn("Shutdown flush completed but did not send any queued events. Stopping drain to avoid a loop.");break}}}catch(i){if(!bth(i))throw i;await n$l(i)}})(),t,()=>{this._logger.critical("Timeout while shutting down PostHog. Some events may not have been sent.",{shutdownTimeoutMs:t}),r=!0})}async shutdown(t=3e4){return this.shutdownPromise?this._logger.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}};var Sth=/[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi;var DVv=new RegExp(Sth.source,"i"),l$l=/[a-z][a-z0-9+.-]{0,63}:\/\//i,RVv=new RegExp(`^${l$l.source}`,"i"),kVv=new RegExp(l$l.source,"gi");var wth=["is_not","is_set"],Tth=1152921504606847e3,Ml=class e extends Error{constructor(t){super(t),this.name=this.constructor.name,Object.setPrototypeOf(this,e.prototype)}};function Cqo(e){if(typeof e=="boolean")return!0;if(typeof e=="string"){let t=e.toLowerCase();return t==="true"||t==="false"}if(!Array.isArray(e))return!1;for(let t=0;t<e.length;t++)if(!Cqo(t in e?e[t]:null))return!1;return!0}function xqo(e){if(typeof e=="boolean")return e;if(typeof e=="string")return e.toLowerCase()==="true";if(!Array.isArray(e))return!1;for(let t=0;t<e.length;t++)if(!xqo(t in e?e[t]:null))return!1;return!0}function i9t(e){for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>=55296&&r<=56319){let n=e.charCodeAt(t+1);if(t+1>=e.length||n<56320||n>57343)throw new Ml("Cannot stringify an unpaired surrogate like the flags service");t++}else if(r>=56320&&r<=57343)throw new Ml("Cannot stringify an unpaired surrogate like the flags service")}}function RZr(e,t=new Set){if(!(e===null||typeof e=="boolean")){if(typeof e=="string")return void i9t(e);if(typeof e=="number"){if(!Number.isFinite(e))throw new Ml(`Cannot represent non-finite number ${e} like the flags service`);return}if(Array.isArray(e)){if(t.has(e))throw new Ml("Cannot represent a circular array during local evaluation");t.add(e);try{for(let r=0;r<e.length;r++)r in e&&RZr(e[r],t)}finally{t.delete(e)}return}if(typeof e=="object"){let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&r!==null)throw new Ml("Cannot represent a non-JSON object like the flags service");if(t.has(e))throw new Ml("Cannot represent a circular object during local evaluation");t.add(e);try{for(let n of Object.keys(e))i9t(n),RZr(e[n],t)}finally{t.delete(e)}return}throw new Ml(`Cannot represent ${typeof e} like the flags service`)}}function Oth(e,t){let r=0,n=0;for(;r<e.length&&n<t.length;){let i=e.charCodeAt(r),o=t.charCodeAt(n),s=i>=55296&&i<=56319,a=o>=55296&&o<=56319,c=s?e.charCodeAt(r+1):0,l=a?t.charCodeAt(n+1):0,u=s?(i-55296)*1024+c-56320+65536:i,p=a?(o-55296)*1024+l-56320+65536:o;if(u!==p)return u-p;r+=s?2:1,n+=a?2:1}return e.length-t.length}function Sqo(e,t=new Set){if(e===null)return"null";if(typeof e=="string")return i9t(e),JSON.stringify(e);if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number"){if(!Number.isFinite(e))throw new Ml(`Cannot stringify non-finite number ${e} like the flags service`);if(Number.isInteger(e))throw new Ml(`Cannot distinguish integer ${e} from an integral JSON float during local evaluation`);return String(e)}if(Array.isArray(e)){if(t.has(e))throw new Ml("Cannot stringify a circular array during local evaluation");t.add(e);try{let r=[];for(let n=0;n<e.length;n++)r.push(n in e?Sqo(e[n],t):"null");return`[${r.join(",")}]`}finally{t.delete(e)}}if(typeof e=="object"){let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&r!==null)throw new Ml("Cannot stringify a non-JSON object like the flags service");if(t.has(e))throw new Ml("Cannot stringify a circular object during local evaluation");t.add(e);try{let n=Object.keys(e);return n.forEach(i9t),`{${n.sort(Oth).map(i=>`${JSON.stringify(i)}:${Sqo(e[i],t)}`).join(",")}}`}finally{t.delete(e)}}throw new Ml(`Cannot stringify ${typeof e} like the flags service`)}function DZr(e){return typeof e=="string"?(i9t(e),e):Sqo(e)}function u$l(e){try{return new RegExp(e),!0}catch{return!1}}function _5(e){return String(e).replace(/[A-Z]/g,t=>t.toLowerCase())}function f$l(e,t,r){if(!/^\d+$/.test(e)||r==="strict"&&e.length>1&&e[0]==="0")throw new Ml(`Invalid semver: ${t}`);return parseInt(e,10)}function dw(e,t="strict"){let n=String(e).trim().replace(/^[vV]/,"").split("-")[0].split("+")[0];if(!n||n.startsWith("."))throw new Ml(`Invalid semver: ${e}`);let i=n.split("."),o=s=>s===void 0||s===""?0:f$l(s,e,t);return[o(i[0]),o(i[1]),o(i[2])]}function U5(e,t){for(let r=0;r<3;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return 0}function Pth(e,t){let r=dw(e,t);return{lower:[r[0],r[1],r[2]],upper:[r[0],r[1]+1,0]}}function Bth(e,t){let[r,n,i]=dw(e,t),o=[r,n,i],s;return s=r>0?[r+1,0,0]:n>0?[0,n+1,0]:[0,0,i+1],{lower:o,upper:s}}function Dth(e,t){let n=String(e).trim().replace(/^[vV]/,"").replace(/\.\*$/,"").replace(/\*$/,"");if(!n)throw new Ml(`Invalid wildcard semver: ${e}`);let i=n.split("."),o=c=>{if(t==="legacy-permissive"){let l=parseInt(c,10);if(!isNaN(l))return l}else try{return f$l(c,e,t)}catch{}throw new Ml(`Invalid wildcard semver: ${e}`)},s=o(i[0]);if(i.length===1)return{lower:[s,0,0],upper:[s+1,0,0]};let a=o(i[1]);return{lower:[s,a,0],upper:[s,a+1,0]}}function p$l(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 Ml(`${e} is in an invalid date format`)}throw new Ml(`The date provided ${e} must be a string, number, or date object`)}function wqo(e){let t=/^-?(?<number>[0-9]+)(?<interval>[a-z])$/,r=e.match(t),n=new Date(new Date().toISOString());if(!r||!r.groups)return null;let i=parseInt(r.groups.number);if(i>=1e4)return null;let o=r.groups.interval;if(o==="h")n.setUTCHours(n.getUTCHours()-i);else if(o==="d")n.setUTCDate(n.getUTCDate()-i);else if(o==="w")n.setUTCDate(n.getUTCDate()-7*i);else if(o==="m")n.setUTCMonth(n.getUTCMonth()-i);else{if(o!=="y")return null;n.setUTCFullYear(n.getUTCFullYear()-i)}return n}function Tqo(e,t,r={}){let n=e.key,i=e.value,o=e.operator||"exact",s=r.semverParsingPolicy??"strict";if(Object.prototype.hasOwnProperty.call(t,n)){if(o==="is_not_set")return!1;if(o==="is_set")return!0}else throw new Ml(`Property ${n} not found in propertyValues`);let c=t[n];if(c===void 0)return r.warnFunction?.(`Property ${n} cannot have a value of undefined with the ${o} operator`),o==="is_not";if(c===null&&!wth.includes(o)&&o!=="exact"&&o!=="is_not")return r.warnFunction?.(`Property ${n} cannot have a value of null with the ${o} operator`),!1;let l=(p,d)=>{if(r.propertyMatchingVersion!==2&&Cqo(p)||Array.isArray(p)&&p.length===0)return RZr(d),xqo(p)===xqo(d);if(r.propertyMatchingVersion===2&&typeof d=="number"&&Cqo(p))return RZr(d),!1;if(Array.isArray(p)){let f=DZr(d).toLowerCase();return p.some(m=>DZr(m).toLowerCase()===f)}return DZr(p).toLowerCase()===DZr(d).toLowerCase()},u=(p,d,f)=>{if(f==="gt")return p>d;if(f==="gte")return p>=d;if(f==="lt")return p<d;if(f==="lte")return p<=d;throw new Error(`Invalid operator: ${f}`)};switch(o){case"exact":return l(i,c);case"is_not":return!l(i,c);case"is_set":return!0;case"icontains":return _5(c).includes(_5(i));case"not_icontains":return!_5(c).includes(_5(i));case"starts_with":return _5(c).startsWith(_5(i));case"not_starts_with":return!_5(c).startsWith(_5(i));case"ends_with":return _5(c).endsWith(_5(i));case"not_ends_with":return!_5(c).endsWith(_5(i));case"regex":return u$l(String(i))&&String(c).match(String(i))!==null;case"not_regex":return u$l(String(i))&&String(c).match(String(i))===null;case"gt":case"gte":case"lt":case"lte":{let p=typeof i=="number"?i:parseFloat(String(i)),d=typeof c=="number"?c:c!=null?parseFloat(String(c)):NaN;return Number.isFinite(p)&&Number.isFinite(d)?u(d,p,o):u(String(c),String(i),o)}case"is_date_after":case"is_date_before":{if(typeof i=="boolean")throw new Ml("Date operations cannot be performed on boolean values");let p=wqo(String(i));p==null&&(p=p$l(i));let d=p$l(c);return o==="is_date_before"?d<p:d>p}case"semver_eq":return U5(dw(String(c),s),dw(String(i),s))===0;case"semver_neq":return U5(dw(String(c),s),dw(String(i),s))!==0;case"semver_gt":return U5(dw(String(c),s),dw(String(i),s))>0;case"semver_gte":return U5(dw(String(c),s),dw(String(i),s))>=0;case"semver_lt":return U5(dw(String(c),s),dw(String(i),s))<0;case"semver_lte":return U5(dw(String(c),s),dw(String(i),s))<=0;case"semver_tilde":{let p=dw(String(c),s),{lower:d,upper:f}=Pth(String(i),s);return U5(p,d)>=0&&U5(p,f)<0}case"semver_caret":{let p=dw(String(c),s),{lower:d,upper:f}=Bth(String(i),s);return U5(p,d)>=0&&U5(p,f)<0}case"semver_wildcard":{let p=dw(String(c),s),{lower:d,upper:f}=Dth(String(i),s);return U5(p,d)>=0&&U5(p,f)<0}default:throw new Ml(`Unknown operator: ${o}`)}}async function d$l(e){let t=globalThis.crypto?.subtle;if(!t)throw new Error("SubtleCrypto API not available");let r=await t.digest("SHA-1",new TextEncoder().encode(e));return Array.from(new Uint8Array(r)).map(n=>n.toString(16).padStart(2,"0")).join("")}async function o9t(e,t,r="",n="."){let i=await d$l(`${e}${n}${t}${r}`);return parseInt(i.slice(0,15),16)/Tth}async function Oqo(e,t){if(e==null||e.id==null||e.exclusion_percentage==null)return;let r=Number(e.exclusion_percentage);if(!Number.isFinite(r))return;let n=Math.min(Math.max(r,0),100);if(!(n!==100&&await o9t("holdout",t,"","-")>n/100))return`holdout-${e.id}`}function kZr(e){let t=[],r=0;for(let n of e){let i=r+n.rollout_percentage/100;t.push({valueMin:r,valueMax:i,key:n.key}),r=i}return t}async function Pqo(e,t,r){let n=await o9t(e,t,"variant");return kZr(r).find(i=>n>=i.valueMin&&n<i.valueMax)?.key}function Bqo(e,t){if(t===!1||t==null||!e)return null;let r=typeof t=="boolean"?t.toString():t,n=e[r]||null;return n==null?null:rlt(n)}var m$l=9223372036854776e3,Rth="9223372036854775808",kth=Object.prototype.propertyIsEnumerable;function Fth(){return{ancestors:new WeakSet,remainingNodes:1e4}}function Gte(e,t){try{return h$l(e,t,Fth(),0)}catch{return[]}}function Nth(e,t){let r=e.toString(),n=BigInt(Rth);return e>=n||e<-n?(t?.debug(`Attribute ${r} is outside the int64 range; encoding it as a string`),{stringValue:r}):{intValue:r}}function kqo(e,t,r,n){if(r.remainingNodes<=0)return{stringValue:vZr};if(r.remainingNodes--,fZl(e))return{boolValue:e};if(typeof e=="bigint")return Nth(e,t);if(typeof e=="number"){if(!Number.isFinite(e))return{stringValue:String(e)};if(Number.isInteger(e)){if(Number.isSafeInteger(e))return{intValue:String(e)};if("u"<typeof BigInt)return{stringValue:String(e)};let i=BigInt(e).toString();return e>=m$l||e<-m$l?(t?.debug(`Attribute ${i} is outside the int64 range; encoding it as a string`),{stringValue:i}):{intValue:i}}return{doubleValue:e}}if(typeof e=="string")return{stringValue:Ute(e)};if(typeof e=="function")return{stringValue:FZl};if(typeof e=="symbol")return{stringValue:String(e)};if(typeof e=="object"&&e!==null){if(r.ancestors.has(e))return{stringValue:IZr};if(n>=20)return{stringValue:vZr};if(e instanceof Date){let i=e.getTime(),o=Number.isFinite(i)?e.toISOString():String(e);return{stringValue:typeof o=="string"?Ute(o):String(o)}}r.ancestors.add(e);try{try{let i=e.toJSON;if(typeof i=="function")return kqo(i.call(e),t,r,n+1)}catch{}return j3(e)?{arrayValue:{values:jth(e,t,r,n+1)}}:{kvlistValue:{values:h$l(e,t,r,n+1)}}}finally{r.ancestors.delete(e)}}return{stringValue:Ute(String(e))}}function jth(e,t,r,n){let i=[],o=Math.min(e.length,1e3),s=0;for(;s<o&&r.remainingNodes>0;s++)try{let a=s in e?e[s]:void 0;if(TK(a))continue;i.push(kqo(a,t,r,n))}catch{i.push({stringValue:M5})}return e.length>s&&i.push({stringValue:vZr}),i}function h$l(e,t,r,n){let i=[];for(let o in e)if(kth.call(e,o)){if(!o){t?.debug("Dropping an attribute with an empty key");continue}if(i.length>=1e3||r.remainingNodes<=0){t?.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{let s=e[o];if(Z9o(s)||fme(s))continue;i.push({key:Ute(o),value:kqo(s,t,r,n)})}catch{i.push({key:Ute(o),value:{stringValue:M5}})}}return i}function a9t(e,t,r){return{...dme({},e.resourceAttributes),"service.name":e.serviceName||"unknown_service",...e.environment&&{"deployment.environment":e.environment},...e.serviceVersion&&{"service.version":e.serviceVersion},"telemetry.sdk.name":t,"telemetry.sdk.version":r}}var zth=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function c9t(e,t){let r=dme({},e),n={};for(let i of zth)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i],delete r[i]);return[...Gte(r,t),...Gte(n,t)]}var g$l={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","Mac OS X":"macOS"};function Qth(e){if(e)return Object.prototype.hasOwnProperty.call(g$l,e)?g$l[e]:e}function Fqo(e,t){let r=Qth(e);return{...r?{"os.name":r}:{},...t?{"os.version":t}:{}}}var Mth={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},JVv=Mth.info;var tUe=class{constructor(t){this._onFire=t,this._firesAt=0}get pending(){return!!this._timer}arm(t){this.clear(),this._firesAt=Date.now()+t,this._timer=T2(()=>{this._timer=void 0,this._onFire()},t)}armNoEarlierThan(t){this._timer&&Date.now()+t<=this._firesAt||this.arm(t)}clear(){this._timer&&(clearTimeout(this._timer),this._timer=void 0)}};function l9t(){return 1-.25+Math.random()*.25*2}var V5=1;function u9t(e,t,r,n){let i=Math.min(Math.max(0,t-1),6),o=e*2**i,s=n===void 0?o:Math.min(o,Math.max(n,e));return Math.round(s*r)}var p9t=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function Nqo(e){return String(e)+"000000"}function jqo(e,t,r,n){let i="";return n&&(i=Object.keys(n).sort().map(s=>`${JSON.stringify(s)}:${JSON.stringify(n[s])}`).join(",")),`${e}\0${t}\0${r??""}\0${i}`}function A$l(e,t){for(let r=0;r<t.length;r++)if(e<=t[r])return r;return t.length}function zqo(e,t,r){return a9t(e,t,r)}function Qqo(e,t,r,n){return{resourceMetrics:[{resource:{attributes:c9t(t)},scopeMetrics:[{scope:{name:r,version:n},metrics:e}]}]}}function NZr(e){let t=e?.resourceAttributes;return{serviceName:t?.["service.name"]??e?.serviceName,serviceVersion:t?.["service.version"]??e?.serviceVersion,environment:t?.["deployment.environment"]??e?.environment,resourceAttributes:t,beforeSend:e?.beforeSend,flushIntervalMs:e?.flushIntervalMs??1e4,maxSeriesPerFlush:e?.maxSeriesPerFlush??1e3}}var y$l=1,f9t=class{constructor(t,r,n){this._instance=t,this._config=r,this._logger=n,this._series=new Map,this._flushTimer=new tUe(()=>this.flush().catch(i=>{this._logger.error("Metrics flush failed:",i)})),this._flushPromise=null,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,this._retryAfter=new $_e,this._consecutiveFlushFailures=0,this._flushJitter=V5,this._generation=0}count(t,r=1,n){this._capture({name:t,type:"count",value:r,unit:n?.unit,attributes:n?.attributes})}gauge(t,r,n){this._capture({name:t,type:"gauge",value:r,unit:n?.unit,attributes:n?.attributes})}histogram(t,r,n){this._capture({name:t,type:"histogram",value:r,unit:n?.unit,attributes:n?.attributes})}flush(){let t=this._flushPromise,n=(async()=>{t&&await t.catch(()=>{}),await this._doFlush()})().finally(()=>{this._flushPromise===n&&(this._flushPromise=null)});return this._flushPromise=n,n}drainWindow(){if(this._series.size===0)return null;let t=this._series;return this._series=new Map,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,this._buildPayload(t)}reset(){this._generation++,this._retryAfter.reset(),this._consecutiveFlushFailures=0,this._flushJitter=V5,this._flushTimer.clear(),this._series=new Map,this._flushPromise=null,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set}_capture(t){if(this._instance.isDisabled||this._instance.optedOut)return;let r=this._runBeforeSend(t);if(r===null)return;if(!r.name||typeof r.name!="string")return void this._logger.warn("Dropping metric with empty name");if(typeof r.value!="number"||!Number.isFinite(r.value))return void this._logger.warn(`Dropping metric '${r.name}': value must be a finite number`);if(r.type==="count"&&r.value<0)return void this._logger.warn(`Dropping count '${r.name}': counters are monotonic, value must be >= 0`);let n,i;try{n=r.attributes?{...r.attributes}:void 0,i=jqo(r.type,r.name,r.unit,n)}catch(a){this._logger.warn(`Dropping metric '${r.name}': attributes could not be serialized`,a);return}let o=this._series.get(i);if(!o){if(!this._admitNewSeries())return;o={name:r.name,type:r.type,unit:r.unit,attributes:n,windowStartMs:Date.now()},this._series.set(i,o)}let s=this._typeByName.get(r.name);s===void 0?this._typeByName.set(r.name,r.type):s!==r.type&&!this._typeCollisionWarned.has(r.name)&&(this._typeCollisionWarned.add(r.name),this._logger.warn(`Metric name '${r.name}' is already used as a ${s}; recording it as a ${r.type} too will blend both series in charts. Use a distinct name.`)),this._fold(o,r.value),this._armFlushTimer()}_admitNewSeries(){return this._series.size<this._config.maxSeriesPerFlush?!0:(this._seriesCapWarned||(this._seriesCapWarned=!0,this._logger.warn(`Metric series cap reached (${this._config.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}_fold(t,r){switch(t.type){case"count":t.total=(t.total??0)+r;break;case"gauge":t.last=r;break;case"histogram":{t.hist||(t.hist={count:0,sum:0,min:r,max:r,bucketCounts:new Array(p9t.length+1).fill(0)});let n=t.hist;n.count+=1,n.sum+=r,n.min=Math.min(n.min,r),n.max=Math.max(n.max,r),n.bucketCounts[A$l(r,p9t)]+=1;break}}}_runBeforeSend(t){let r=this._config.beforeSend;if(!r)return t;let n=j3(r)?r:[r],i=t;for(let o of n)try{let s=o(i);if(!s)return this._logger.info("Metric was rejected in beforeSend function"),null;i=s}catch(s){return this._logger.error("Error in beforeSend function for metric:",s),null}return i}_armFlushTimer(){this._flushTimer.pending||this._flushTimer.arm(this._nextFlushDelay())}_nextFlushDelay(){return Math.max(u9t(this._config.flushIntervalMs,this._consecutiveFlushFailures,this._flushJitter,3e4),this._retryAfter.remainingMs())}async _doFlush(){if(this._flushTimer.clear(),this._series.size===0)return;let t=this._series;this._series=new Map,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set;let r=this._generation,n=await this._instance._sendMetricsBatch(this._buildPayload(t));if(r===this._generation)switch(this._retryAfter.record(n),n.kind==="retry-later"?(this._consecutiveFlushFailures++,this._flushJitter=l9t()):(this._consecutiveFlushFailures=0,this._flushJitter=V5),this._flushTimer.pending&&this._flushTimer.arm(this._nextFlushDelay()),n.kind){case"ok":return;case"retry-later":this._mergeWindowBack(t),this._flushTimer.armNoEarlierThan(this._nextFlushDelay());return;case"too-large":this._logger.warn("Metrics batch exceeded the server size limit and was dropped");return;case"fatal":this._logger.error("Failed to send metrics batch:",n.error);return}}_buildPayload(t){return Qqo(this._buildMetrics(t),zqo(this._config,this._instance.getLibraryId(),this._instance.getLibraryVersion()),this._instance.getLibraryId(),this._instance.getLibraryVersion())}_buildMetrics(t){let r=Nqo(Date.now()),n=new Map;for(let i of t.values()){let o=jqo(i.type,i.name,i.unit,void 0),s=n.get(o);s||(s={name:i.name,...i.unit&&{unit:i.unit}},i.type==="count"?s.sum={aggregationTemporality:y$l,isMonotonic:!0,dataPoints:[]}:i.type==="gauge"?s.gauge={dataPoints:[]}:s.histogram={aggregationTemporality:y$l,dataPoints:[]},n.set(o,s));let a=Gte(i.attributes??{},this._logger),c=Nqo(i.windowStartMs);if(i.type==="count"){let l={attributes:a,startTimeUnixNano:c,timeUnixNano:r,asDouble:i.total??0};s.sum.dataPoints.push(l)}else if(i.type==="gauge"){let l={attributes:a,timeUnixNano:r,asDouble:i.last??0};s.gauge.dataPoints.push(l)}else if(i.hist){let l={attributes:a,startTimeUnixNano:c,timeUnixNano:r,count:i.hist.count,sum:i.hist.sum,min:i.hist.min,max:i.hist.max,bucketCounts:i.hist.bucketCounts,explicitBounds:p9t};s.histogram.dataPoints.push(l)}}return Array.from(n.values())}_mergeWindowBack(t){for(let[r,n]of t){let i=this._series.get(r);if(!i){this._admitNewSeries()&&this._series.set(r,n);continue}switch(i.windowStartMs=Math.min(i.windowStartMs,n.windowStartMs),i.type){case"count":i.total=(i.total??0)+(n.total??0);break;case"gauge":break;case"histogram":if(n.hist)if(i.hist){i.hist.count+=n.hist.count,i.hist.sum+=n.hist.sum,i.hist.min=Math.min(i.hist.min,n.hist.min),i.hist.max=Math.max(i.hist.max,n.hist.max);for(let o=0;o<i.hist.bucketCounts.length;o++)i.hist.bucketCounts[o]+=n.hist.bucketCounts[o]}else i.hist=n.hist;break}}}};var Vth="0".repeat(32),Gth="0".repeat(16),qth=/^[0-9a-f]+$/;function Wth(e){let t=new Uint8Array(e),r=globalThis.crypto;if(r&&typeof r.getRandomValues=="function")try{return r.getRandomValues(t),t}catch{}for(let n=0;n<e;n++)t[n]=Math.floor(256*Math.random());return t}function Hth(e){let t="";for(let r=0;r<e.length;r++)t+=e[r].toString(16).padStart(2,"0");return t}function b$l(e){let t=Hth(Wth(e));return/[^0]/.test(t)?t:t.slice(0,-1)+"1"}function E$l(){return b$l(16)}function I$l(){return b$l(8)}function v$l(e,t,r){return typeof e=="string"&&e.length===t&&e!==r&&qth.test(e)}function C$l(e){return v$l(e,32,Vth)}function x$l(e){return v$l(e,16,Gth)}var Kth=/^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})(-.*)?$/;function S$l(e){let t=w$l(e);return t&&{traceId:t.traceId,spanId:t.spanId,flags:Jth(t.flags)}}function Jth(e){return 1&parseInt(e,16)?zZr:Yth}function w$l(e){if(typeof e!="string")return;let t=Kth.exec(e.trim());if(!t)return;let[,r,n,i,o,s]=t;if(r!=="ff"&&!(r==="00"&&s)&&!(!C$l(n)||!x$l(i)))return{version:r,traceId:n,spanId:i,flags:o}}function T$l(e){return w$l(e)&&e.trim()}function jZr(e){return Array.isArray(e)&&e.length===1?e[0]:e}var zZr="01",Yth="00";function O$l(e,t,r=zZr){return`00-${e}-${t}-${r}`}var Xth=32,Mqo=512;function QZr(e){if(typeof e!="string")return;let t=e.trim();if(!t||/[^\x20-\x7e\t]/.test(t))return;let r=t.split(",");if(!(r.length>Xth)){for(let n of r)if(n.trim()&&!n.includes("="))return;return t.length<=Mqo?t:$th(r)}}var Zth=128;function $th(e){let t=[...e],r=()=>t.reduce((n,i)=>n+i.length,0)+t.length-1;for(let n=t.length-1;n>=0&&r()>Mqo;n--)t[n].length>Zth&&t.splice(n,1);for(;t.length&&r()>Mqo;)t.pop();return t.length?t.join(","):void 0}var P$l="unknown";function rUe(e,t,r,n){return typeof e=="string"&&e.trim()?e.length>r?e.slice(0,r):e:(n?.debug(`${t} must be a non-empty string; using "${P$l}"`),P$l)}function ilt(e){if(e==null)return;let t=e;if(e instanceof Date)try{t=e.getTime()}catch{return}if(!(typeof t!="number"||!Number.isFinite(t))&&!(t<0||t>9223372036854))return t}function B$l(e,t,r){let n=ilt(e);return n===void 0?(e!==void 0&&r?.debug("Span startTime is out of range or not a valid time; using the current time"),t):(t-n>864e5?r?.debug("Span startTime is more than 24 hours in the past; the server will clamp it to receive time and keep the original in $originalTimestamp"):n>t&&r?.debug("Span startTime is in the future; the span may export with a zero duration"),n)}function MZr(e,t){return e<t?t:e}function d9t(e,t,r,n){let i=ilt(e);return i===void 0?(e!==void 0&&n?.debug(`Span ${r} is out of range or not a valid time; using the derived time`),t):i}function _Zr(){let e=globalThis.performance;return typeof e?.now=="function"?e.now():void 0}var olt=class{constructor(t,r,n){this._onEnd=r,this._logger=n,this._events=[],this._ended=!1,this._userAttributeCount=0,this._userEventCount=0,this._droppedAttributes=0,this._droppedEvents=0,this._traceId=t.traceId,this._spanId=t.spanId,this._parentSpanId=t.parentSpanId,this._traceState=t.traceState,this._traceFlags=t.traceFlags??zZr,this._parentIsRemote=t.parentIsRemote??!1,this._name=t.name,this._kind=t.kind,this._autoKeys=new Set(t.autoAttributeKeys),this._maxAttributes=t.maxAttributes,this._maxEvents=t.maxEvents,this._maxAttributesPerEvent=t.maxAttributesPerEvent,this._maxAttributeValueLength=t.maxAttributeValueLength,this._attributes=Object.create(null);for(let i of Object.keys(t.attributes))this._writeAttribute(i,t.attributes[i]);this._startMono=t.backdated?void 0:_Zr(),this._startTime=t.clockAnchor&&this._startMono!==void 0?t.clockAnchor.wall+(this._startMono-t.clockAnchor.mono):t.startTime,this._startMono!==void 0&&(this._clockAnchor=t.clockAnchor??{wall:this._startTime,mono:this._startMono})}_now(){if(this._startMono!==void 0){let t=_Zr();if(t!==void 0)return this._startTime+Math.max(0,t-this._startMono)}return Date.now()}_mutable(t){return this._ended?(this._logger?.debug(`Ignoring ${t} on a span that has already ended`),!1):!0}_writeAttribute(t,r){if(TK(r)){t in this._attributes&&!this._autoKeys.has(t)&&this._userAttributeCount--,delete this._attributes[t];return}if(!this._autoKeys.has(t)&&!(t in this._attributes)){if(this._userAttributeCount>=this._maxAttributes)return void this._droppedAttributes++;this._userAttributeCount++}this._attributes[t]=VZr(r,this._maxAttributeValueLength)}setAttribute(t,r){return this._mutable("setAttribute")&&this._writeAttribute(t,r),this}setAttributes(t){if(this._mutable("setAttributes")){let r=dme({},t);for(let n of Object.keys(r))this._writeAttribute(n,r[n])}return this}addEvent(t,r,n){if(this._mutable("addEvent")){if(this._userEventCount>=this._maxEvents)return this._droppedEvents++,this;this._userEventCount++;let i=r&&F$l(r,this._maxAttributesPerEvent,this._maxAttributeValueLength);this._events.push({name:rUe(t,"Span event name",this._maxAttributeValueLength,this._logger),timestamp:d9t(n,this._now(),"event timestamp",this._logger),...i&&{attributes:i.attributes,...i.dropped&&{droppedAttributesCount:i.dropped}}})}return this}setStatus(t,r){if(this._mutable("setStatus")){if(t!=="ok"&&t!=="error")return this._logger?.debug(`Ignoring unknown span status "${String(t)}"; expected "ok" or "error"`),this;this._status={code:t,...r&&{message:Lqo(r,this._maxAttributeValueLength)}}}return this}get statusIsExplicitlyOk(){return this._status?.code==="ok"}recordException(t){if(!this._mutable("recordException"))return this;let{type:r,message:n,stack:i}=_qo(t);return this.addEvent(erh,{"exception.type":r,"exception.message":n,...i&&{"exception.stacktrace":i}}),this.setStatus("error",n)}updateName(t){return this._mutable("updateName")&&(this._name=rUe(t,"Span name",this._maxAttributeValueLength,this._logger)),this}traceparent(){return O$l(this._traceId,this._spanId,this._traceFlags)}tracestate(){return this._traceState??null}childContext(){return{traceId:this._traceId,parentSpanId:this._spanId,traceState:this._traceState,traceFlags:this._traceFlags,clockAnchor:this._clockAnchor}}end(t){if(this._ended)return void this._logger?.debug("Ignoring end() on a span that has already ended");this._ended=!0;let r=this._now(),n=d9t(t,r,"end time",this._logger);this._onEnd({traceId:this._traceId,spanId:this._spanId,...this._parentSpanId&&{parentSpanId:this._parentSpanId},...this._traceState&&{traceState:this._traceState},traceFlags:this._traceFlags,parentIsRemote:this._parentIsRemote,name:this._name,kind:this._kind,...this._status&&{status:this._status},attributes:{...this._attributes},events:this._events,startTime:this._startTime,endTime:MZr(n,this._startTime),...this._droppedAttributes&&{droppedAttributesCount:this._droppedAttributes},...this._droppedEvents&&{droppedEventsCount:this._droppedEvents}},this._autoKeys)}},erh="exception",trh=4294967295;function rrh(e){try{return typeof e=="string"?e:String(e)}catch{return M5}}function nUe(e){return typeof e!="number"||!Number.isFinite(e)||e<=0?0:Math.min(Math.floor(e),trh)}function nrh(e,t){if(!t.length)return Object.keys(e);let r=t.filter(i=>Object.prototype.propertyIsEnumerable.call(e,i)),n=new Set(r);return[...r,...Object.keys(e).filter(i=>!n.has(i))]}function R$l(e,t,r,n,i,o,s=[]){let a=0,c=0,l={};for(let f of nrh(e.attributes,s)){let m=e.attributes[f];if(!TK(m)){if(!t.has(f)){if(a>=r){c++;continue}a++}Object.defineProperty(l,f,{value:VZr(m,o),enumerable:!0,writable:!0,configurable:!0})}}e.attributes=l,c&&(e.droppedAttributesCount=nUe(e.droppedAttributesCount)+c);let u=0,p=0,d=[];for(let f of e.events){if(u>=n){p++;continue}if(u++,f.attributes){let m=F$l(f.attributes,i,o);f.attributes=m.attributes,m.dropped&&(f.droppedAttributesCount=nUe(f.droppedAttributesCount)+m.dropped)}d.push(f)}e.events=d,p&&(e.droppedEventsCount=nUe(e.droppedEventsCount)+p),e.status?.message&&(e.status={...e.status,message:Lqo(rrh(e.status.message),o)})}var UZr=class{setAttribute(){return this}setAttributes(){return this}addEvent(){return this}setStatus(){return this}recordException(){return this}updateName(){return this}traceparent(){return null}tracestate(){return null}end(){}},k$l=new UZr,m9t=class extends UZr{constructor(t,r){super(),this._traceparent=t,this._tracestate=r}traceparent(){return this._traceparent}tracestate(){return this._tracestate??null}};function irh(e){try{let t=e.stack;return typeof t=="string"&&t?{stack:t}:{}}catch{return{}}}function ISe(e,t){let r=jZr(e?.parent)??t,n=typeof r=="string"||r==null?r:D$l(r,"traceparent"),i=T$l(n);if(!i)return k$l;let o=typeof r=="string"||r==null?e?.tracestate:D$l(r,"tracestate");return new m9t(i,QZr(o))}function D$l(e,t){try{let r=e[t];return typeof r=="function"?r.call(e):void 0}catch{return}}function Lqo(e,t){return e.length>t?e.slice(0,t):e}function VZr(e,t){return LZr(e,t,{ancestors:new WeakSet,remainingNodes:1e4},0)}function LZr(e,t,r,n){if(e===null||typeof e!="object")return TK(e)||r.remainingNodes<=0?e:(r.remainingNodes--,typeof e=="string"?Lqo(e,t):e);if(r.ancestors.has(e))return IZr;if(r.remainingNodes<=0||n>=20)return e;r.remainingNodes--,r.ancestors.add(e);try{if(e instanceof Date)return e;let i=orh(e);if(i.selfDescribed)return TK(i.value)?String(i.value):LZr(i.value,t,r,n+1);if(j3(e)){let a=Math.min(e.length,1e3),c=[];for(let l=0;l<a;l++)try{c.push(LZr(e[l],t,r,n+1))}catch{c.push(M5)}return e.length>a&&(c.length=e.length),c}let o={},s=0;for(let a of Object.keys(e)){if(s>=1e3)break;let c;try{c=LZr(e[a],t,r,n+1)}catch{c=M5}a&&!TK(c)&&s++,Object.defineProperty(o,a,{value:c,enumerable:!0,writable:!0,configurable:!0})}return o}catch{return e}finally{r.ancestors.delete(e)}}function orh(e){try{let t=e.toJSON;if(typeof t=="function")return{selfDescribed:!0,value:t.call(e)}}catch{}return{selfDescribed:!1}}function F$l(e,t,r){let n;try{n=Object.keys(e)}catch{return{attributes:{},dropped:0}}let i={},o=0,s=0;for(let a of n){if(o>=t){s++;continue}let c;try{c=VZr(e[a],r)}catch{c=M5}TK(c)||(o++,Object.defineProperty(i,a,{value:c,enumerable:!0,writable:!0,configurable:!0}))}return{attributes:i,dropped:s}}function N$l(e,t){for(let r of Object.keys(e))e[r]=VZr(e[r],t);return e}function h9t(e,t,r){return t===k$l?r(t):e.with(t,()=>r(t))}function _qo(e){try{let t=irh(e);if(bSe(e))return{type:e.name||"Error",message:e.message||"",...t};if(typeof e=="string")return{type:"string",message:e};if(e&&typeof e=="object"){let r=e;if(typeof r.message=="string")return{type:typeof r.name=="string"?r.name:"Object",message:r.message,...t}}return{type:typeof e,message:String(e)}}catch{return{type:typeof e,message:""}}}var Uqo={internal:1,server:2,client:3,producer:4,consumer:5},srh={ok:1,error:2},arh=1,crh=256,lrh=512;function urh(e){let t=parseInt(e.traceFlags,16);return(Number.isFinite(t)?255&t:arh)|crh|(e.parentIsRemote?lrh:0)}function GZr(e){if(typeof e=="string")return Ute(e);try{return Ute(String(e))}catch{return M5}}function prh(e){return e&&Object.prototype.hasOwnProperty.call(Uqo,e)?Uqo[e]:Uqo.internal}function Vqo(e){let t=Math.floor(e),r=Math.round((e-t)*1e6);return r>=1e6&&(t+=1,r=0),String(t)+String(r).padStart(6,"0")}function frh(e,t){let r={name:GZr(e.name),timeUnixNano:Vqo(e.timestamp)};if(e.attributes){let i=Gte(e.attributes,t);i.length&&(r.attributes=i)}let n=nUe(e.droppedAttributesCount);return n&&(r.droppedAttributesCount=n),r}function j$l(e,t){let r={traceId:e.traceId,spanId:e.spanId,name:GZr(e.name),kind:prh(e.kind),startTimeUnixNano:Vqo(e.startTime),endTimeUnixNano:Vqo(e.endTime),flags:urh(e)};e.parentSpanId&&(r.parentSpanId=e.parentSpanId),e.traceState&&(r.traceState=GZr(e.traceState));let n=Gte(e.attributes,t);n.length&&(r.attributes=n),e.events.length&&(r.events=e.events.map(s=>frh(s,t)));let i=nUe(e.droppedAttributesCount);i&&(r.droppedAttributesCount=i);let o=nUe(e.droppedEventsCount);return o&&(r.droppedEventsCount=o),e.status&&(r.status={code:srh[e.status.code],...e.status.message&&{message:GZr(e.status.message)}}),r}function z$l(e,t,r){return a9t(e,t,r)}function Q$l(e,t,r,n,i){return{resourceSpans:[{resource:{attributes:c9t(t,i)},scopeSpans:[{scope:{name:r,version:n},spans:e}]}]}}var M$l=8;function qZr(){return _Zr()??Date.now()}function Gqo(e){try{return e instanceof olt}catch{return!1}}function L$l(e,t){let r=S$l(e);if(r)return{traceId:r.traceId,parentSpanId:r.spanId,traceState:QZr(t),traceFlags:r.flags,isRemote:!0}}function drh(e){try{return typeof e.traceparent=="function"}catch{return!1}}function mrh(e){return!!e.attributes&&typeof e.attributes=="object"&&!Array.isArray(e.attributes)&&Array.isArray(e.events)&&e.name!==void 0&&e.kind!==void 0&&e.startTime!==void 0&&e.endTime!==void 0}function WZr(e,t,r){e[t]!==r&&(e[t]=r)}function hrh(e,t){try{let r=Object.getOwnPropertyDescriptors(e);for(let n of["traceId","spanId","parentSpanId","traceState"])r[n]={value:t[n],enumerable:!0,writable:!0,configurable:!0};return Object.create(Object.getPrototypeOf(e),r)}catch{return e}}var g9t=class{constructor(t,r,n,i,o,s){this._instance=t,this._config=r,this._logger=n,this._getContext=i,this._contextManager=o,this._onSpanQueued=s,this._queue=[],this._flushTimer=new tUe(()=>this._flushInBackground()),this._flushPromise=null,this._droppedSinceWarning=0,this._lastDropWarningAt=0,this._dropReasons=new Set,this._consecutiveFlushFailures=0,this._flushJitter=V5,this._retryAfter=new $_e,this._headBatchFailures=0,this._headBatchSize=0,this._headBatchChargeableAt=0,this._generation=0,this._liveSpans=new Map,this._maxExportBatchSize=r.maxExportBatchSize}startSpan(t,r){if(this._instance.isDisabled||this._instance.optedOut)return ISe(r,this._contextManager.active());let n=jZr(r?.parent);if(n&&typeof n!="string"&&!Gqo(n)){if(drh(n))return this._logger.debug("Span parent is not a span from this SDK; returning an inert span"),ISe(r,this._contextManager.active());this._logger.debug("Ignoring an unusable span parent")}let i=this._resolveParent(n,r);if(this._liveSpans.size>=this._config.maxLiveSpans&&this._evictAgedSpans(),this._liveSpans.size>=this._config.maxLiveSpans)return this._recordDrop(1,`the live-span limit (${this._config.maxLiveSpans}) was reached \u2014 spans are being started and never ended`),ISe(r,this._contextManager.active());let o=Date.now(),s=B$l(r?.startTime,o,this._logger),a=I$l();this._liveSpans.set(a,qZr());let c=this._autoContextAttributes();return new olt({traceId:i?.traceId??E$l(),spanId:a,parentSpanId:i?.parentSpanId,traceState:i?.traceState,traceFlags:i?.traceFlags,parentIsRemote:i?.isRemote,name:rUe(t,"Span name",this._config.maxAttributeValueLength,this._logger),kind:r?.kind??"internal",attributes:dme({...c},r?.attributes),autoAttributeKeys:Object.keys(c),maxAttributes:this._config.maxAttributesPerSpan,maxEvents:this._config.maxEventsPerSpan,maxAttributesPerEvent:this._config.maxAttributesPerEvent,maxAttributeValueLength:this._config.maxAttributeValueLength,startTime:s,backdated:s!==o,clockAnchor:ilt(r?.startTime)===void 0?i?.clockAnchor:void 0},(l,u)=>this._onSpanEnd(l,u),this._logger)}withSpan(t,r,n){let i=typeof r=="function"?void 0:r,o=typeof r=="function"?r:n,s=this.startSpan(t,i);try{let a=h9t(this._contextManager,s,o);return QZl(a)?a.then(c=>(s.end(),c),c=>{throw this._recordCallbackError(s,c),s.end(),c}):(s.end(),a)}catch(a){throw this._recordCallbackError(s,a),s.end(),a}}getActiveSpan(){return this._contextManager.active()??null}get throttled(){return this._retryAfter.isOpen()}async flush(){for(;;)if(!this._queue.length||!await(this._flushPromise??this._startFlush()))return}_startFlush(){this._flushTimer.clear();let t=this._generation,r=Promise.resolve().then(()=>t===this._generation?this._flushInner():0).finally(()=>{this._flushPromise===r&&(this._flushPromise=null),this._armFlushTimerIfQueuedNoEarlierThan()});return this._flushPromise=r,r}reset(){this._flushTimer.clear(),this._queue.length&&this._logger.critical(`Discarding ${this._queue.length} span(s) that were still queued when tracing was shut down. Raise the shutdown timeout or flush earlier if they matter.`),this._queue=[],this._liveSpans.clear(),this._flushPromise=null,this._generation++,this._maxExportBatchSize=this._config.maxExportBatchSize,this._droppedSinceWarning=0,this._dropReasons.clear(),this._lastDropWarningAt=0,this._consecutiveFlushFailures=0,this._flushJitter=V5,this._retryAfter.reset(),this._resetHeadBatchBudget()}_resetHeadBatchBudget(){this._headBatchFailures=0,this._headBatchChargeableAt=0}_resolveParent(t,r){if(typeof t=="string"){let i=L$l(t,r?.tracestate);return i||this._logger.debug("Ignoring malformed traceparent; starting a new trace"),i}if(Gqo(t))return t.childContext();let n=this._contextManager.active();if(Gqo(n))return n.childContext();if(n instanceof m9t)return L$l(n.traceparent(),n.tracestate()??void 0)}_autoContextAttributes(){let t;try{t=this._getContext()}catch(n){return this._logger.debug("Failed to read tracing context; span will carry no PostHog attributes",n),{}}let r={};return t.distinctId&&(r.posthogDistinctId=t.distinctId),t.sessionId&&(r.sessionId=t.sessionId),t.currentUrl&&(r["url.full"]=t.currentUrl),t.screenName&&(r["screen.name"]=t.screenName),t.appState&&(r["app.state"]=t.appState),r}_recordCallbackError(t,r){if(!(t instanceof olt))return;let{type:n,message:i,stack:o}=_qo(r);t.addEvent("exception",{"exception.type":n,"exception.message":i,...o&&{"exception.stacktrace":o}}),t.statusIsExplicitlyOk||t.setStatus("error",i)}_evictAgedSpans(){let t=qZr()-this._config.maxSpanAgeMs,r=0;for(let[n,i]of this._liveSpans){if(i>t)break;this._liveSpans.delete(n),r++}r&&this._recordDrop(r,`they were still live after ${this._config.maxSpanAgeMs}ms`)}_onSpanEnd(t,r){if(!this._liveSpans.delete(t.spanId))return;if(this._instance.isDisabled||this._instance.optedOut)return void this._recordDrop(1,"the user has opted out");let n=this._runBeforeSpanSend(t,r);if(n){if(this._reportLimitDrops(n),this._queue.length>=this._config.maxQueueSize)return void this._recordDrop(1,`the queue is full (${this._config.maxQueueSize}) \u2014 raise the flush frequency or reduce span volume`);this._queue.push(n);try{this._onSpanQueued?.()}catch(i){this._logger.debug("Span queue notification failed",i)}!(this._queue.length>=this._maxExportBatchSize)||this._consecutiveFlushFailures||this._retryAfter.isOpen()?this._armFlushTimerIfQueued():this._flushInBackground()}}_reportLimitDrops(t){let r=t.droppedAttributesCount??0,n=t.droppedEventsCount??0,i=0;for(let o of t.events)i+=o.droppedAttributesCount??0;(r||n||i)&&this._logger.debug(`Span limits discarded data from "${t.name}": ${r} attributes, ${n} events, ${i} event attributes`)}_runBeforeSpanSend(t,r){if(!this._config.beforeSpanSend.length)return t;let n={traceId:t.traceId,spanId:t.spanId,parentSpanId:t.parentSpanId,traceState:t.traceState},i={startTime:t.startTime,endTime:t.endTime},o={attributes:t.droppedAttributesCount,events:t.droppedEventsCount},s=Object.keys(t.attributes),a={traceFlags:t.traceFlags,parentIsRemote:t.parentIsRemote},c=t.status&&{...t.status},l=t,u=t;try{for(let f of this._config.beforeSpanSend){let m=f(l);if(!m)return this._recordDrop(1,"beforeSpanSend dropped it"),null;l=this._keepSpanIdentity(m,n)}if(u={traceId:n.traceId,spanId:n.spanId,parentSpanId:n.parentSpanId,traceState:n.traceState,name:l.name,kind:l.kind,status:l.status,attributes:l.attributes,events:l.events,startTime:l.startTime,endTime:l.endTime,traceFlags:a.traceFlags,parentIsRemote:a.parentIsRemote,droppedAttributesCount:o.attributes,droppedEventsCount:o.events},!mrh(u))return this._logger.debug("beforeSpanSend did not return a span record; dropping the span"),this._recordDrop(1,"beforeSpanSend returned an unusable record"),null;u.name=rUe(u.name,"Span name",this._config.maxAttributeValueLength,this._logger),u.status&&u.status.code!=="ok"&&u.status.code!=="error"&&(this._logger.debug("beforeSpanSend set an unknown span status; keeping the original"),u.status=c),u.startTime=ilt(u.startTime)??i.startTime,u.endTime=MZr(ilt(u.endTime)??i.endTime,u.startTime);let d=[];for(let f of u.events)try{d.push({...f,name:rUe(f.name,"Span event name",this._config.maxAttributeValueLength,this._logger),timestamp:d9t(f.timestamp,u.startTime,"event timestamp",this._logger)})}catch{this._logger.debug("beforeSpanSend left an unreadable span event; dropping it")}return u.events=d,R$l(u,r,this._config.maxAttributesPerSpan,this._config.maxEventsPerSpan,this._config.maxAttributesPerEvent,this._config.maxAttributeValueLength,s),u}catch(p){return this._logger.debug("beforeSpanSend failed; dropping the span rather than exporting it unscrubbed",p),this._recordDrop(1,"beforeSpanSend failed"),null}}_keepSpanIdentity(t,r){(t.traceId!==r.traceId||t.spanId!==r.spanId||t.parentSpanId!==r.parentSpanId)&&this._logger.debug("beforeSpanSend changed a span identity field; keeping the original ids");try{WZr(t,"traceId",r.traceId),WZr(t,"spanId",r.spanId),WZr(t,"parentSpanId",r.parentSpanId),WZr(t,"traceState",r.traceState)}catch{return hrh(t,r)}return t}_recordDrop(t,r){this._droppedSinceWarning+=t,this._dropReasons.add(r),Date.now()-this._lastDropWarningAt>=this._config.flushIntervalMs&&this._warnAboutDrops()}_warnAboutDrops(){this._droppedSinceWarning&&(this._lastDropWarningAt=Date.now(),this._logger.warn(`Dropping ${this._droppedSinceWarning} span(s): ${[...this._dropReasons].join("; ")}`),this._droppedSinceWarning=0,this._dropReasons.clear())}_encodeBatch(t){let r=[];for(let n of t)try{r.push(j$l(n,this._logger))}catch(i){this._logger.debug("Failed to encode a span; dropping it",i),this._recordDrop(1,"its attributes could not be encoded")}return r}_discardQueueIfConsentWithdrawn(){if(!this._instance.isDisabled&&!this._instance.optedOut)return 0;let t=this._queue.length;return this._queue=[],this._resetHeadBatchBudget(),this._recordDrop(t,"the user has opted out"),this._warnAboutDrops(),t}async _flushInner(){if(!this._queue.length)return 0;let t=this._discardQueueIfConsentWithdrawn();if(t)return t;let r=N$l(z$l(this._config,this._instance.getLibraryId(),this._instance.getLibraryVersion()),this._config.maxAttributeValueLength),n=this._instance.getLibraryId(),i=this._instance.getLibraryVersion(),o=this._queue.length,s=0,a=1/0,c=this._generation;try{for(;o>0&&this._queue.length>0;){let l=this._discardQueueIfConsentWithdrawn();if(l)return s+l;let u=this._headBatchFailures>0?Math.min(this._maxExportBatchSize,this._headBatchSize):this._maxExportBatchSize,p=Math.max(1,Math.min(u,a,o,this._queue.length)),d=this._queue.slice(0,p),f=this._encodeBatch(d);if(!f.length){this._queue.splice(0,p),o-=p,s+=p,this._resetHeadBatchBudget();continue}let m=qZr()>=this._headBatchChargeableAt&&!this._retryAfter.isOpen(),g=await this._instance._sendTracesBatch(Q$l(f,r,n,i,this._logger));if(c!==this._generation)break;if(this._retryAfter.record(g),g.kind==="ok"){this._consecutiveFlushFailures=0,this._flushJitter=V5,this._resetHeadBatchBudget(),this._queue.splice(0,p),o-=p,s+=p,this._maxExportBatchSize<this._config.maxExportBatchSize&&this._maxExportBatchSize++;continue}if(g.kind==="too-large"){if(p===1){this._queue.splice(0,1),o-=1,s+=1,this._recordDrop(1,"it is too large for the ingestion endpoint"),this._consecutiveFlushFailures=0,this._flushJitter=V5,this._resetHeadBatchBudget();continue}let A=Math.max(1,Math.floor(p/2));g.measuredLocally?a=A:this._maxExportBatchSize=A,this._resetHeadBatchBudget(),this._logger.debug(`Batch too large; retrying the same spans in batches of ${A}`);continue}if(g.kind==="retry-later"){if(this._consecutiveFlushFailures++,this._flushJitter=l9t(),this._headBatchSize=p,m&&(this._headBatchFailures++,this._headBatchChargeableAt=qZr()+this._nextFlushDelay()),this._headBatchFailures<M$l)return this._logger.debug("Span export failed; retrying on the next flush",g.error),s;if(this._queue.splice(0,p),o-=p,s+=p,this._consecutiveFlushFailures=0,this._flushJitter=V5,this._resetHeadBatchBudget(),this._recordDrop(p,`the ingestion endpoint failed ${M$l} times in a row`),this._retryAfter.isOpen())return s;continue}this._logger.debug("Dropping a span batch the ingestion endpoint rejected",g.error),this._queue.splice(0,p),o-=p,s+=p,this._consecutiveFlushFailures=0,this._flushJitter=V5,this._resetHeadBatchBudget(),this._recordDrop(p,"the ingestion endpoint rejected the batch")}return s}finally{this._warnAboutDrops()}}_flushInBackground(){this._backgroundFlush||(this._backgroundFlush=this.flush().catch(t=>{this._logger.debug("Background span flush failed",t)}).finally(()=>{this._backgroundFlush=void 0,this._armFlushTimerIfQueuedNoEarlierThan()}))}_armFlushTimerIfQueued(){this._flushTimer.pending||!this._queue.length||this._flushTimer.arm(this._nextFlushDelay())}_armFlushTimerIfQueuedNoEarlierThan(){this._queue.length&&this._flushTimer.armNoEarlierThan(this._nextFlushDelay())}_nextFlushDelay(){return Math.max(u9t(this._config.flushIntervalMs,this._consecutiveFlushFailures,this._flushJitter,3e4),this._retryAfter.remainingMs())}};var A9t=class{active(){return this._active}with(t,r){let n=this._active;this._active=t;try{return r()}finally{this._active=n}}};var grh=5e3,Arh=512,yrh=2048,brh=128,Erh=128,Irh=128,vrh=8192,Crh=1e4,xrh=36e5;function vSe(e,t){return typeof e=="number"&&Number.isInteger(e)&&e>=1?e:t}var _$l=["service.name","service.version","deployment.environment"];function Srh(e){if(!(!e||typeof e!="object"||Array.isArray(e)))try{if(_$l.every(r=>!(r in e)||typeof e[r]=="string"))return e;let t={...e};for(let r of _$l)r in t&&typeof t[r]!="string"&&delete t[r];return t}catch{return}}function wrh(e,t){if(!e)return[];let r=[e].flat().filter(i=>!!i),n=r.filter(i=>typeof i=="function");return n.length!==r.length&&t?.critical(`beforeSpanSend: ignoring ${r.length-n.length} of ${r.length} entries that are not functions. Spans export without them, so whatever they were redacting is not redacted.`),n}function qqo(e,t,r){let n=dme({...t},Srh(e?.resourceAttributes)),i=vSe(e?.maxExportBatchSize,Arh);return{serviceName:n?.["service.name"]??e?.serviceName,serviceVersion:n?.["service.version"]??e?.serviceVersion,environment:n?.["deployment.environment"]??e?.environment,resourceAttributes:n,beforeSpanSend:wrh(e?.beforeSpanSend,r),maxAttributesPerSpan:vSe(e?.maxAttributesPerSpan,brh),maxEventsPerSpan:vSe(e?.maxEventsPerSpan,Erh),maxAttributesPerEvent:Irh,maxAttributeValueLength:vSe(e?.maxAttributeValueLength,vrh),flushIntervalMs:vSe(e?.flushIntervalMs,grh),maxExportBatchSize:i,maxQueueSize:Math.max(vSe(e?.maxQueueSize,yrh),i),maxLiveSpans:vSe(e?.maxLiveSpans,Crh),maxSpanAgeMs:vSe(e?.maxSpanAgeMs,xrh)}}var Wqo=require("fs"),G$l=require("fs/promises"),Kqo=require("path"),q$l=require("readline"),HZr=new mT.ReduceableCache(25),y9t=new mT.ReduceableCache(20),Jqo=7,Trh=1e3,Orh=1e4,Hqo=10485760;async function W$l(e,t=G$l.open,r){let n={},i;try{i=process.cwd()}catch{}for(let a=e.length-1;a>=0;a--){let c=e[a],l=c?.filename;if(!c||typeof l!="string"||typeof c.lineno!="number"||krh(l)||Frh(c)||!(0,Kqo.isAbsolute)(l)&&i===void 0)continue;n[l]||(n[l]=[]),n[l].push(c.lineno)}let o=Object.keys(n);if(o.length==0)return e;let s=[];for(let a of o){let c=H$l(a,i);if(c===void 0||y9t.get(c))continue;let l=n[a];if(!l)continue;l.sort((d,f)=>d-f);let u=jrh(l);if(u.every(d=>Nrh(c,d)))continue;let p=zrh(HZr,c,{});s.push(Brh(a,u,p,c,t,r))}return await Promise.all(s).catch(()=>{}),e&&e.length>0&&Drh(e,HZr,i),HZr.reduce(),e}async function Prh(e,t,r){let n,i=!1;try{n=await t(e,Wqo.constants.O_RDONLY|Wqo.constants.O_NONBLOCK);let o=await n.stat();return o.isFile()?o.size>Hqo?void r?.debug(`Skipping source context for oversized file ${e}: ${o.size} bytes exceeds ${Hqo}`):(i=!0,n):void 0}catch{return}finally{n&&!i&&await n.close().catch(()=>{})}}async function Brh(e,t,r,n,i,o){let s=await Prh(e,i,o);if(s===void 0)return void y9t.set(n,1);let a=s;return new Promise(c=>{let l=!1;function u(C){l||(l=!0,C?.destroy(),a.close().then(c,c))}let p;try{p=a.createReadStream({autoClose:!1,start:0,end:Hqo-1})}catch{y9t.set(n,1),u();return}let d;try{d=(0,q$l.createInterface)({input:p})}catch{y9t.set(n,1),u(p);return}let f=0,m=0,g=t[m];if(g===void 0)return void u(p);let A=g[0],y=g[1];function I(){y9t.set(n,1),d.close(),d.removeAllListeners(),u(p)}p.on("error",I),d.on("error",I),d.on("close",()=>u(p)),d.on("line",C=>{if(f++,!(f<A)&&(r[f]=Qrh(C,0),f>=y)){if(m===t.length-1){d.close(),d.removeAllListeners();return}m++;let x=t[m];if(x===void 0){d.close(),d.removeAllListeners();return}A=x[0],y=x[1]}})})}function Drh(e,t,r){for(let n of e)if(n.filename&&n.context_line===void 0&&typeof n.lineno=="number"){let i=H$l(n.filename,r),o=i===void 0?void 0:t.get(i);if(o===void 0)continue;Rrh(n.lineno,n,o)}}function Rrh(e,t,r){if(t.lineno===void 0||r===void 0)return;t.pre_context=[];for(let i=K$l(e);i<e;i++){let o=r[i];if(o===void 0)return void U$l(t);t.pre_context.push(o)}if(r[e]===void 0)return void U$l(t);t.context_line=r[e];let n=J$l(e);t.post_context=[];for(let i=e+1;i<=n;i++){let o=r[i];if(o===void 0)break;t.post_context.push(o)}}function U$l(e){delete e.pre_context,delete e.context_line,delete e.post_context}function krh(e){return e.startsWith("node:")||e.endsWith(".min.js")||e.endsWith(".min.cjs")||e.endsWith(".min.mjs")||e.startsWith("data:")}function Frh(e){return e.lineno!==void 0&&e.lineno>Orh||e.colno!==void 0&&e.colno>Trh}function H$l(e,t){return(0,Kqo.isAbsolute)(e)?JSON.stringify([null,e]):t===void 0?void 0:JSON.stringify([t,e])}function Nrh(e,t){let r=HZr.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 jrh(e){if(!e.length)return[];let t=0,r=e[0];if(typeof r!="number")return[];let n=V$l(r),i=[];for(;;){if(t===e.length-1){i.push(n);break}let o=e[t+1];if(typeof o!="number")break;o<=n[1]?n[1]=o+Jqo:(i.push(n),n=V$l(o)),t++}return i}function V$l(e){return[K$l(e),J$l(e)]}function K$l(e){return Math.max(1,e-Jqo)}function J$l(e){return e+Jqo}function zrh(e,t,r){let n=e.get(t);return n===void 0?(e.set(t,r),r):n}function Qrh(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 o=Math.min(i+140,n);return o>n-5&&(o=n),o===n&&(i=Math.max(o-140,0)),r=r.slice(i,o),i>0&&(r=`...${r}`),o<n&&(r+="..."),r}var slt=require("path");function Y$l(e=process.cwd()){let t=slt.sep==="\\",r=i=>t?i.replace(/\\/g,"/"):i,n=r(e);return async i=>{for(let o of i)!o.filename||o.filename.startsWith("node:")||o.filename.startsWith("data:")||(0,slt.isAbsolute)(o.filename)&&(o.filename=r((0,slt.relative)(n,r(o.filename))));return i}}var X$l="5.55.0";var hme={ERRORS_WHILE_COMPUTING:"errors_while_computing_flags",FLAG_MISSING:"flag_missing",QUOTA_LIMITED:"quota_limited",UNKNOWN_ERROR:"unknown_error"};var CSe=class e{constructor(t){this._host=t.host,this._distinctId=t.distinctId,this._groups=t.groups,this._disableGeoip=t.disableGeoip,this._flags=t.flags,this._requestId=t.requestId,this._evaluatedAt=t.evaluatedAt,this._flagDefinitionsLoadedAt=t.flagDefinitionsLoadedAt,this._errorsWhileComputing=t.errorsWhileComputing??!1,this._quotaLimited=t.quotaLimited??!1,this._accessed=t.accessed??new Set,this._isSlice=t.isSlice??!1}isEnabled(t,r={}){let n=this._flags[t];return this._recordAccess(t),n?.enabled??r.defaultValue??!1}getFlag(t){let r=this._flags[t];if(this._recordAccess(t),!!r)return r.enabled?r.variant??!0:!1}getFlagPayload(t){return this._flags[t]?.payload}onlyAccessed(){let t={};for(let r of this._accessed){let n=this._flags[r];n&&(t[r]=n)}return this._cloneWith(t)}only(t){let r={},n=[];for(let i of t){let o=this._flags[i];o?r[i]=o:n.push(i)}return n.length>0&&this._host.logWarning(`FeatureFlagEvaluations.only() was called with flag keys that are not in the evaluation set and will be dropped: ${n.join(", ")}`),this._cloneWith(r)}get keys(){return Object.keys(this._flags)}_getEventProperties(){let t={},r=[];for(let[n,i]of Object.entries(this._flags)){let o=i.enabled===!1?!1:i.variant??!0;t[`$feature/${n}`]=o,i.enabled&&r.push(n)}return r.length>0&&(r.sort(),t.$active_feature_flags=r),t}_cloneWith(t){return new e({host:this._host,distinctId:this._distinctId,groups:this._groups,disableGeoip:this._disableGeoip,flags:t,requestId:this._requestId,evaluatedAt:this._evaluatedAt,flagDefinitionsLoadedAt:this._flagDefinitionsLoadedAt,errorsWhileComputing:this._errorsWhileComputing,quotaLimited:this._quotaLimited,accessed:new Set(this._accessed),isSlice:!0})}_recordAccess(t){if(this._accessed.add(t),this._distinctId===""||this._isSlice&&!(t in this._flags))return;let r=this._flags[t],n=r===void 0?void 0:r.enabled===!1?!1:r.variant??!0,i={$feature_flag:t,$feature_flag_response:n,$feature_flag_id:r?.id,$feature_flag_version:r?.version,$feature_flag_reason:r?.reason,locally_evaluated:r?.locallyEvaluated??!1,[`$feature/${t}`]:n,$feature_flag_request_id:this._requestId,$feature_flag_evaluated_at:r?.locallyEvaluated?Date.now():this._evaluatedAt};r?.hasExperiment!==void 0&&(i.$feature_flag_has_experiment=r.hasExperiment),r?.locallyEvaluated&&this._flagDefinitionsLoadedAt!==void 0&&(i.$feature_flag_definitions_loaded_at=this._flagDefinitionsLoadedAt);let o=[];this._errorsWhileComputing&&o.push(hme.ERRORS_WHILE_COMPUTING),this._quotaLimited&&o.push(hme.QUOTA_LIMITED),r===void 0&&o.push(hme.FLAG_MISSING),o.length>0&&(i.$feature_flag_error=o.join(",")),this._host.captureFlagCalledEventIfNeeded({distinctId:this._distinctId,key:t,response:n,groups:this._groups,disableGeoip:this._disableGeoip,properties:i})}};var Mrh=6e4;function Z$l(e){return e==="client"||e==="server"?e:"all"}function Lrh(e,t){return e===t||e==="all"||t==="all"}var alt=class e extends Error{constructor(t){super(),Error.captureStackTrace(this,this.constructor),this.name="ClientError",this.message=t,Object.setPrototypeOf(this,e.prototype)}};function _rh(e,t){e.name=t.name,Error.captureStackTrace(e,t),Object.setPrototypeOf(e,t.prototype)}var qte=class e extends Error{constructor(t){super(t),_rh(this,e)}},KZr=class{constructor({pollingInterval:t,personalApiKey:r,projectApiKey:n,timeout:i,host:o,customHeaders:s,...a}){this.debugMode=!1,this.shouldBeginExponentialBackoff=!1,this.backOffCount=0,this.pollerStopped=!1,this.filteredOutFlagKeys=new Set,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=o,this.poller=void 0,this.fetch=a.fetch||fetch,this.onError=a.onError,this.customHeaders=s,this.onLoad=a.onLoad,this.onMinimalFlagCalledEvents=a.onMinimalFlagCalledEvents,this.cacheProvider=a.cacheProvider,this.strictLocalEvaluation=a.strictLocalEvaluation??!1,this.evaluationContexts=a.evaluationContexts,this.loadFeatureFlags()}debug(t=!0){this.debugMode=t}logMsgIfDebug(t){this.debugMode&&t()}withEvaluationSnapshot(t){return t.definitions?t:{...t,evaluationCache:{},definitions:{featureFlagsByKey:this.featureFlagsByKey,groupTypeMapping:this.groupTypeMapping,cohorts:this.cohorts,filteredOutFlagKeys:this.filteredOutFlagKeys,propertyMatchingVersion:this.propertyMatchingVersion}}}createEvaluationContext(t,r={},n={},i={},o={}){return{distinctId:t,groups:r,personProperties:n,groupProperties:i,evaluationCache:o}}async getFeatureFlag(t,r,n={},i={},o={}){await this.loadFeatureFlags();let s,a;if(!this.loadedSuccessfullyOnce)return s;if(a=this.featureFlagsByKey[t],a!==void 0){let c=this.createEvaluationContext(r,n,i,o);try{s=(await this.computeFlagAndPayloadLocally(a,c)).value,this.logMsgIfDebug(()=>console.debug(`Successfully computed flag locally: ${t} -> ${s}`))}catch(l){l instanceof qte||l instanceof Ml?this.logMsgIfDebug(()=>console.debug(`${l.name} when computing flag locally: ${t}: ${l.message}`)):l instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${t}: ${l}`))}}return s}async getAllFlagsAndPayloads(t,r){await this.loadFeatureFlags();let n={},i={},o=this.featureFlags.length==0,s=r?r.map(c=>this.featureFlagsByKey[c]).filter(Boolean):this.featureFlags,a=this.withEvaluationSnapshot({...t,definitions:void 0});return await Promise.all(s.map(async c=>{try{let{value:l,payload:u}=await this.computeFlagAndPayloadLocally(c,a,{skipLoadCheck:!0});n[c.key]=l,u&&(i[c.key]=u)}catch(l){l instanceof qte||l instanceof Ml?this.logMsgIfDebug(()=>console.debug(`${l.name} when computing flag locally: ${c.key}: ${l.message}`)):l instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${c.key}: ${l}`)),o=!0}})),{response:n,payloads:i,fallbackToFlags:o}}async computeFlagAndPayloadLocally(t,r,n={}){let{matchValue:i,skipLoadCheck:o=!1}=n;if(this.loadedSuccessfullyOnce&&(r=this.withEvaluationSnapshot(r)),o||await this.loadFeatureFlags(),!this.loadedSuccessfullyOnce)return{value:!1,payload:null};r=this.withEvaluationSnapshot(r),t=r.definitions.featureFlagsByKey[t.key]??t;let s;s=i!==void 0?i:await this.computeFlagValueLocally(t,r);let a=Bqo(t.filters?.payloads,s);return{value:s,payload:a}}async computeFlagValueLocally(t,r){let{distinctId:n,groups:i,personProperties:o,groupProperties:s}=r;if(!t.active)return!1;if(t.ensure_experience_continuity)throw new Ml("Flag has experience continuity enabled");let c=(t.filters||{}).aggregation_group_type_index;if(c!=null){let l=r.definitions.groupTypeMapping[String(c)];if(!l)throw this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Unknown group type index ${c} for feature flag ${t.key}`)),new Ml("Flag has unknown group type index");if(!(l in i))return this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Can't compute group feature flag: ${t.key} without group names passed in`)),!1;t.bucketing_identifier==="device_id"&&(o?.$device_id===void 0||o?.$device_id===null||o?.$device_id==="")&&this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Ignoring bucketing_identifier for group flag: ${t.key}`));let u=s[l];return await this.matchFeatureFlagProperties(t,i[l],u,r)}{let l=this.getBucketingValueForFlag(t,n,o);if(l===void 0)throw this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Can't compute feature flag: ${t.key} without $device_id, falling back to server evaluation`)),new Ml(`Can't compute feature flag: ${t.key} without $device_id`);return await this.matchFeatureFlagProperties(t,l,o,r)}}getBucketingValueForFlag(t,r,n){if(t.filters?.aggregation_group_type_index!=null)return r;if(t.bucketing_identifier==="device_id"){let i=n?.$device_id;return i==null||i===""?void 0:i}return r}async evaluateFlagDependency(t,r,n){let{evaluationCache:i}=n,o=t.key;if(!n.definitions.featureFlagsByKey)throw new Ml("Feature flags not available for dependency evaluation");if(!("dependency_chain"in t))throw new Ml(`Flag dependency property for '${o}' is missing required 'dependency_chain' field`);let s=t.dependency_chain;if(!Array.isArray(s))throw new Ml(`Flag dependency property for '${o}' has an invalid 'dependency_chain' (expected array, got ${typeof s})`);if(s.length===0)throw new Ml(`Circular dependency detected for flag '${o}' (empty dependency chain)`);for(let c of s){if(!(c in i)){let u=n.definitions.featureFlagsByKey[c];if(u)if(u.active)try{let p=await this.computeFlagValueLocally(u,n);i[c]=p}catch(p){throw new Ml(`Error evaluating flag dependency '${c}' for flag '${o}': ${p}`)}else i[c]=!1;else if(n.definitions.filteredOutFlagKeys.has(c))i[c]=!1;else throw new Ml(`Missing flag dependency '${c}' for flag '${o}'`)}if(i[c]==null)throw new Ml(`Dependency '${c}' could not be evaluated`)}let a=i[o];return this.flagEvaluatesToExpectedValue(t.value,a)}flagEvaluatesToExpectedValue(t,r){return typeof t=="boolean"?t===r||typeof r=="string"&&r!==""&&t===!0:typeof t=="string"?r===t:!1}async matchFeatureFlagProperties(t,r,n,i){i=this.withEvaluationSnapshot(i);let o=t.filters||{},s=await Oqo(o.holdout,r);if(s!==void 0)return s;let a=o.groups||[],c=o.aggregation_group_type_index,l=o.early_exit??!1,{groups:u,groupProperties:p}=i,d=!1,f;for(let m of a)try{let g=m.aggregation_group_type_index!==void 0?m.aggregation_group_type_index:c,A=n,y=r;if(g!==c&&g!=null){let C=i.definitions.groupTypeMapping[String(g)];if(!C||!(C in u)){this.logMsgIfDebug(()=>console.debug(`[FEATURE FLAGS] Skipping group condition for flag '${t.key}': group type index ${g} not available`));continue}if(!(C in p)){d=!0;continue}A=p[C],y=u[C]}let I=await this.isConditionMatch(t,y,m,A,i);if(I==="match"){let C=m.variant,x=o.multivariate?.variants||[];f=C&&x.some(S=>S.key===C)?C:await this.getMatchingVariant(t,y)||!0;break}if(l&&I==="out_of_rollout_bound"){if(d)break;return!1}}catch(g){if(g instanceof qte)throw g;if(g instanceof Ml)d=!0;else throw g}if(f!==void 0)return f;if(d)throw new Ml("Can't determine if feature flag is enabled or not with given properties");return!1}async isConditionMatch(t,r,n,i,o){o=this.withEvaluationSnapshot(o);let s=o.definitions,a=n.rollout_percentage,c=l=>{this.logMsgIfDebug(()=>console.warn(l))};if((n.properties||[]).length>0){for(let l of n.properties){let u=l.type,p=!1;if(u==="cohort"){let d=await eeu(l,i,s.cohorts,this.debugMode,f=>this.evaluateFlagDependency(f,i,o),s.propertyMatchingVersion);p=l.operator==="not_in"?!d:d}else p=u==="flag"?await this.evaluateFlagDependency(l,i,o):$$l(l,i,c,s.propertyMatchingVersion);if(!p)return"no_match"}if(a==null)return"match"}return a!=null&&await o9t(t.key,r)>a/100?"out_of_rollout_bound":"match"}async getMatchingVariant(t,r){return Pqo(t.key,r,t.filters?.multivariate?.variants||[])}variantLookupTable(t){return kZr(t.filters?.multivariate?.variants||[])}filterFlagsByEvaluationContexts(t){if(!this.evaluationContexts||this.evaluationContexts.length===0)return t;let r=new Set(this.evaluationContexts);return t.filter(n=>{let i=n.evaluation_contexts??n.evaluation_tags;return!i||i.length===0?!0:i.some(o=>r.has(o))})}getEvaluationRuntimeForFlag(t){let r=this.featureFlagsByKey[t];return r?Z$l(r.evaluation_runtime):void 0}getFlagKeysByEvaluationRuntime(t){return this.featureFlags.filter(r=>Lrh(Z$l(r.evaluation_runtime),t)).map(r=>r.key)}updateFlagState(t){let r=this.filterFlagsByEvaluationContexts(t.flags);this.featureFlags=r,this.featureFlagsByKey=r.reduce((i,o)=>(i[o.key]=o,i),{});let n=new Set(r.map(i=>i.key));this.filteredOutFlagKeys=new Set(t.flags.filter(i=>!n.has(i.key)).map(i=>i.key)),this.groupTypeMapping=t.group_type_mapping??t.groupTypeMapping??{},this.cohorts=t.cohorts,this.propertyMatchingVersion=t.property_matching_version??t.propertyMatchingVersion,this.loadedSuccessfullyOnce=!0,this.onMinimalFlagCalledEvents?.((t.minimal_flag_called_events??t.minimalFlagCalledEvents)===!0)}warnAboutExperienceContinuityFlags(t){if(this.strictLocalEvaluation)return;let r=t.filter(n=>n.ensure_experience_continuity);r.length>0&&console.warn(`[PostHog] You are using local evaluation but ${r.length} flag(s) have experience continuity enabled: ${r.map(n=>n.key).join(", ")}. Experience continuity is incompatible with local evaluation and will cause a server request on every flag evaluation, negating local evaluation cost savings. To avoid server requests and unexpected costs, either disable experience continuity on these flags in PostHog, use strictLocalEvaluation: true in client init, or pass onlyEvaluateLocally: true per flag call (flags that cannot be evaluated locally will return undefined).`)}async loadFromCache(t){if(!this.cacheProvider)return!1;try{let r=await this.cacheProvider.getFlagDefinitions();return r?(this.updateFlagState(r),this.logMsgIfDebug(()=>console.debug(`[FEATURE FLAGS] ${t} (${r.flags.length} flags)`)),this.onLoad?.(this.featureFlags.length),this.warnAboutExperienceContinuityFlags(this.featureFlags),!0):!1}catch(r){return this.onError?.(new Error(`Failed to load from cache: ${r}`)),!1}}async loadFeatureFlags(t=!1){if(!(this.loadedSuccessfullyOnce&&!t))return!t&&this.nextFetchAllowedAt&&Date.now()<this.nextFetchAllowedAt?void this.logMsgIfDebug(()=>console.debug("[FEATURE FLAGS] Skipping fetch, in backoff period")):(this.loadingPromise||(this.loadingPromise=this._loadFeatureFlags().catch(r=>this.logMsgIfDebug(()=>console.debug(`[FEATURE FLAGS] Failed to load feature flags: ${r}`))).finally(()=>{this.loadingPromise=void 0})),this.loadingPromise)}isLocalEvaluationReady(){return(this.loadedSuccessfullyOnce??!1)&&(this.featureFlags?.length??0)>0}getFlagDefinitionsLoadedAt(){return this.flagDefinitionsLoadedAt}getPollingInterval(){let t=this.pollingInterval??3e4;return this.shouldBeginExponentialBackoff?Math.min(Mrh,t*2**this.backOffCount):t}beginBackoff(){this.shouldBeginExponentialBackoff=!0,this.backOffCount+=1,this.nextFetchAllowedAt=Date.now()+this.getPollingInterval()}clearBackoff(){this.shouldBeginExponentialBackoff=!1,this.backOffCount=0,this.nextFetchAllowedAt=void 0}async _loadFeatureFlags(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);try{let t=!0;if(this.cacheProvider)try{t=await this.cacheProvider.shouldFetchFlagDefinitions()}catch(n){this.onError?.(new Error(`Error in shouldFetchFlagDefinitions: ${n}`))}if(!t&&(await this.loadFromCache("Loaded flags from cache (skipped fetch)")||this.loadedSuccessfullyOnce))return;let r=await this._requestFeatureFlagDefinitions();if(!r)return;switch(r.status){case 304:this.logMsgIfDebug(()=>console.debug("[FEATURE FLAGS] Flags not modified (304), using cached data")),this.flagsEtag=r.headers?.get("ETag")??this.flagsEtag,this.loadedSuccessfullyOnce=!0,this.clearBackoff();return;case 401:throw this.beginBackoff(),new alt(`Your project key or secret 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.filteredOutFlagKeys=new Set,this.groupTypeMapping={},this.cohorts={},this.propertyMatchingVersion=void 0,this.onMinimalFlagCalledEvents?.(!1);return;case 403:throw this.beginBackoff(),new alt(`Your secret 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 secret and Project API key pair? More information: https://posthog.com/docs/api/overview`);case 429:throw this.beginBackoff(),new alt(`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 n=await r.json()??{};if(!("flags"in n))return void this.onError?.(new Error(`Invalid response when getting feature flags: ${JSON.stringify(n)}`));this.flagsEtag=r.headers?.get("ETag")??void 0;let i=n.group_type_mapping||{},o=n.minimal_flag_called_events===!0,s={flags:n.flags??[],group_type_mapping:i,cohorts:n.cohorts||{},minimal_flag_called_events:o,property_matching_version:n.property_matching_version,propertyMatchingVersion:n.property_matching_version,groupTypeMapping:i,minimalFlagCalledEvents:o};if(this.updateFlagState(s),this.flagDefinitionsLoadedAt=Date.now(),this.clearBackoff(),this.cacheProvider&&t)try{await this.cacheProvider.onFlagDefinitionsReceived(s)}catch(a){this.onError?.(new Error(`Failed to store in cache: ${a}`))}this.onLoad?.(this.featureFlags.length),this.warnAboutExperienceContinuityFlags(this.featureFlags);break}default:return}}catch(t){t instanceof alt&&this.onError?.(t)}finally{!this.pollerStopped&&this.pollingInterval!==null&&(this.poller=setTimeout(()=>this.loadFeatureFlags(!0),this.getPollingInterval()))}}getPersonalApiKeyRequestOptions(t="GET",r){let n={...this.customHeaders,"Content-Type":"application/json",Authorization:`Bearer ${this.personalApiKey}`};return r&&(n["If-None-Match"]=r),{method:t,headers:n}}async _requestFeatureFlagDefinitions(){let t=`${this.host}/flags/definitions?token=${this.projectApiKey}&send_cohorts`,r=this.getPersonalApiKeyRequestOptions("GET",this.flagsEtag),n=null;if(this.timeout&&typeof this.timeout=="number"){let o=new AbortController;n=T2(()=>{o.abort()},this.timeout),r.signal=o.signal}let i=()=>clearTimeout(n);try{let o=this.fetch,s=await o(t,r);return s.status!==200?(i(),s):{status:s.status,headers:s.headers,body:s.body,text:async()=>{try{return await s.text()}finally{i()}},json:async()=>{try{return await s.json()}finally{i()}}}}catch(o){throw i(),o}}async stopPoller(t=3e4){if(this.pollerStopped=!0,clearTimeout(this.poller),this.poller=void 0,this.cacheProvider)try{let r=this.cacheProvider.shutdown();r instanceof Promise&&await ESe(r,t,()=>{throw new Error(`Cache shutdown timeout after ${t}ms`)})}catch(r){this.onError?.(new Error(`Error during cache shutdown: ${r}`))}}};function $$l(e,t,r,n){return Tqo(e,t,{warnFunction:r,propertyMatchingVersion:n})}function Urh(e,t){if(!(e in t))throw new qte(`cohort ${e} not found in local cohorts - likely a static cohort that requires server evaluation`)}async function eeu(e,t,r,n=!1,i,o){let s=String(e.value);Urh(s,r);let a=r[s];return teu(a,t,r,n,i,o)}async function teu(e,t,r,n=!1,i,o){if(!e)return!0;let s=e.type,a=e.values;if(!a||a.length===0)return!0;let c=!1;if("values"in a[0]){for(let l of a)try{let u=await teu(l,t,r,n,i,o);if(s==="AND"){if(!u)return!1}else if(u)return!0}catch(u){if(u instanceof qte)throw u;if(u instanceof Ml)n&&console.debug(`Failed to compute property ${l} locally: ${u}`),c=!0;else throw u}if(c)throw new Ml("Can't match cohort without a given cohort property value");return s==="AND"}for(let l of a)try{let u;if(l.type==="cohort")u=await eeu(l,t,r,n,i,o);else if(l.type==="flag"){if(!i)throw new Ml(`Flag dependency '${l.key||"unknown"}' cannot be evaluated without a flag dependency evaluator`);u=await i(l)}else u=$$l(l,t,void 0,o);let p=l.negation||!1;if(s==="AND"){if(!u&&!p||u&&p)return!1}else if(u&&!p||!u&&p)return!0}catch(u){if(u instanceof qte)throw u;if(u instanceof Ml)n&&console.debug(`Failed to compute property ${l} locally: ${u}`),c=!0;else throw u}if(c)throw new Ml("can't match cohort without a given cohort property value");return s==="AND"}var Vrh=["--unhandled-rejections","--unhandled_rejections"],Grh=new Set(["throw","strict","warn","warn-with-error-code","none"]),qrh=[...globalThis.process?.execArgv??[]],Wrh=globalThis.process?.env?.NODE_OPTIONS;function Hrh(e){let t=[],r="",n=!1;for(let i=0;i<e.length;i++){let o=e[i];o==="\\"&&n&&i+1<e.length?r+=e[++i]:o!==" "||n?o==='"'?n=!n:r+=o:r&&(t.push(r),r="")}return r&&t.push(r),t}function reu(e){let t;for(let r=0;r<e.length;r++){let n=e[r],i=Vrh.find(s=>n===s||n.startsWith(`${s}=`));if(!i)continue;let o=n===i?e[++r]:n.slice(i.length+1);Grh.has(o)&&(t=o)}return t}function Krh(e=qrh,t=Wrh){return reu(e)??reu(Hrh(t??""))??"throw"}var neu=Krh();function ieu(e,t,r){e(t,{mechanism:{type:r==="unhandledRejection"?"onunhandledrejection":"onuncaughtexception",handled:!1}})}function Jrh(e,t){let r=!1;return Object.assign((n,i)=>{let o=global.process.listeners("uncaughtException").filter(s=>s.name!=="domainUncaughtExceptionClear"&&s._posthogErrorHandler!==!0).length;ieu(e,n,i),!r&&o===0&&(r=!0,t(n))},{_posthogErrorHandler:!0})}function oeu(e,t,r=neu){let n=globalThis.process;if(n){if(r==="strict")return void n.on("uncaughtExceptionMonitor",(i,o)=>ieu(e,i,o));n.on("uncaughtException",Jrh(e,t))}}function seu(e,t=neu){let r=globalThis.process;!r||t==="throw"||t==="strict"||t==="warn-with-error-code"||r.on("unhandledRejection",n=>{e(n,{mechanism:{type:"onunhandledrejection",handled:!1}})})}var Yrh=2e3,Yqo=class e{constructor(t,r,n){this.client=t,this._exceptionAutocaptureEnabled=r.enableExceptionAutocapture||!1,this._logger=n,this._rateLimiter=new dZr({...AZl(r),refillInterval:1e4,_logger:this._logger}),this.startAutocaptureIfEnabled()}static isPreviouslyCapturedError(t){return VGt(t)&&"__posthog_previously_captured_error"in t&&t.__posthog_previously_captured_error===!0}static async buildEventMessage(t,r,n,i,o){let s={...o},a=t.buildFromUnknown(r,n);a.$exception_list=await t.modifyFrames(a.$exception_list);let c=mT.getInjectedReleaseId();return c&&(s.$release_id=c),{event:"$exception",distinctId:i,properties:{...a,...s},_originatedFromCaptureException:!0}}startAutocaptureIfEnabled(){this.isEnabled()&&(oeu(this.onException.bind(this),this.onFatalError.bind(this)),seu(this.onException.bind(this)))}onException(t,r){this.client.addPendingPromise((async()=>{if(!e.isPreviouslyCapturedError(t)){let n=await e.buildEventMessage(this.client.getErrorPropertiesBuilder(),t,r),o=n.properties?.$exception_list[0]?.type??"Exception";return this._rateLimiter.consumeRateLimit(o)?void this._logger.info("Skipping exception capture because of client rate limiting.",{exception:o}):this.client._capturePreparedEvent(n,!1)}})())}async onFatalError(t){console.error(t),await this.client.shutdown(Yrh),globalThis.process.exit(1)}isEnabled(){return!this.client.isDisabled&&this._exceptionAutocaptureEnabled}shutdown(){this._rateLimiter.stop()}},iUe=Yqo;var JZr=class{getProperty(t){return this._memoryStorage[t]}setProperty(t,r){this._memoryStorage[t]=r!==null?r:void 0}constructor(){this._memoryStorage={}}};function Xrh(e){return e==="v0"||e==="v1"}function aeu(){let e="u">typeof process?process.env?.POSTHOG_CAPTURE_MODE:void 0;return Xrh(e)?e:"v0"}var Zrh="$ai_",b9t="analytics";function ceu(e){return typeof e.event=="string"&&e.event.startsWith(Zrh)}var clt=class e extends Error{constructor({requestId:t,drops:r,retryExhausted:n,cause:i}){super(e.buildMessage(t,r,n,i)),this.name="CaptureV1Error",this.requestId=t,this.drops=r,this.retryExhausted=n,this.cause=i}static buildMessage(t,r,n,i){let o=`Capture V1 batch ${t} did not fully deliver: ${r.length} dropped, ${n.length} undelivered`;return i instanceof Error&&(o+=` (${i.message})`),o}};function Xqo(e){if(typeof e=="boolean")return e;if(typeof e=="number")return e!==0;if(typeof e=="string"){let t=e.trim().toLowerCase();if(t==="true"||t==="1")return!0;if(t==="false"||t==="0")return!1}}function $rh(e){return typeof e=="string"?e:void 0}var enh=[{property:"$cookieless_mode",optionKey:"cookieless_mode",coerce:Xqo},{property:"$ignore_sent_at",optionKey:"disable_skew_correction",coerce:Xqo},{property:"$process_person_profile",optionKey:"process_person_profile",coerce:Xqo},{property:"$product_tour_id",optionKey:"product_tour_id",coerce:$rh}],tnh=[{property:"$session_id",field:"session_id"},{property:"$window_id",field:"window_id"}];function rnh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function nnh(e){if(typeof e=="string"){let r=new Date(e);if(Number.isNaN(r.getTime()))return new Date().toISOString();let n=r.toISOString(),i=e.match(/\.(\d+)(?:Z|[+-]\d{2}:?\d{2})?$/i)?.[1];return i&&i.length>3?n.replace(/\.\d{3}Z$/,`.${i}Z`):n}if(e instanceof Date)return Number.isNaN(e.getTime())?new Date().toISOString():e.toISOString();let t=e==null?new Date:new Date(e);return Number.isNaN(t.getTime())?new Date().toISOString():t.toISOString()}function leu(e,t,r){r!==void 0&&!(t in e)&&(e[t]=r)}function inh(e){let r={...rnh(e.properties)?e.properties:{}},n={};for(let{property:o,optionKey:s,coerce:a}of enh)if(o in r){let c=a(r[o]);c!==void 0&&(n[s]=c),delete r[o]}let i={};for(let{property:o,field:s}of tnh)if(o in r){let a=r[o];typeof a=="string"&&(i[s]=a),delete r[o]}return delete r.$lib,delete r.$lib_version,leu(r,"$set",e.$set),leu(r,"$set_once",e.$set_once),{event:String(e.event??""),uuid:String(e.uuid??""),distinct_id:String(e.distinct_id??""),timestamp:nnh(e.timestamp),...i,options:n,properties:r}}function ueu(e,{createdAt:t,historicalMigration:r}){let n={created_at:t,batch:e.map(inh)};return r&&(n.historical_migration=!0),n}var onh="/i/v1/analytics/events",snh=3e4,anh=new Set([408,500,502,503,504]),YZr=class{constructor(t,r){this.config=t,this.maxBackoffMs=t.maxBackoffMs??snh,this.fetchFn=r.fetch,this.onError=r.onError,this.now=r.now??Date.now,this.sleep=r.sleep??(n=>new Promise(i=>T2(i,n))),this.generateRequestId=r.generateRequestId??w2,this.compress=r.compress??r9t}async sendV1Batch(t){if(t.length===0)return;let r=this.generateRequestId(),n=new Date(this.now()).toISOString(),{batch:i}=ueu(t,{createdAt:n,historicalMigration:this.config.historicalMigration}),o=`${this.config.host}${onh}`,s=[],a=i,c=Math.max(1,this.config.maxAttempts);for(let l=1;l<=c;l++){let u=l===c,p=ySe({created_at:n,...this.config.historicalMigration?{historical_migration:!0}:{},batch:a}),d,f;try{d=await this.sendOnce(o,p,l,r);let{response:m,signal:g}=d,{status:A}=m;if(A<200||A>=300)if(!u&&anh.has(A)){let y=this.parseRetryAfter(m);await d.waitFor(d.cancelBody()).catch(()=>{}),f=this.backoffDelay(l,y)}else{let y=await this.buildHttpError(m,A,d.waitFor);return this.surfaceBatchFailure(r,s,a,y)}else{let y;try{y=await d.waitFor(this.parseResponse(m))}catch(x){if(g.aborted)throw x;return this.surfaceBatchFailure(r,s,a,new Error(`Capture V1 returned an unparseable ${A} response body`))}let I=this.classify(a,y,s);if(I.length===0)return this.surfacePartialDrops(r,s);if(u)return void this.onError(new clt({requestId:r,drops:s,retryExhausted:I.map(x=>x.uuid)}));a=I;let C=this.parseRetryAfter(m);f=this.backoffDelay(l,C)}}catch(m){if(d&&!d.signal.aborted)throw m;if(u)return this.surfaceBatchFailure(r,s,a,m);f=this.backoffDelay(l)}finally{d?.cleanup()}f!==void 0&&await this.sleep(f)}}async sendOnce(t,r,n,i){let o=this.buildHeaders(n,i),s=r;if(this.config.compressionEnabled){let p=await this.compress(r,this.config.isDebug);p!==null&&(s=p,o["Content-Encoding"]="gzip")}let a=new AbortController,c="waiting for response headers",l,u=new Promise((p,d)=>{l=T2(()=>{let f=new Error(`Capture V1 request timed out ${c} after ${this.config.requestTimeoutMs}ms`);f.name="AbortError",d(f),a.abort(f)},this.config.requestTimeoutMs)});try{let p=this.fetchFn(t,{method:"POST",headers:o,body:s,signal:a.signal}),d=!1;p.then(y=>{a.signal.aborted&&!d&&this.cancelBody(y)}).catch(()=>{});let f=await Promise.race([p,u]);d=!0,c="while reading the response body";let m=!1,g,A=()=>g??=this.cancelBody(f);return{response:f,signal:a.signal,waitFor:y=>Promise.race([y,u]),cancelBody:A,cleanup:()=>{m||(m=!0,clearTimeout(l),a.signal.aborted&&A())}}}catch(p){throw clearTimeout(l),p}}buildHeaders(t,r){let n=`${this.config.libraryId}/${this.config.libraryVersion}`,i={"Content-Type":"application/json",Authorization:`Bearer ${this.config.apiKey}`,"PostHog-Sdk-Info":n,"PostHog-Attempt":String(t),"PostHog-Request-Id":r,"PostHog-Request-Timestamp":new Date(this.now()).toISOString()};return this.config.userAgent&&(i["User-Agent"]=this.config.userAgent),i}classify(t,r,n){let i=r.results??{},o=[];for(let s of t){let a=i[s.uuid];a&&(a.result==="drop"?n.push({uuid:s.uuid,details:a.details??void 0}):a.result==="retry"&&o.push(s))}return o}backoffDelay(t,r){let n=Math.min(this.config.initialRetryDelayMs*2**(t-1),this.maxBackoffMs);return r===void 0?n:Math.max(n,Math.min(r,this.maxBackoffMs))}parseRetryAfter(t){let r=t.headers?.get("Retry-After");if(!r)return;let n=r.trim();if(/^\d+$/.test(n)){let s=parseInt(n,10);return Number.isFinite(s)&&s>0?1e3*s:void 0}let i=Date.parse(n);if(Number.isNaN(i))return;let o=i-this.now();return o>0?o:void 0}async parseResponse(t){let r=await t.text(),n=JSON.parse(r);if(typeof n!="object"||n===null||Array.isArray(n))throw new Error("unexpected response shape");let i=n.results;if(i!==void 0&&(typeof i!="object"||i===null||Array.isArray(i)))throw new Error("unexpected results shape");return{results:i??{}}}async buildHttpError(t,r,n){let i="";try{i=(await n(t.text())).slice(0,512)}catch{}let o=i?`: ${i}`:"";return new Error(`Capture V1 request failed with HTTP ${r}${o}`)}surfaceBatchFailure(t,r,n,i){this.onError(new clt({requestId:t,drops:r,retryExhausted:n.map(o=>o.uuid),cause:i}))}surfacePartialDrops(t,r){r.length>0&&this.onError(new clt({requestId:t,drops:r,retryExhausted:[]}))}async cancelBody(t){try{await t.body?.cancel()}catch{}}};var oUe="ai-capture",XZr="/i/v0/ai/batch/";var lnh=new TextEncoder;function $qo(e){return lnh.encode(ySe(e)).length}function peu(e,t=8388608,r=5242880){let n=[],i=[],o=[],s=0;for(let a of e){if(a===void 0)continue;let c=$qo(a);if(c>t){i.push({event:typeof a.event=="string"?a.event:"unknown",bytes:c});continue}o.length>0&&s+c>r&&(n.push(o),o=[],s=0),o.push(a),s+=c}return o.length>0&&n.push(o),{batches:n,dropped:i}}var unh=100,feu=3e4,pnh=5e4,fnh=50,dnh=500,mnh="https://us.i.posthog.com",deu=new Set;function $Zr(e,t){deu.has(e)||(deu.add(e),console.warn(`[PostHog] ${t}`))}function hnh(e){return typeof e=="string"?e.trim():""}function gnh(e){return(typeof e=="string"?e.trim():"")||void 0}function Anh(e){return(typeof e=="string"?e.trim():"")||mnh}function ynh(e){return(Array.isArray(e)?e:[e]).filter(r=>typeof r=="string"&&r.trim().length>0)}function bnh(e){if(!e)return{};let t={};for(let[n,i]of Object.entries(e))t[`$feature/${n}`]=i;let r=Object.keys(e).filter(n=>e[n]!==!1).sort();return r.length>0&&(t.$active_feature_flags=r),t}var e$r=class extends n9t{constructor(t,r={}){let n=hnh(t),i={...r,maxQueueSize:r.maxQueueSize??1e4,flushInterval:r.flushInterval??5e3,host:Anh(r.host),personalApiKey:gnh(r.secretKey??r.personalApiKey)};if(super(n,i),this._memoryStorage=new JZr,this._aiCaptureRouteActive=!1,this._minimalFlagCalledEvents=!1,this.options=i,this.captureMode=aeu(),this.enableFullAiCapture=i.enableFullAiCapture===!0,this.context=this.initializeContext(),this.options.featureFlagsPollingInterval=typeof i.featureFlagsPollingInterval=="number"?Math.max(i.featureFlagsPollingInterval,unh):i.featureFlagsPollingInterval===null?null:feu,typeof i.waitUntilDebounceMs=="number"&&(this.options.waitUntilDebounceMs=Math.max(i.waitUntilDebounceMs,0)),typeof i.waitUntilMaxWaitMs=="number"&&(this.options.waitUntilMaxWaitMs=Math.max(i.waitUntilMaxWaitMs,0)),!this.disabled&&i.personalApiKey){if(i.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.');i.enableLocalEvaluation!==!1&&(this.featureFlagsPoller=new KZr({pollingInterval:this.options.featureFlagsPollingInterval,personalApiKey:i.personalApiKey,projectApiKey:n,timeout:i.requestTimeout??1e4,host:this.host,fetch:i.fetch,onError:s=>{this._events.emit("error",s)},onLoad:s=>{this._events.emit("localEvaluationFlagsLoaded",s)},onMinimalFlagCalledEvents:s=>{this._minimalFlagCalledEvents=s},customHeaders:this.getCustomHeaders(),cacheProvider:i.flagDefinitionCacheProvider,strictLocalEvaluation:i.strictLocalEvaluation,evaluationContexts:i.evaluationContexts??i.evaluationEnvironments}))}this.errorTracking=new iUe(this,i,this._logger),this.distinctIdHasSentFlagCalls={},this.maxCacheSize=i.maxCacheSize||pnh}enqueue(t,r,n,i){super.enqueue(t,r,n,i),this.scheduleDebouncedFlush()}_flushEventsAndSpans(t=!1){let r=this.flushWithPendingPromises();return!this._traces||t&&this._traces.throttled?r:WGt([r,this._traces.flush().catch(()=>{})]).then(([n])=>{if(n.status==="rejected")throw n.reason})}flushAutomatic(){return this._flushKeepingRuntimeAlive(!0)}async flush(){return this._flushKeepingRuntimeAlive(!1)}_flushKeepingRuntimeAlive(t){let r=this._flushEventsAndSpans(t),n=this.options.waitUntil;if(n&&!this._waitUntilCycle)try{n(r.catch(()=>{}))}catch{}return r}scheduleDebouncedFlush(){let t=this.options.waitUntil;if(!t||this.disabled||this.optedOut)return;if(!this._waitUntilCycle){let s,a=new Promise(c=>{s=c});try{t(a)}catch{return}this._waitUntilCycle={resolve:s,startedAt:Date.now(),timer:void 0}}let r=Date.now()-this._waitUntilCycle.startedAt,n=this.options.waitUntilMaxWaitMs??dnh,i=r>=n;if(this._waitUntilCycle.timer!==void 0&&clearTimeout(this._waitUntilCycle.timer),i)return void this.resolveWaitUntilFlush();let o=this.options.waitUntilDebounceMs??fnh;this._waitUntilCycle.timer=T2(()=>{this.resolveWaitUntilFlush()},o)}_consumeWaitUntilCycle(){let t=this._waitUntilCycle;return t&&(clearTimeout(t.timer),this._waitUntilCycle=void 0),t?.resolve}async resolveWaitUntilFlush(){let t=this._consumeWaitUntilCycle();try{await this._flushEventsAndSpans()}catch{}finally{t?.()}}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):fetch(t,r)}getQueueRouteKey(t){return this.captureMode==="v1"&&ceu(t)?"ai":b9t}persistedQueueKeyForRoute(t){return t===oUe?vQ.AiCaptureQueue:t==="ai"?vQ.AiQueue:vQ.Queue}getActiveQueueRoutes(){let t=this.captureMode==="v1"?[b9t,"ai"]:[b9t];return this._aiCaptureRouteActive&&t.push(oUe),t}getBatchEndpointPath(t){return t===oUe?XZr:super.getBatchEndpointPath(t)}async sendBatch(t,r,n=b9t){if(n===oUe)return this.sendAiCaptureBatch(t,r);if(this.captureMode!=="v1"||n==="ai")return super.sendBatch(t,r,n);let i=t.filter(o=>o!==void 0);await this.getV1Sender().sendV1Batch(i)}async sendAiCaptureBatch(t,r){let{batches:n,dropped:i}=peu(t);for(let{event:o,bytes:s}of i){let a=`Event ${o} (${s} bytes) exceeds the ${8388608/1048576}MiB limit for ${XZr}, dropping.`;this._logger.error(a),this._events.emit("error",new Error(a))}for(let o of n)await this.sendAiSubBatch(o,r)}async sendAiSubBatch(t,r){try{await super.sendBatch(t,r,oUe)}catch(n){if(!nlt(n))throw n;if(t.length===1){let[o]=t,a=`Event ${typeof o.event=="string"?o.event:"unknown"} (${$qo(o)} bytes) was rejected with 413 by ${XZr} on its own, dropping.`;this._logger.error(a),this._events.emit("error",new Error(a));return}let i=Math.ceil(t.length/2);await this.sendAiSubBatch(t.slice(0,i),r),await this.sendAiSubBatch(t.slice(i),r)}}getV1Sender(){return this._v1Sender||(this._v1Sender=new YZr({host:this.host,apiKey:this.apiKey,libraryId:this.getLibraryId(),libraryVersion:this.getLibraryVersion(),userAgent:this.getCustomUserAgent()||void 0,historicalMigration:this.historicalMigration,compressionEnabled:!this.disableCompression,requestTimeoutMs:this.requestTimeout,maxAttempts:(this.options.fetchRetryCount??3)+1,initialRetryDelayMs:this.options.fetchRetryDelay??3e3,isDebug:this.isDebug},{fetch:(t,r)=>this.fetch(t,r),onError:t=>this._events.emit("error",t),compress:t=>this.compressPayload(t)})),this._v1Sender}getLibraryVersion(){return X$l}get metrics(){return this._metrics||(this._metrics=new f9t(this,NZr(this.options.metrics),this._logger)),this._metrics}initializeSpanContextManager(){return new A9t}hostResourceAttributes(){return{}}get _spanContextManager(){return this._spanContext||(this._spanContext=this.initializeSpanContextManager()),this._spanContext}get _tracesPipeline(){if(this.options.traces)return this._traces||(this._traces=new g9t(this,qqo(this.options.traces,this.hostResourceAttributes(),this._logger),this._logger,()=>this._tracingContext(),this._spanContextManager,()=>this.scheduleDebouncedFlush())),this._traces}_tracingContext(){let t=this.context?.get();return{distinctId:t?.distinctId,sessionId:t?.sessionId}}startSpan(t,r){return this._tracesPipeline?.startSpan(t,r)??ISe(r,this._spanContextManager.active())}withSpan(t,r,n){let i=typeof r=="function"?void 0:r,o=typeof r=="function"?r:n,s=this._tracesPipeline;return s?i?s.withSpan(t,i,o):s.withSpan(t,o):h9t(this._spanContextManager,ISe(i,this._spanContextManager.active()),o)}getActiveSpan(){return this._spanContextManager.active()??null}getCustomUserAgent(){return`${this.getLibraryId()}/${this.getLibraryVersion()}`}getEvaluationRuntime(){return"server"}getCommonEventProperties(){let t=super.getCommonEventProperties();return(this.options.isServer??!0)&&(t.$is_server=!0),t}enable(){return super.optIn()}disable(){return super.optOut()}debug(t=!0){super.debug(t),this.featureFlagsPoller?.debug(t)}_warnIfInvalidCapture(t,r,n){typeof t=="string"&&this._logger.warn(r),t.event==="$exception"&&!t._originatedFromCaptureException&&this._logger.warn(n)}_sendPreparedEvent(t,r,n,i,o){return this.addPendingPromise(this._prepareEventMessage(r,i).then(({distinctId:s,event:a,properties:c,options:l})=>{let u={timestamp:l.timestamp,disableGeoip:l.disableGeoip,uuid:l.uuid},p={distinctId:s,event:a,properties:{...c,...this.getCommonEventProperties()}};return n?this.sendImmediate(t,p,u,o):this.enqueue(t,p,u,o)}).catch(s=>{s&&console.error(s)}))}_capturePreparedEvent(t,r){return this._sendPreparedEvent("capture",t,r)}capture(t){this._warnIfInvalidCapture(t,"Called capture() with a string as the first argument when an object was expected.","Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this._capturePreparedEvent(t,!1)}async captureImmediate(t){return this._warnIfInvalidCapture(t,"Called captureImmediate() with a string as the first argument when an object was expected.","Capturing a `$exception` event via `posthog.captureImmediate('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureExceptionImmediate(error)` instead, which attaches this metadata by default."),this._capturePreparedEvent(t,!0)}captureAi(t){if(this.disabled)return;let r=eUe(t.uuid,w2);return this._sendPreparedAiEvent({...t,uuid:r},!1),r}async captureAiImmediate(t){if(this.disabled)return;let r=eUe(t.uuid,w2);return await this._sendPreparedAiEvent({...t,uuid:r},!0),r}_sendPreparedAiEvent(t,r){return typeof t?.event=="string"&&!t.event.startsWith("$ai_")&&this._logger.debug(`captureAi called with non-AI event ${t.event}; routing it to the AI endpoint anyway.`),this._aiCaptureRouteActive=!0,this._sendPreparedEvent("capture",t,r,void 0,oUe)}identify({distinctId:t,properties:r={},disableGeoip:n}){let{$set:i,$set_once:o,$anon_distinct_id:s,...a}=r,u={$set:i||a,$set_once:o||{},$anon_distinct_id:s??void 0};this._sendPreparedEvent("identify",{distinctId:t,event:"$identify",properties:u,disableGeoip:n},!1,{includeContextProperties:!1})}async identifyImmediate({distinctId:t,properties:r={},disableGeoip:n}){let{$set:i,$set_once:o,$anon_distinct_id:s,...a}=r,u={$set:i||a,$set_once:o||{},$anon_distinct_id:s??void 0};await this._sendPreparedEvent("identify",{distinctId:t,event:"$identify",properties:u,disableGeoip:n},!0,{includeContextProperties:!1})}setPersonProperties({distinctId:t,properties:r={},propertiesOnce:n={}}){if(Object.keys(r).length===0&&Object.keys(n).length===0)return;let i={};Object.keys(r).length>0&&(i.$set=r),Object.keys(n).length>0&&(i.$set_once=n),this.capture({distinctId:t,event:"$set",properties:i})}unsetPersonProperties({distinctId:t,properties:r}){let n=ynh(r);n.length!==0&&this.capture({distinctId:t,event:"$set",properties:{$unset:n}})}alias(t){this._sendPreparedEvent("alias",{distinctId:t.distinctId,event:"$create_alias",properties:{distinct_id:t.distinctId,alias:t.alias},disableGeoip:t.disableGeoip},!1,{includeContextProperties:!1})}async aliasImmediate(t){await this._sendPreparedEvent("alias",{distinctId:t.distinctId,event:"$create_alias",properties:{distinct_id:t.distinctId,alias:t.alias},disableGeoip:t.disableGeoip},!0,{includeContextProperties:!1})}isLocalEvaluationReady(){return this.featureFlagsPoller?.isLocalEvaluationReady()??!1}getFeatureFlagEvaluationRuntime(t){return this.featureFlagsPoller?.getEvaluationRuntimeForFlag(t)}getFeatureFlagKeysByEvaluationRuntime(t){return this.featureFlagsPoller?.getFlagKeysByEvaluationRuntime(t)??[]}async waitForLocalEvaluationReady(t=feu){return this.isLocalEvaluationReady()?!0:this.featureFlagsPoller===void 0?!1:new Promise(r=>{let n=setTimeout(()=>{i(),r(!1)},t),i=this._events.on("localEvaluationFlagsLoaded",o=>{clearTimeout(n),i(),r(o>0)})})}_resolveDistinctId(t,r){return typeof t=="string"?{distinctId:t,options:r}:{distinctId:this.context?.get()?.distinctId,options:t}}async _getFeatureFlagResult(t,r,n={},i){if(this.disabled)return void this._logger.warn("The client is disabled");let o=n.sendFeatureFlagEvents??!0;if(this._flagOverrides!==void 0&&t in this._flagOverrides){let D=this._flagOverrides[t];if(D===void 0)return;let R=this._payloadOverrides?.[t];return{key:t,enabled:D!==!1,variant:typeof D=="string"?D:void 0,payload:R}}let{groups:s,disableGeoip:a}=n,{onlyEvaluateLocally:c,personProperties:l,groupProperties:u}=n,p=this.addLocalPersonAndGroupProperties(r,s,l,u);l=p.allPersonProperties,u=p.allGroupProperties;let d=this.createFeatureFlagEvaluationContext(r,s,this.personPropertiesForLocalEvaluation(r,l),u);c==null&&(c=this.options.strictLocalEvaluation??!1);let f,m=!1,g,A,y,I,C,x,S;if(this.featureFlagsPoller!==void 0){await this.featureFlagsPoller?.loadFeatureFlags();let D=this.featureFlagsPoller?.featureFlagsByKey[t];if(D)try{let R=await this.featureFlagsPoller?.computeFlagAndPayloadLocally(D,d,{matchValue:i});if(R){m=!0;let O=R.value;I=D.id,x="Evaluated locally",S=D.has_experiment,f={key:t,enabled:O!==!1,variant:typeof O=="string"?O:void 0,payload:R.payload??void 0,reason:x,reasonCode:D.active===!1?"flag_disabled":void 0}}}catch(R){if(R instanceof qte||R instanceof Ml)this._logger?.info(`${R.name} when computing flag locally: ${t}: ${R.message}`);else throw R}}if(!m&&!c){let D=await super.getFeatureFlagDetailsStateless(d.distinctId,d.groups,l,u,a,[t]);if(D===void 0)y=hme.UNKNOWN_ERROR;else{this._minimalFlagCalledEvents=D.minimalFlagCalledEvents===!0,g=D.requestId,A=D.evaluatedAt;let R=[];D.errorsWhileComputingFlags&&R.push(hme.ERRORS_WHILE_COMPUTING),D.quotaLimited?.includes("feature_flags")&&R.push(hme.QUOTA_LIMITED);let O=D.flags[t];if(O===void 0)R.push(hme.FLAG_MISSING);else{I=O.metadata?.id,C=O.metadata?.version,x=O.reason?.description??O.reason?.code,S=O.metadata?.has_experiment;let z;if(O.metadata?.payload!==void 0)try{z=JSON.parse(O.metadata.payload)}catch{z=O.metadata.payload}f={key:t,enabled:O.enabled,variant:O.variant??void 0,payload:z,reason:x,reasonCode:O.reason?.code}}R.length>0&&(y=R.join(","))}}if(o){let D=f===void 0?void 0:f.enabled===!1?!1:f.variant??!0,R={$feature_flag:t,$feature_flag_response:D,$feature_flag_id:I,$feature_flag_version:C,$feature_flag_reason:x,locally_evaluated:m,[`$feature/${t}`]:D,$feature_flag_request_id:g,$feature_flag_evaluated_at:m?Date.now():A};if(S!==void 0&&(R.$feature_flag_has_experiment=S),m&&this.featureFlagsPoller){let O=this.featureFlagsPoller.getFlagDefinitionsLoadedAt();O!==void 0&&(R.$feature_flag_definitions_loaded_at=O)}y&&(R.$feature_flag_error=y),this._captureFlagCalledEventIfNeeded({distinctId:r,key:t,response:D,groups:s,disableGeoip:a,properties:R})}return f!==void 0&&this._payloadOverrides!==void 0&&t in this._payloadOverrides&&(f={...f,payload:this._payloadOverrides[t]}),f}async getFeatureFlag(t,r,n){$Zr("getFeatureFlag","`getFeatureFlag` is deprecated and will be removed in a future major version. Use `posthog.evaluateFlags(distinctId, ...)` and call `flags.getFlag(key)` instead \u2014 this consolidates flag evaluation into a single `/flags` request per incoming request.");let i=await this._getFeatureFlagResult(t,r,{...n,sendFeatureFlagEvents:n?.sendFeatureFlagEvents??this.options.sendFeatureFlagEvent??!0});if(i!==void 0)return i.enabled===!1?!1:i.variant??!0}async getFeatureFlagPayload(t,r,n,i){if($Zr("getFeatureFlagPayload","`getFeatureFlagPayload` is deprecated and will be removed in a future major version. Use `posthog.evaluateFlags(distinctId, ...)` and call `flags.getFlagPayload(key)` instead \u2014 this consolidates flag evaluation into a single `/flags` request per incoming request."),this._payloadOverrides!==void 0&&t in this._payloadOverrides)return this._payloadOverrides[t];let o=await this._getFeatureFlagResult(t,r,{...i,sendFeatureFlagEvents:!1},n);if(o!==void 0)return o.payload??null}async getFeatureFlagResult(t,r,n){let{distinctId:i,options:o}=this._resolveDistinctId(r,n);return i?this._getFeatureFlagResult(t,i,{...o,sendFeatureFlagEvents:o?.sendFeatureFlagEvents??this.options.sendFeatureFlagEvent??!0}):void this._logger.warn("[PostHog] distinctId is required \u2014 pass it explicitly or use withContext()")}async getRemoteConfigPayload(t){if(this.disabled)return void this._logger.warn("The client is disabled");if(!this.options.personalApiKey)throw new Error("Personal API key is required for remote config payload decryption");let r=await this._requestRemoteConfigPayload(t);if(!r)return;let n=await r.json();if(typeof n=="string")try{return JSON.parse(n)}catch{}return n}async isFeatureEnabled(t,r,n){$Zr("isFeatureEnabled","`isFeatureEnabled` is deprecated and will be removed in a future major version. Use `posthog.evaluateFlags(distinctId, ...)` and call `flags.isEnabled(key)` instead \u2014 this consolidates flag evaluation into a single `/flags` request per incoming request.");let i=await this._getFeatureFlagResult(t,r,{...n,sendFeatureFlagEvents:n?.sendFeatureFlagEvents??this.options.sendFeatureFlagEvent??!0});return i===void 0?void 0:i.enabled===!1?!1:!!(i.variant??!0)||!1}async getAllFlags(t,r){let{distinctId:n,options:i}=this._resolveDistinctId(t,r);return n?(await this.getAllFlagsAndPayloads(n,i)).featureFlags||{}:(this._logger.warn("[PostHog] distinctId is required to get feature flags \u2014 pass it explicitly or use withContext()"),{})}async getAllFlagsAndPayloads(t,r){let{distinctId:n,options:i}=this._resolveDistinctId(t,r);if(!n)return this._logger.warn("[PostHog] distinctId is required to get feature flags and payloads \u2014 pass it explicitly or use withContext()"),{featureFlags:{},featureFlagPayloads:{}};if(this.disabled)return this._logger.warn("The client is disabled"),{featureFlags:{},featureFlagPayloads:{}};let{groups:o,disableGeoip:s,flagKeys:a}=i||{},{onlyEvaluateLocally:c,personProperties:l,groupProperties:u}=i||{},p=this.addLocalPersonAndGroupProperties(n,o,l,u);l=p.allPersonProperties,u=p.allGroupProperties;let d=this.createFeatureFlagEvaluationContext(n,o,this.personPropertiesForLocalEvaluation(n,l),u);c==null&&(c=this.options.strictLocalEvaluation??!1);let f=await this.featureFlagsPoller?.getAllFlagsAndPayloads(d,a),m={},g={},A=!0;if(f&&(m=f.response,g=f.payloads,A=f.fallbackToFlags),A&&!c){let y=await super.getFeatureFlagsAndPayloadsStateless(d.distinctId,d.groups,l,u,s,a);m={...m,...y.flags||{}},g={...g,...y.payloads||{}}}return this._flagOverrides!==void 0&&(m={...m,...this._flagOverrides}),this._payloadOverrides!==void 0&&(g={...g,...this._payloadOverrides}),{featureFlags:m,featureFlagPayloads:g}}async evaluateFlags(t,r){let{distinctId:n,options:i}=this._resolveDistinctId(t,r);if(!n)return this._logger.warn("[PostHog] distinctId is required to evaluate feature flags \u2014 pass it explicitly or use withContext()"),new CSe({host:this._getFeatureFlagEvaluationsHost(),distinctId:"",flags:{}});if(this.disabled)return this._logger.warn("The client is disabled"),new CSe({host:this._getFeatureFlagEvaluationsHost(),distinctId:n,flags:{}});let{groups:o,disableGeoip:s}=i||{},a=i?.flagKeys??void 0;if(a?.length===0)return new CSe({host:this._getFeatureFlagEvaluationsHost(),distinctId:n,groups:o,disableGeoip:s,flags:{}});let{onlyEvaluateLocally:c,personProperties:l,groupProperties:u}=i||{},p=this.addLocalPersonAndGroupProperties(n,o,l,u);l=p.allPersonProperties,u=p.allGroupProperties;let d=this.createFeatureFlagEvaluationContext(n,o,this.personPropertiesForLocalEvaluation(n,l),u);c==null&&(c=this.options.strictLocalEvaluation??!1);let f=a?new Set(a):void 0,m={},g,A,y=!1,I=!1,C=await this.featureFlagsPoller?.getAllFlagsAndPayloads(d,a),x=new Set;if(C)for(let[D,R]of Object.entries(C.response)){let O=this.featureFlagsPoller?.featureFlagsByKey[D];m[D]={key:D,enabled:R!==!1,variant:typeof R=="string"?R:void 0,payload:C.payloads[D],id:O?.id,version:void 0,reason:"Evaluated locally",locallyEvaluated:!0,hasExperiment:O?.has_experiment},x.add(D)}let S=f!==void 0&&Array.from(f).some(D=>this.featureFlagsPoller?.featureFlagsByKey[D]===void 0);if((C?C.fallbackToFlags||S:!0)&&!c){let D=await super.getFeatureFlagDetailsStateless(d.distinctId,d.groups,l,u,s,a);if(D){this._minimalFlagCalledEvents=D.minimalFlagCalledEvents===!0,g=D.requestId,A=D.evaluatedAt,y=!!D.errorsWhileComputingFlags,I=Array.isArray(D.quotaLimited)&&D.quotaLimited.includes("feature_flags");for(let[R,O]of Object.entries(D.flags)){if(x.has(R))continue;let z;if(O.metadata?.payload!==void 0)try{z=JSON.parse(O.metadata.payload)}catch{z=O.metadata.payload}m[R]={key:R,enabled:O.enabled,variant:O.variant,payload:z,id:O.metadata?.id,version:O.metadata?.version,reason:O.reason?.description??O.reason?.code,locallyEvaluated:!1,hasExperiment:O.metadata?.has_experiment}}}}if(this._flagOverrides!==void 0)for(let[D,R]of Object.entries(this._flagOverrides)){if(R===void 0){delete m[D];continue}let O=m[D];m[D]={key:D,enabled:R!==!1,variant:typeof R=="string"?R:void 0,payload:O?.payload,id:O?.id,version:O?.version,reason:O?.reason,locallyEvaluated:O?.locallyEvaluated??!1,hasExperiment:O?.hasExperiment}}if(this._payloadOverrides!==void 0)for(let[D,R]of Object.entries(this._payloadOverrides)){let O=m[D];O&&(m[D]={...O,payload:R})}if(f!==void 0)for(let D of Object.keys(m))f.has(D)||delete m[D];return new CSe({host:this._getFeatureFlagEvaluationsHost(),distinctId:n,groups:o,disableGeoip:s,flags:m,requestId:g,evaluatedAt:A,flagDefinitionsLoadedAt:this.featureFlagsPoller?.getFlagDefinitionsLoadedAt(),errorsWhileComputing:y,quotaLimited:I})}_shouldSendMinimalFlagCalledEvent(t,r){return t==="$feature_flag_called"&&this._minimalFlagCalledEvents&&r.$feature_flag_has_experiment===!1}_captureFlagCalledEventIfNeeded(t){let{distinctId:r,key:n,response:i,groups:o,disableGeoip:s,properties:a}=t,c=o&&Object.keys(o).length>0?`_${JSON.stringify(Object.entries(o).sort(([u],[p])=>u<p?-1:u>p?1:0))}`:"",l=`${n}_${i}${c}`;r in this.distinctIdHasSentFlagCalls&&this.distinctIdHasSentFlagCalls[r].has(l)||(Object.keys(this.distinctIdHasSentFlagCalls).length>=this.maxCacheSize&&(this.distinctIdHasSentFlagCalls={}),this.distinctIdHasSentFlagCalls[r]instanceof Set?this.distinctIdHasSentFlagCalls[r].add(l):this.distinctIdHasSentFlagCalls[r]=new Set([l]),this.capture({distinctId:r,event:"$feature_flag_called",properties:a,groups:o,disableGeoip:s}))}_getFeatureFlagEvaluationsHost(){return this._featureFlagEvaluationsHost||(this._featureFlagEvaluationsHost={captureFlagCalledEventIfNeeded:t=>this._captureFlagCalledEventIfNeeded(t),logWarning:t=>{this.options.featureFlagsLogWarnings!==!1&&console.warn(`[PostHog] ${t}`)}}),this._featureFlagEvaluationsHost}groupIdentify({groupType:t,groupKey:r,properties:n,distinctId:i,disableGeoip:o}){this._sendPreparedEvent("capture",{distinctId:i||`$${t}_${r}`,event:"$groupidentify",properties:{$group_type:t,$group_key:r,$group_set:n||{}},disableGeoip:o},!1,{includeContextProperties:!1})}async groupIdentifyImmediate({groupType:t,groupKey:r,properties:n,distinctId:i,disableGeoip:o}){await this._sendPreparedEvent("capture",{distinctId:i||`$${t}_${r}`,event:"$groupidentify",properties:{$group_type:t,$group_key:r,$group_set:n||{}},disableGeoip:o},!0,{includeContextProperties:!1})}async reloadFeatureFlags(){await this.featureFlagsPoller?.loadFeatureFlags(!0)}overrideFeatureFlags(t){let r=n=>Object.fromEntries(n.map(i=>[i,!0]));if(t===!1){this._flagOverrides=void 0,this._payloadOverrides=void 0;return}if(Array.isArray(t)){this._flagOverrides=r(t);return}if(this._isFeatureFlagOverrideOptions(t)){"flags"in t&&(t.flags===!1?this._flagOverrides=void 0:Array.isArray(t.flags)?this._flagOverrides=r(t.flags):t.flags!==void 0&&(this._flagOverrides={...t.flags})),"payloads"in t&&(t.payloads===!1?this._payloadOverrides=void 0:t.payloads!==void 0&&(this._payloadOverrides={...t.payloads}));return}this._flagOverrides={...t}}_isFeatureFlagOverrideOptions(t){if(typeof t!="object"||t===null||Array.isArray(t))return!1;let r=t;if("flags"in r){let n=r.flags;if(n===!1||Array.isArray(n)||typeof n=="object"&&n!==null)return!0}if("payloads"in r){let n=r.payloads;if(n===!1||typeof n=="object"&&n!==null)return!0}return!1}withContext(t,r,n){return this.context?this.context.run(t,r,n):r()}getContext(){return this.context?.get()}enterContext(t,r){this.context?.enter(t,r)}async _shutdown(t){let r=Date.now()+(t??3e4),n=this._consumeWaitUntilCycle();await this.featureFlagsPoller?.stopPoller(t),this.errorTracking.shutdown(),this._metrics&&(await ESe(this._metrics.flush().catch(()=>{}),Math.max(0,r-Date.now())),this._metrics.reset()),this._traces&&(await ESe(this._traces.flush().catch(()=>{}),Math.max(0,r-Date.now())),this._traces.reset());try{return await super._shutdown(Math.max(0,r-Date.now()))}finally{this.distinctIdHasSentFlagCalls={},n?.()}}async _requestRemoteConfigPayload(t){if(this.disabled||!this.apiKey||!this.options.personalApiKey)return;let r=`${this.host}/api/projects/@current/feature_flags/${t}/remote_config?token=${encodeURIComponent(this.apiKey)}`,n={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",Authorization:`Bearer ${this.options.personalApiKey}`}},i=null;if(this.options.requestTimeout&&typeof this.options.requestTimeout=="number"){let o=new AbortController;i=T2(()=>{o.abort()},this.options.requestTimeout),n.signal=o.signal}try{return await this.fetch(r,n)}catch(o){this._events.emit("error",o);return}finally{i&&clearTimeout(i)}}extractPropertiesFromEvent(t,r){if(!t)return{personProperties:{},groupProperties:{}};let n={},i={};for(let[o,s]of Object.entries(t))if(mZl(s)&&r&&o in r){let a={};for(let[c,l]of Object.entries(s))a[String(c)]=String(l);i[String(o)]=a}else n[String(o)]=String(s);return{personProperties:n,groupProperties:i}}async getFeatureFlagsForEvent(t,r,n,i){if(this.disabled||!this.apiKey)return void this._logger.warn("The client is disabled");let o=i?.personProperties||{},s=i?.groupProperties||{},a=i?.flagKeys;if(i?.onlyEvaluateLocally??this.options.strictLocalEvaluation??!1)if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let l={};for(let[u,p]of Object.entries(r||{}))l[u]=String(p);return await this.getAllFlags(t,{groups:l,personProperties:o,groupProperties:s,disableGeoip:n,onlyEvaluateLocally:!0,flagKeys:a})}else return{};if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let l={};for(let[u,p]of Object.entries(r||{}))l[u]=String(p);return await this.getAllFlags(t,{groups:l,personProperties:o,groupProperties:s,disableGeoip:n,onlyEvaluateLocally:!0,flagKeys:a})}return(await super.getFeatureFlagsStateless(t,r,o,s,n)).flags}addLocalPersonAndGroupProperties(t,r,n,i){let o={...n||{}},s={};if(r)for(let a of Object.keys(r))s[a]={$group_key:r[a],...i?.[a]||{}};return{allPersonProperties:o,allGroupProperties:s}}personPropertiesForLocalEvaluation(t,r){return{distinct_id:t,...r||{}}}createFeatureFlagEvaluationContext(t,r,n,i){return{distinctId:t,groups:r||{},personProperties:n||{},groupProperties:i||{},evaluationCache:{}}}captureException(t,r,n,i,o){if(!iUe.isPreviouslyCapturedError(t)){let s=new Error("PostHog syntheticException");this.addPendingPromise(iUe.buildEventMessage(this.getErrorPropertiesBuilder(),t,{syntheticException:s},r,n).then(a=>this._capturePreparedEvent({...a,uuid:i,flags:o},!1)))}}async captureExceptionImmediate(t,r,n,i){if(!iUe.isPreviouslyCapturedError(t)){let o=new Error("PostHog syntheticException");return this.addPendingPromise(iUe.buildEventMessage(this.getErrorPropertiesBuilder(),t,{syntheticException:o},r,n).then(s=>this.captureImmediate({...s,flags:i})))}}async prepareEventMessage(t){return this._prepareEventMessage(t)}async _prepareEventMessage(t,r={}){let{distinctId:n,event:i,properties:o,groups:s,flags:a,sendFeatureFlags:c,timestamp:l,disableGeoip:u,uuid:p}=t,d=this.context?.get(),f=r.includeContextProperties??!0,m=n||d?.distinctId,g=f?{...this.props,...d?.properties||{},...o||{}}:{...o||{}};m||(m=w2(),g.$process_person_profile=!1),f&&d?.sessionId&&!g.$session_id&&(g.$session_id=d.sessionId);let A=this._shouldSendMinimalFlagCalledEvent(i,g)?e9t(g):g,y=this._runBeforeSend({distinctId:m,event:i,properties:A,groups:s,flags:a,sendFeatureFlags:c,timestamp:l,disableGeoip:u,uuid:p});if(!y)return Promise.reject(null);let I=await Promise.resolve().then(async()=>{if(a)return c&&console.warn("[PostHog] Both `flags` and `sendFeatureFlags` were passed to capture(); using `flags` and ignoring `sendFeatureFlags`."),a._getEventProperties();if(c){$Zr("sendFeatureFlags","`sendFeatureFlags` is deprecated and will be removed in a future major version. Pass a `flags` snapshot from `posthog.evaluateFlags(...)` instead \u2014 it avoids a second `/flags` request per capture and guarantees the event carries the exact flag values your code branched on.");let C=typeof c=="object"?c:void 0,x=await this.getFeatureFlagsForEvent(y.distinctId,s,u,C);return bnh(x)}return{}}).catch(()=>({})).then(C=>{let x=y.groups||s;return{...C,...y.properties||{},...x!==void 0&&Object.keys(x).length>0?{$groups:x}:{}}});return y.event==="$pageview"&&this.options.__preview_capture_bot_pageviews&&typeof I.$raw_user_agent=="string"&&gZl(I.$raw_user_agent,this.options.custom_blocked_useragents||[])&&(y.event="$bot_pageview",I.$browser_type="bot"),{distinctId:y.distinctId,event:y.event,properties:I,options:{timestamp:y.timestamp,disableGeoip:y.disableGeoip,uuid:y.uuid}}}_runBeforeSend(t){let r=this.options.before_send;if(!r)return t;let n=Array.isArray(r)?r:[r],i=t;for(let o of n)try{if(i=o(i),!i)return this._logger.info(`Event '${t.event}' was rejected in beforeSend function`),null;if(!i.properties||Object.keys(i.properties).length===0){let s=`Event '${i.event}' has no properties after beforeSend function, this is likely an error.`;this._logger.warn(s)}}catch(s){return this._logger.error(`Error in before_send function for event '${t.event}':`,s),null}return i}};var meu=require("async_hooks"),t$r=class{constructor(){this.storage=new meu.AsyncLocalStorage}get(){return this.storage.getStore()}run(t,r,n){return this.storage.run(this.resolve(t,n),r)}enter(t,r){this.storage.enterWith(this.resolve(t,r))}resolve(t,r){if(r?.fresh===!0)return t;let n=this.get()||{};return{distinctId:t.distinctId??n.distinctId,sessionId:t.sessionId??n.sessionId,properties:{...n.properties||{},...t.properties||{}}}}};var heu=require("async_hooks"),r$r=class{active(){return this._storage.getStore()}with(t,r){return this._storage.run(t,r)}constructor(){this._storage=new heu.AsyncLocalStorage}};var geu=require("zlib"),Aeu=require("util"),Enh=(0,Aeu.promisify)(geu.gzip);async function yeu(e,t=!0){try{let r=await Enh(e);return new Uint8Array(r)}catch(r){return t&&console.error("Failed to gzip compress data",r),null}}var n$r=require("os");function beu(){let e,t;try{e=(0,n$r.platform)(),t=(0,n$r.release)()}catch{}return Fqo(e,t)}var Eeu="posthog-node";function Inh(e,{organization:t,projectId:r,prefix:n,severityAllowList:i=["error"],sendExceptionsToPostHog:o=!0}={}){return s=>{if(!(i==="*"||i.includes(s.level)))return s;s.tags||(s.tags={});let c=s.tags[eWo.POSTHOG_ID_TAG];if(c===void 0)return s;let l=e.options.host??"https://us.i.posthog.com",u=new URL(`/project/${e.apiKey}/person/${c}`,l).toString();s.tags["PostHog Person URL"]=u;let p=s.exception?.values||[],d=p.map(g=>({...g,stacktrace:g.stacktrace?{...g.stacktrace,type:"raw",frames:(g.stacktrace.frames||[]).map(A=>({...A,platform:"node:javascript"}))}:void 0})),f={$exception_message:p[0]?.value||s.message,$exception_type:p[0]?.type,$exception_level:s.level,$exception_list:d,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:p[0]?.value||s.message,$sentry_exception_type:p[0]?.type,$sentry_tags:s.tags},m=mT.getInjectedReleaseId();return m&&(f.$release_id=m),t&&r&&(f.$sentry_url=(n||"https://sentry.io/organizations/")+t+"/issues/?project="+r+"&query="+s.event_id),o&&e.capture({event:"$exception",distinctId:c,properties:f}),s}}var eWo=class{static{this.POSTHOG_ID_TAG="posthog_distinct_id"}constructor(t,r,n,i,o){this.name=Eeu,this.name=Eeu,this.setupOnce=function(s,a){let c=a()?.getClient()?.getDsn()?.projectId;s(Inh(t,{organization:r,projectId:c,prefix:n,severityAllowList:i,sendExceptionsToPostHog:o??!0}))}}};var Wte=class extends e$r{getLibraryId(){return"posthog-node"}compressPayload(t){return yeu(t,this.isDebug)}initializeContext(){return new t$r}initializeSpanContextManager(){return new r$r}hostResourceAttributes(){return beu()}createErrorPropertiesBuilder(){return new mT.ErrorPropertiesBuilder([new mT.EventCoercer,new mT.ErrorCoercer,new mT.ObjectCoercer,new mT.StringCoercer,new mT.PrimitiveCoercer],mT.createStackParser("node:javascript",mT.nodeStackLineParser),[lZl(),t=>W$l(t,void 0,this._logger),Y$l()])}};function Ieu(e){return e==null||!e.enabled?!1:e.variant==null||e.variant==="true"}var i$r=class{isEnabled(){return Promise.resolve(!1)}getCachedValue(){}flush(){return Promise.resolve()}},vnh="feature_flag_evaluated",Cnh=3e3,xnh=3e3,o$r=class{evaluator;environment;sendFeatureFlagEvents;pending=new Map;resolved=new Map;constructor({environment:t,sendFeatureFlagEvents:r,posthogApiKey:n,evaluator:i}){this.environment=t,this.sendFeatureFlagEvents=r,this.evaluator=i??new Wte(n??"",{featureFlagsRequestTimeoutMs:Cnh,isServer:!1})}isEnabled(t,r){let n=veu(t,r),i=this.pending.get(n);if(i!=null)return i;let o=this.evaluateAndRemember(t,r,n);return this.pending.set(n,o),o}async evaluateAndRemember(t,r,n){let i=await this.evaluate(t,r);return this.resolved.set(n,i),i}getCachedValue(t,r){return this.resolved.get(veu(t,r))}async flush(){if(!this.sendFeatureFlagEvents)return;let t;try{await Promise.race([this.flushAfterPendingEvaluations(),new Promise(r=>{t=setTimeout(r,xnh),t.unref()})])}catch{}finally{clearTimeout(t)}}async flushAfterPendingEvaluations(){await Promise.allSettled(this.pending.values()),await this.evaluator.flush()}async evaluate(t,r){let{org:n}=r,i=wnh(r,this.environment),o;try{o=await this.evaluator.getFeatureFlagResult(t,tWo(n),{personProperties:i,groups:{organization:n},groupProperties:{organization:i},sendFeatureFlagEvents:!1})}catch{return!1}return this.sendFeatureFlagEvents&&this.captureFlagUsage({flag:t,org:n,result:o,properties:i}),Ieu(o)}captureFlagUsage({flag:t,org:r,result:n,properties:i}){let o=Snh(n),s={...i,...n?.reason!=null?{$feature_flag_reason:n.reason}:{},version:"5.197.0"};this.tryCapture({distinctId:tWo(r),event:"$feature_flag_called",groups:{organization:r},properties:{...s,$feature_flag:t,$feature_flag_response:o,[`$feature/${t}`]:o}}),this.tryCapture({distinctId:tWo(r),event:vnh,groups:{organization:r},properties:{...s,flag:t,response:o,enabled:Ieu(n)}})}tryCapture(t){try{this.evaluator.capture(t)}catch{}}};function Snh(e){if(e!=null)return e.enabled?e.variant??!0:!1}function tWo(e){return`org:${e}`}function wnh({org:e,generator:t,language:r},n){return{org:e,environment:n,...t!=null?{generator:t}:{},...r!=null?{language:r}:{}}}function veu(e,{org:t,generator:r,language:n}){return JSON.stringify([e,t,r??null,n??null])}var s$r;function a$r(){return s$r==null&&(s$r=Tnh()),s$r}async function rWo(){await s$r?.flush()}function Tnh(){let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal";return e==null||e.trim().length===0?new i$r:new o$r({posthogApiKey:e,environment:wK(),sendFeatureFlagEvents:lZr()})}var c$r=class{posthog;constructor({posthogApiKey:t}){this.posthog=new Wte(t,{isServer:!1})}async identify(){}async sendEvent(t){t.orgId!=null&&this.posthog.capture({distinctId:t.orgId,event:"CLI",properties:{...t,...t.properties,version:"5.197.0",usingAccessToken:!0,cliReleaseEnvironment:wK(),...Tpe()}})}sendAutomationEvent(t){this.posthog.capture({distinctId:t.distinctId,event:t.event,properties:{...t.properties,cliReleaseEnvironment:wK()}})}async flush(){try{await Promise.race([this.posthog.flush(),new Promise(t=>setTimeout(t,3e3))])}catch{}}};var E9t=class{async sendEvent(){}async sendAutomationEvent(){}async identify(){}async flush(){}};ef();tr();var llt=require("fs/promises"),Ceu=require("os"),xeu=require("path");r_e();var Onh="id",Pnh=".fern",I9t=class{posthog;userId;token;constructor({token:t,posthogApiKey:r}){this.posthog=new Wte(r,{isServer:!1}),this.userId=t==null?void 0:Hqi(t),this.token=t}async identify(){this.userId!=null&&this.posthog.alias({distinctId:this.userId,alias:await this.getPersistedDistinctId()})}async sendEvent(t){let r=await this.getUserEmail();this.posthog.capture({distinctId:this.userId??await this.getPersistedDistinctId(),event:"CLI",properties:{version:"5.197.0",...t,...t.properties,usingAccessToken:!1,cliReleaseEnvironment:wK(),agent:Dcr(),...r!=null?{userEmail:r}:{},...Tpe()}})}sendAutomationEvent(t){this.posthog.capture({distinctId:t.distinctId,event:t.event,properties:{...t.properties,cliReleaseEnvironment:wK()}})}async flush(){try{await Promise.race([this.posthog.flush(),new Promise(t=>setTimeout(t,3e3))])}catch{}}userEmail;async getUserEmail(){if(this.userEmail!==null){if(this.userEmail!=null)return this.userEmail;if(this.token==null){this.userEmail=null;return}try{let t=await kl({token:this.token.value}).user.getMyself();if(t.ok&&t.body.email!=null)return this.userEmail=t.body.email,this.userEmail}catch{}this.userEmail=null}}persistedDistinctId;async getPersistedDistinctId(){if(this.persistedDistinctId==null){let t=uw(),r=Re(Zt.of((0,Ceu.homedir)()),be.of(Pnh),be.of(Onh));try{await Ut(r)?this.persistedDistinctId=(await(0,llt.readFile)(r)).toString():(await(0,llt.mkdir)((0,xeu.dirname)(r),{recursive:!0}),await(0,llt.writeFile)(r,t),this.persistedDistinctId=t)}catch{this.persistedDistinctId=t}}return this.persistedDistinctId}};var nWo;async function v9t(){return nWo==null&&(nWo=await Bnh()),nWo}async function Bnh(){try{let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal";if(e==null||!lZr())return new E9t;let t=await CYe();return t!=null?new I9t({token:t,posthogApiKey:e}):await oz()!=null?new c$r({posthogApiKey:e}):new I9t({token:void 0,posthogApiKey:e})}catch{return new E9t}}cn();It();Dt();cQ();var C9t=Ae(require("process"),1);P7e();var Teu=Ae(n6o(),1),Oeu=Ae(weu(),1);function hT(e,t={}){if(typeof e!="string"||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=QW(e),e.length===0))return 0;e=e.replace((0,Oeu.default)()," ");let r=t.ambiguousIsNarrow?1:2,n=0;for(let i of e){let o=i.codePointAt(0);if(o<=31||o>=127&&o<=159||o>=768&&o<=879)continue;switch(Teu.default.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}cn();function l$r(e){let t=0;for(let r of e.split(`
|
|
3474
|
+
at ${r.filename}:${n}:${i}`}};var rth=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,JGt=class{match(t){return typeof t=="string"}coerce(t,r){let[n,i]=this.getInfos(t);return{type:n??"Error",value:i??t,stack:r.syntheticException?.stack,synthetic:!0}}getInfos(t){let r="Error",n=t,i=t.match(rth);return i&&(r=i[1],n=i[2]),[r,n]}};var ZZl=["fatal","error","warning","log","info","debug"];function wZr(e,t=40){let r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(let n=r.length;n>0;n--){let i=r.slice(0,n).join(", ");if(!(i.length>t))return n===r.length||i.length<=t?i:`${i.slice(0,t)}...`}return""}var YGt=class{match(t){return typeof t=="object"&&t!==null}coerce(t,r){let n=this.getErrorPropertyFromObject(t);return n?r.apply(n):{type:this.getType(t),value:this.getValue(t),stack:this.getStack(t)??r.syntheticException?.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(Zct(t))return t.constructor.name;let r="name"in t?t.name:void 0;return iR(r)&&!X9o(r)?r:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){let i=`'${t.name}' captured as exception`;return"message"in t&&typeof t.message=="string"&&(i+=` with message: '${t.message}'`),i}if("message"in t&&typeof t.message=="string")return t.message;let r=this.getObjectClassName(t),n=wZr(t);return`${r&&r!=="Object"?`'${r}'`:"Object"} captured as exception with keys: ${n}`}isSeverityLevel(t){return iR(t)&&!X9o(t)&&ZZl.indexOf(t)>=0}getStack(t){try{return iR(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:iR(t.stack)&&t.stack.length>0?t.stack:void 0}catch{return}}getErrorPropertyFromObject(t){for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let n=t[r];if(bSe(n))return n}}getObjectClassName(t){try{let r=Object.getPrototypeOf(t);return r?r.constructor.name:void 0}catch{return}}};var hqo=class{match(t){return Zct(t)}coerce(t,r){let n=t.constructor.name;return{type:n,value:`${n} captured as exception with keys: ${wZr(t)}`,stack:r.syntheticException?.stack,synthetic:!0}}};var XGt=class{match(t){return pZr(t)}coerce(t,r){return{type:"Error",value:`Primitive value captured as exception: ${String(t)}`,stack:r.syntheticException?.stack,synthetic:!0}}};var gqo=class{match(t){return Z_e(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!Zct(t))return!1;try{let r=t.detail;return r!=null&&typeof r=="object"&&"reason"in r}catch{return!1}}coerce(t,r){let n=this.getUnhandledRejectionReason(t);return pZr(n)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(n)}`,stack:r.syntheticException?.stack,synthetic:!0}:r.apply(n)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&t.detail!=null&&typeof t.detail=="object"&&"reason"in t.detail)return t.detail.reason}catch{}return t}};var Aqo=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)}}};var ZGt={MESSAGE:"$message",TIMESTAMP:"$timestamp"},nth=new Set([ZGt.MESSAGE,ZGt.TIMESTAMP]),TZr={enabled:!0,max_bytes:32768};function yqo(e){return e?{enabled:e.enabled??TZr.enabled,max_bytes:oth(e.max_bytes,TZr.max_bytes)}:{...TZr}}function ith(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};let t=[];return{sanitizedProperties:Object.keys(e).reduce((n,i)=>nth.has(i)?(t.push(i),n):(n[i]=e[i],n),{}),droppedKeys:t}}var bqo=class{constructor(t){this._entries=[],this._totalBytes=0,this._config=yqo(t)}setConfig(t){this._config=yqo(t),this._trimToMaxBytes()}add(t){let r=sth(t);if(!r)return;let n=$Zl(r.json);n>this._config.max_bytes||(this._entries.push({step:r.step,bytes:n}),this._totalBytes+=n,this._trimToMaxBytes())}getAttachable(){return this._entries.map(t=>t.step)}clear(){this._entries=[],this._totalBytes=0}size(){return this._entries.length}_trimToMaxBytes(){for(;this._totalBytes>this._config.max_bytes&&this._entries.length>0;){let t=this._entries.shift();t&&(this._totalBytes-=t.bytes)}}};function oth(e,t){if(!Xct(e)||e===1/0||e===-1/0)return t;let r=Math.floor(e);return r<0?t:r}function sth(e){let t;try{t=ySe(e)}catch{return}try{let r=JSON.parse(t);if(!VGt(r))return;let n=r,i=n[ZGt.MESSAGE],o=n[ZGt.TIMESTAMP];return!iR(i)||i.trim().length===0||!iR(o)&&!Xct(o)?void 0:{step:n,json:t}}catch{return}}function $Zl(e){if("u">typeof TextEncoder)return new TextEncoder().encode(e).length;let t=encodeURIComponent(e),r=0;for(let n=0;n<t.length;n++)t[n]==="%"?(r+=1,n+=2):r+=1;return r}function ath(){let e=globalThis._posthogReleaseId;return typeof e=="string"&&e.length>0?e:void 0}var Eqo=e=>{if("flags"in e){let t=e$l(e.flags),r=t$l(e.flags);return{...e,featureFlags:t,featureFlagPayloads:r}}{let t=e.featureFlags??{},r=Object.fromEntries(Object.entries(e.featureFlagPayloads||{}).map(([i,o])=>[i,rlt(o)])),n=Object.fromEntries(Object.entries(t).map(([i,o])=>[i,cth(i,o,r[i])]));return{...e,featureFlags:t,featureFlagPayloads:r,flags:n}}};function cth(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 e$l=e=>Object.fromEntries(Object.entries(e??{}).map(([t,r])=>[t,$Gt(r)]).filter(([,t])=>t!==void 0)),t$l=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?rlt(n):void 0]}))},$Gt=e=>e===void 0?void 0:e.variant??e.enabled,rlt=e=>{if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}};var r$l=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","irclid","_kx"],lth=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain",...r$l,"$session_id","$window_id","$lib","$lib_version","$device_id","$is_server","$react_native_version"],e9t=(e,t=[])=>{let r={},n=i=>{e[i]!==void 0&&(r[i]=e[i])};return lth.forEach(n),t.forEach(n),r};var OZr=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)}};function Iqo(){return"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&typeof Response.prototype.blob=="function"}var pth="NativeGzipValidationError",fth=31,dth=139,mth=8,hth=e=>e.length>=2&&e[0]===fth&&e[1]===dth;var t9t,gth=()=>{if(t9t)return t9t;t9t=[];for(let e=0;e<256;e++){let t=e;for(let r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;t9t[e]=t>>>0}return t9t},Ath=e=>{let t=gth(),r=4294967295;for(let n=0;n<e.length;n++)r=t[(r^e[n])&255]^r>>>8;return(4294967295^r)>>>0},PZr=e=>{throw tlt(pth,`Native gzip produced invalid output: ${e}`)},yth=async(e,t)=>{e.size<18&&PZr("too-short");let r=new Uint8Array(await e.slice(0,10).arrayBuffer());(!hth(r)||r[2]!==mth)&&PZr("invalid-header");let n=new DataView(await e.slice(e.size-8).arrayBuffer());n.getUint32(0,!0)!==Ath(t)&&PZr("invalid-crc");let i=t.length>>>0;n.getUint32(4,!0)!==i&&PZr("invalid-size")};async function r9t(e,t=!0,r){try{let n=new TextEncoder().encode(e),i=new globalThis.CompressionStream("gzip"),o=i.writable.getWriter(),s=o.write(n).then(()=>o.close()).catch(async l=>{try{await o.abort(l)}catch{}throw l}),a=new Response(i.readable).blob(),[c]=await Promise.all([a,s]);return await yth(c,n),c}catch(n){if(r?.rethrow)throw n;return t&&console.error("Failed to gzip compress data",n),null}}var L5=class extends Error{constructor(t,r,n,i){super("HTTP error while fetching PostHog: status="+t.status+", reqByteLength="+r),this.response=t,this.reqByteLength=r,this.responseBodyDeadline=n,this.abortController=i,this.name="PostHogFetchHttpError",this._bodyReadTimedOut=!1}get status(){return this.response.status}get retryAfterMs(){try{return sqo(this.response.headers?.get("retry-after"))}catch{return}}get bodyReadTimedOut(){return this._bodyReadTimedOut}get text(){if(!this.responseBodyTextPromise)if(Date.now()>=this.responseBodyDeadline){this._bodyReadTimedOut=!0;let t=tlt("AbortError","Response body read timed out");this.cancelResponseBody(t),this.responseBodyTextPromise=Promise.reject(t)}else{let t=new Promise((n,i)=>{this.responseBodyTimer=T2(()=>{this._bodyReadTimedOut=!0;let o=tlt("AbortError","Response body read timed out");i(o),this.cancelResponseBody(o)},this.responseBodyDeadline-Date.now())}),r;try{r=Promise.resolve(this.response.text())}catch(n){r=Promise.reject(n)}this.responseBodyTextPromise=Promise.race([r,t]).finally(()=>clearTimeout(this.responseBodyTimer))}return this.responseBodyTextPromise}get json(){return this.text.then(t=>JSON.parse(t))}cancelResponseBody(t){clearTimeout(this.responseBodyTimer),this.abortController.signal.aborted||this.abortController.abort(t),(async()=>{try{await this.response.body?.cancel()}catch{}})()}},mme=class extends Error{constructor(t){super("Network error while fetching PostHog",t instanceof Error?{cause:t}:{}),this.error=t,this.name="PostHogFetchNetworkError"}};var a$l=(e,t)=>{for(let r of Object.keys(t))(r.startsWith("$feature/")||r==="$active_feature_flags")&&(e[r]=t[r])};async function n$l(e){if(e instanceof L5){let t="";try{t=await e.text}catch{e.bodyReadTimedOut&&(t="<response body read timed out>")}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 bth(e){return typeof e=="object"&&(e instanceof L5||c$l(e))}function c$l(e){return e instanceof mme}function Eth(e){if(e instanceof L5)return e.status===502||e.status===504;if(!(e instanceof mme))return!1;let t=e.error;return(t?.code??t?.cause?.code)!=="ECONNREFUSED"}var i$l=10485760;function o$l(e){try{return typeof e!="string"?e instanceof Uint8Array?e.byteLength:e.size:"u">typeof Buffer?Buffer.byteLength(e,NZl):new TextEncoder().encode(e).length}catch{return 0}}function nlt(e){return typeof e=="object"&&e instanceof L5&&e.status===413}function BZr(e){return e instanceof L5?e.status===408||e.status===429||e.status>=500:c$l(e)}function s$l(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}var vqo="default",n9t=class{getErrorPropertiesBuilder(){return this._errorPropertiesBuilder||(this._errorPropertiesBuilder=this.createErrorPropertiesBuilder()),this._errorPropertiesBuilder}createErrorPropertiesBuilder(){return new HGt([new KGt,new YGt,new JGt,new XGt],fqo())}getEvaluationRuntime(){}constructor(t,r={}){this.flushPromise=null,this.pendingFlushPromise=null,this.flushPromises=new Set,this._dequeuedMessagesCount=0,this.shutdownPromise=null,this.promiseQueue=new gZr,this._events=new OZr,this._isInitialized=!1;let n=typeof t=="string"?t.trim():"",i=typeof r.host=="string"?r.host.trim():"",o=!n;this._logger=EZl("[PostHog]",this.logMsgIfDebug.bind(this)),o&&this._logger.error("You must pass your PostHog project's api key. The client will be disabled."),this.apiKey=n,this.host=jZl(i||"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.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:BZr},this.requestTimeout=r.requestTimeout??1e4,this.featureFlagsRequestTimeoutMs=r.featureFlagsRequestTimeoutMs??3e3,this.featureFlagsRequestMaxRetries=r.featureFlagsRequestMaxRetries??1,this.remoteConfigRequestTimeoutMs=r.remoteConfigRequestTimeoutMs??3e3,this.disableGeoip=r.disableGeoip??!0,this.disabled=(r.disabled??!1)||o,this.historicalMigration=r?.historicalMigration??!1,this._initPromise=Promise.resolve(),this._isInitialized=!0,this.evaluationContexts=r?.evaluationContexts??r?.evaluationEnvironments,r?.evaluationEnvironments&&!r?.evaluationContexts&&this._logger.warn("evaluationEnvironments is deprecated. Use evaluationContexts instead. This property will be removed in a future version."),this.disableCompression=!Iqo()||(r?.disableCompression??!1)}logMsgIfDebug(t){this.isDebug&&t()}wrap(t){if(this.disabled)return void this._logger.warn("The client is disabled");if(this._isInitialized)return t();this._initPromise.then(()=>t())}getCommonEventProperties(){return{$lib:this.getLibraryId(),$lib_version:this.getLibraryVersion()}}get optedOut(){return this.getPersistedProperty(vQ.OptedOut)??!this.defaultOptIn}async optIn(){this.wrap(()=>{this.setPersistedProperty(vQ.OptedOut,!1)})}async optOut(){this.wrap(()=>{this.setPersistedProperty(vQ.OptedOut,!0)})}on(t,r){return this._events.on(t,r)}debug(t=!0){if(this.removeDebugCallback?.(),t){let r=this.on("*",(n,i)=>this._logger.info(n,i));this.removeDebugCallback=()=>{r(),this.removeDebugCallback=void 0}}}get isDebug(){return!!this.removeDebugCallback}get isDisabled(){return this.disabled}buildPayload(t){let r=t.properties||{},n={...r,...this.getCommonEventProperties()};return a$l(n,r),t.event==="$feature_flag_called"&&n.$feature_flag_has_experiment===!1&&this.isMinimalFlagCalledEventsEnabled()&&(n=e9t(n)),{distinct_id:t.distinct_id,event:t.event,properties:n}}isMinimalFlagCalledEventsEnabled(){return!1}addPendingPromise(t){return this.promiseQueue.add(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 o=this.buildPayload({distinct_id:t,event:r,properties:n});this.enqueue("capture",o,i)})}async captureStatelessImmediate(t,r,n,i){let o=this.buildPayload({distinct_id:t,event:r,properties:n});await this.sendImmediate("capture",o,i)}aliasStateless(t,r,n,i){this.wrap(()=>{let o=this.buildPayload({event:"$create_alias",distinct_id:r,properties:{...n||{},distinct_id:r,alias:t}});this.enqueue("alias",o,i)})}async aliasStatelessImmediate(t,r,n,i){let o=this.buildPayload({event:"$create_alias",distinct_id:r,properties:{...n||{},distinct_id:r,alias:t}});await this.sendImmediate("alias",o,i)}groupIdentifyStateless(t,r,n,i,o,s){this.wrap(()=>{let a=this.buildPayload({distinct_id:o||`$${t}_${r}`,event:"$groupidentify",properties:{$group_type:t,$group_key:r,$group_set:n||{},...s||{}}});this.enqueue("capture",a,i)})}async groupIdentifyStatelessImmediate(t,r,n,i,o,s){let a=this.buildPayload({distinct_id:o||`$${t}_${r}`,event:"$groupidentify",properties:{$group_type:t,$group_key:r,$group_set:n||{},...s||{}}});await this.sendImmediate("capture",a,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,{type:"required",consume:i=>i.json()},{retryCount:0},this.remoteConfigRequestTimeoutMs).catch(i=>{this._logger.error("Remote config could not be loaded",i),this._events.emit("error",i)})}async getFlags(t,r={},n={},i={},o={},s=!1){await this._initPromise;let a=s?"&config=true":"",c=`${this.host}/flags/?v=2${a}`,l={token:this.apiKey,distinct_id:t,groups:r,person_properties:n,group_properties:i,...o};n.$device_id&&(l.$device_id=n.$device_id),this.evaluationContexts&&this.evaluationContexts.length>0&&(l.evaluation_contexts=this.evaluationContexts);let u=this.getEvaluationRuntime();u&&(l.evaluation_runtime=u);let p={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:JSON.stringify(l)};return this._logger.info("Flags URL",c),this.fetchWithRetry(c,p,{type:"required",consume:d=>d.json()},{retryCount:this.featureFlagsRequestMaxRetries,retryCheck:Eth},this.featureFlagsRequestTimeoutMs).then(d=>({success:!0,response:Eqo(d)})).catch(d=>(this._events.emit("error",d),{success:!1,error:this.categorizeRequestError(d)}))}categorizeRequestError(t){if(t instanceof L5)return{type:"api_error",statusCode:t.status};if(t instanceof mme){let r=t.error;return r instanceof Error&&(r.name==="AbortError"||r.name==="TimeoutError")?{type:"timeout"}:{type:"connection_error"}}return{type:"unknown_error"}}async getFeatureFlagStateless(t,r,n={},i={},o={},s){await this._initPromise;let a=await this.getFeatureFlagDetailStateless(t,r,n,i,o,s);if(a===void 0)return{response:void 0,requestId:void 0};let c=$Gt(a.response);return c===void 0&&(c=!1),{response:c,requestId:a.requestId}}async getFeatureFlagDetailStateless(t,r,n={},i={},o={},s){await this._initPromise;let a=await this.getFeatureFlagDetailsStateless(r,n,i,o,s,[t]);return a===void 0?void 0:{response:a.flags[t],requestId:a.requestId,evaluatedAt:a.evaluatedAt}}async getFeatureFlagPayloadStateless(t,r,n={},i={},o={},s){await this._initPromise;let a=await this.getFeatureFlagPayloadsStateless(r,n,i,o,s,[t]);if(!a)return;let c=a[t];return c===void 0?null:c}async getFeatureFlagPayloadsStateless(t,r={},n={},i={},o,s){return await this._initPromise,(await this.getFeatureFlagsAndPayloadsStateless(t,r,n,i,o,s)).payloads}async getFeatureFlagsStateless(t,r={},n={},i={},o,s){return await this._initPromise,await this.getFeatureFlagsAndPayloadsStateless(t,r,n,i,o,s)}async getFeatureFlagsAndPayloadsStateless(t,r={},n={},i={},o,s){await this._initPromise;let a=await this.getFeatureFlagDetailsStateless(t,r,n,i,o,s);return a?{flags:a.featureFlags,payloads:a.featureFlagPayloads,requestId:a.requestId}:{flags:void 0,payloads:void 0,requestId:void 0}}async getFeatureFlagDetailsStateless(t,r={},n={},i={},o,s){await this._initPromise;let a={geoip_disable:o??this.disableGeoip};s&&(a.flag_keys_to_evaluate=s);let c=await this.getFlags(t,r,n,i,a);if(!c.success)return;let l=c.response;return l.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"),l.quotaLimited?.includes("feature_flags")?(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:l?.requestId,quotaLimited:l.quotaLimited}):l}async getSurveysStateless(){if(await this._initPromise,this.disabled)return[];if(this.disableSurveys===!0)return this._logger.info("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,{type:"required",consume:o=>{if(o.status!==200||!o.json){let s=`Surveys API could not be loaded: ${o.status}`,a=new Error(s);return this._logger.error(a),this._events.emit("error",new Error(s)),Promise.resolve(void 0)}return o.json()}}).catch(o=>{this._logger.error("Surveys API could not be loaded",o),this._events.emit("error",o)}))?.surveys;return i&&this._logger.info("Surveys fetched from API: ",JSON.stringify(i)),i??[]}get props(){return this._props||(this._props=this.getPersistedProperty(vQ.Props)),this._props||{}}set props(t){this._props=t}async register(t){this.wrap(()=>{this.props={...this.props,...t},this.setPersistedProperty(vQ.Props,this.props)})}async unregister(t){this.wrap(()=>{delete this.props[t],this.setPersistedProperty(vQ.Props,this.props)})}processBeforeEnqueue(t){return t}async flushStorage(){}getQueueRouteKey(t){return vqo}persistedQueueKeyForRoute(t){return vQ.Queue}getActiveQueueRoutes(){return[vqo]}getRouteQueue(t){return this.getPersistedProperty(this.persistedQueueKeyForRoute(t))||[]}enqueue(t,r,n,i){this.wrap(()=>{if(this.optedOut)return void this._events.emit(t,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");let o=this.prepareMessage(r,n);if(o=this.processBeforeEnqueue(o),o===null)return;o=this.normalizeMessage(o);let s=this.persistedQueueKeyForRoute(i??this.getQueueRouteKey(o)),a=this.getPersistedProperty(s)||[];a.length>=this.maxQueueSize&&(a.shift(),this._logger.warn("Queue is full, the oldest event is dropped.")),a.push({message:o}),this.setPersistedProperty(s,a),this._events.emit(t,o),a.length>=this.flushAt&&this.flushBackground(),this.flushInterval&&!this._flushTimer&&(this._flushTimer=T2(()=>this.flushBackground(),this.flushInterval))})}async sendImmediate(t,r,n,i){if(this.disabled)return void this._logger.warn("The client is disabled");if(this._isInitialized||await this._initPromise,this.optedOut)return void this._events.emit(t,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");let o=this.prepareMessage(r,n);if(o=this.processBeforeEnqueue(o),o!==null){o=this.normalizeMessage(o);try{await this.sendBatch([o],void 0,i??this.getQueueRouteKey(o))}catch(s){this._events.emit("error",s)}}}normalizeMessage(t){let{type:r,library:n,library_version:i,...o}=t,s=s$l(o.properties)?o.properties:void 0;return n!==void 0&&s?.$lib===void 0&&(s={...s||{},$lib:n}),i!==void 0&&s?.$lib_version===void 0&&(s={...s||{},$lib_version:i}),s&&(o.properties=s),o.uuid=eUe(o.uuid,w2),o}normalizeTimestampForWire(t){let r=t instanceof Date?t:typeof t=="string"?new Date(t):null;if(!r||Number.isNaN(r.getTime()))return t;let n=r.toISOString(),i=typeof t=="string"?t.match(/\.(\d+)(?:Z|[+-]\d{2}:?\d{2})?$/i)?.[1]:void 0;return i&&i.length>3?n.replace(/\.\d{3}Z$/,`.${i}Z`):n}prepareMessage(t,r){let n={...t,timestamp:r?.timestamp?r?.timestamp:aqo(),uuid:eUe(r?.uuid,w2)};return(r?.disableGeoip??this.disableGeoip)&&(s$l(n.properties)||(n.properties={}),n.properties.$geoip_disable=!0),n.distinctId&&(n.distinct_id=n.distinctId,delete n.distinctId),n}clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}flushBackground(){this.pendingFlushPromise||this.flushAutomatic().catch(async t=>{await n$l(t)})}flushAutomatic(){return this.flush()}async waitForPendingPromises(t,r=[]){let n=r.filter(o=>!!o),i=0;for(;;){let o=this.promiseQueue.getPromises([...n,...this.flushPromises],t);if(o.length===0)return;i>0&&this._logger.debug(`flush() re-checking ${o.length} pending promise(s) before flushing`),await Promise.all(o.map(s=>s.catch(()=>{}))),i++}}flushWithPendingPromises(){return this.flushInternal(!0)}flush(){return this.flushInternal(!1)}flushInternal(t){if(this.disabled)return Promise.resolve();if(!t&&this.pendingFlushPromise)return this.pendingFlushPromise;let r=this.flushPromise,n=this.promiseQueue.maxId,i=Promise.resolve().then(()=>{if(t)return this.waitForPendingPromises(n,[r,i])}).then(()=>WGt([r])).then(()=>(this.pendingFlushPromise===i&&(this.pendingFlushPromise=null),this._flush()));return this.pendingFlushPromise=i,this.flushPromise=i,this.flushPromises.add(i),this.addPendingPromise(i),WGt([i]).then(()=>{this.flushPromises.delete(i),this.pendingFlushPromise===i&&(this.pendingFlushPromise=null),this.flushPromise===i&&(this.flushPromise=null)}),i}getCustomHeaders(){let t=this.getCustomUserAgent(),r={};return t&&t!==""&&(r["User-Agent"]=t),r}compressPayload(t){return r9t(t,this.isDebug)}getBatchEndpointPath(t){return"/batch/"}async sendBatch(t,r,n=vqo){let i={api_key:this.apiKey,batch:t.map(l=>{if(!l)return l;let u=this.normalizeTimestampForWire(l.timestamp);return u===l.timestamp?l:{...l,timestamp:u}}),sent_at:aqo()};this.historicalMigration&&(i.historical_migration=!0);let o=ySe(i),s=`${this.host}${this.getBatchEndpointPath(n)}`,a=this.disableCompression?null:await this.compressPayload(o),c={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",...a!==null&&{"Content-Encoding":"gzip"}},body:a||o};await this.fetchWithRetry(s,c,{type:"successful-write"},r)}async _flush(){this.clearFlushTimer(),await this._initPromise;let t=this.getActiveQueueRoutes();if(!t.some(i=>this.getRouteQueue(i).length>0))return;let r=[],n;for(let i of t)try{await this._flushRoute(i,r)}catch(o){n===void 0&&(n=o)}if(n!==void 0)throw n;this._events.emit("flush",r)}async _flushRoute(t,r){let n=this.persistedQueueKeyForRoute(t),i=this.getPersistedProperty(n)||[];if(!i.length)return;let o=i.length,s=0;for(;i.length>0&&s<o;){let a=i.slice(0,this.maxBatchSize),c=a.map(p=>p.message===void 0?p.message:this.normalizeMessage(p.message)),l=async()=>{let p=this.getPersistedProperty(n)||[],d=[...a],f=p.filter(m=>{let g=m.message?.uuid,A=d.findIndex(y=>y===m||typeof g=="string"&&g.length>0&&y.message?.uuid===g);return A===-1?!0:(d.splice(A,1),!1)});this.setPersistedProperty(n,f),i=f,this._dequeuedMessagesCount+=a.length,await this.flushStorage()},u={retryCheck:p=>nlt(p)?!1:BZr(p)};try{await this.sendBatch(c,u,t)}catch(p){if(nlt(p)&&c.length>1){this.maxBatchSize=Math.max(1,Math.floor(c.length/2)),this._logger.warn(`Received 413 when sending batch of size ${c.length}, reducing batch size to ${this.maxBatchSize}`);continue}throw p instanceof mme||await l(),this._events.emit("error",p),p}await l(),r.push(...c),s+=c.length}}async _sendOtlpBatch({path:t,auth:r,payload:n}){if(this.disabled)return{kind:"fatal",error:new Error("The client is disabled")};let i;try{i=JSON.stringify(n)}catch(u){return this.logMsgIfDebug(()=>console.warn(`[PostHog] Could not serialize a ${t} batch; reporting it as too large`,u)),{kind:"too-large",measuredLocally:!0}}let o=o$l(i);if(o>i$l)return this.logMsgIfDebug(()=>console.warn(`[PostHog] Not sending a ${t} batch of ${o} bytes: the endpoint accepts at most ${i$l}`)),{kind:"too-large",measuredLocally:!0};let s=r==="bearer"?`${this.host}/i/v1/${t}`:`${this.host}/i/v1/${t}?token=${encodeURIComponent(this.apiKey)}`,a=this.disableCompression?null:await this.compressPayload(i),c=a||i,l={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",...r==="bearer"&&{Authorization:`Bearer ${this.apiKey}`},...a!==null&&{"Content-Encoding":"gzip"}},body:c};try{return await this.fetchWithRetry(s,l,{type:"successful-write"},{retryCheck:u=>nlt(u)||u instanceof L5&&u.retryAfterMs!==void 0?!1:BZr(u)}),{kind:"ok"}}catch(u){if(nlt(u))return{kind:"too-large"};if(BZr(u)){let p=u instanceof L5?u.retryAfterMs:void 0;return{kind:"retry-later",error:u,...p!==void 0&&{retryAfterMs:p}}}return{kind:"fatal",error:u}}}async _sendLogsBatch(t){return this._sendOtlpBatch({path:"logs",auth:"query-token",payload:t})}async _sendMetricsBatch(t){return this._sendOtlpBatch({path:"metrics",auth:"query-token",payload:t})}async _sendTracesBatch(t){return this._sendOtlpBatch({path:"traces",auth:"bearer",payload:t})}async fetchWithRetry(t,r,n,i,o){let s=r.body?r.body:"",a=o$l(s),c={...this._retryOptions,...i},l=0;return await zZl(async()=>{l++;let u=new AbortController,p=o??this.requestTimeout,d=Date.now()+p,f,m=new Promise((C,x)=>{f=T2(()=>{let S=tlt("AbortError",`Request timed out after ${p}ms`);x(S),u.abort(S)},p)}),g,A=!1,y,I=()=>y??=(async()=>{try{await g?.body?.cancel()}catch{}})();try{let C;try{C=this.fetch(t,{signal:u.signal,...r})}catch(B){throw new mme(B)}C.then(B=>{u.signal.aborted&&!A&&Promise.resolve(B.body?.cancel()).catch(()=>{})}).catch(()=>{});try{g=await Promise.race([C,m]),A=!0}catch(B){throw new mme(B)}let x=r.mode==="no-cors",S=n.type==="successful-write"?300:400;if(!x&&(g.status<200||g.status>=S))throw new L5(g,a,d,u);if(n.type==="successful-write"){try{await Promise.race([I(),m])}catch{}return}try{return await Promise.race([n.consume(g),m])}catch(B){throw u.signal.aborted?new mme(B):B}}finally{clearTimeout(f),u.signal.aborted&&g&&I()}},{...c,retryCheck:u=>{let p=c.retryCheck(u);return p&&l<=c.retryCount&&u instanceof L5&&u.cancelResponseBody(),p}})}async _shutdown(t=3e4){await this._initPromise;let r=!1;return this.clearFlushTimer(),this.disabled?void 0:ESe((async()=>{try{for(await this.promiseQueue.join();this.getActiveQueueRoutes().some(s=>this.getRouteQueue(s).length>0);){let o=this._dequeuedMessagesCount;if(await this.flush(),r)break;if(this._dequeuedMessagesCount===o){this._logger.warn("Shutdown flush completed but did not send any queued events. Stopping drain to avoid a loop.");break}}}catch(i){if(!bth(i))throw i;await n$l(i)}})(),t,()=>{this._logger.critical("Timeout while shutting down PostHog. Some events may not have been sent.",{shutdownTimeoutMs:t}),r=!0})}async shutdown(t=3e4){return this.shutdownPromise?this._logger.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}};var Sth=/[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi;var DVv=new RegExp(Sth.source,"i"),l$l=/[a-z][a-z0-9+.-]{0,63}:\/\//i,RVv=new RegExp(`^${l$l.source}`,"i"),kVv=new RegExp(l$l.source,"gi");var wth=["is_not","is_set"],Tth=1152921504606847e3,Ml=class e extends Error{constructor(t){super(t),this.name=this.constructor.name,Object.setPrototypeOf(this,e.prototype)}};function Cqo(e){if(typeof e=="boolean")return!0;if(typeof e=="string"){let t=e.toLowerCase();return t==="true"||t==="false"}if(!Array.isArray(e))return!1;for(let t=0;t<e.length;t++)if(!Cqo(t in e?e[t]:null))return!1;return!0}function xqo(e){if(typeof e=="boolean")return e;if(typeof e=="string")return e.toLowerCase()==="true";if(!Array.isArray(e))return!1;for(let t=0;t<e.length;t++)if(!xqo(t in e?e[t]:null))return!1;return!0}function i9t(e){for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>=55296&&r<=56319){let n=e.charCodeAt(t+1);if(t+1>=e.length||n<56320||n>57343)throw new Ml("Cannot stringify an unpaired surrogate like the flags service");t++}else if(r>=56320&&r<=57343)throw new Ml("Cannot stringify an unpaired surrogate like the flags service")}}function RZr(e,t=new Set){if(!(e===null||typeof e=="boolean")){if(typeof e=="string")return void i9t(e);if(typeof e=="number"){if(!Number.isFinite(e))throw new Ml(`Cannot represent non-finite number ${e} like the flags service`);return}if(Array.isArray(e)){if(t.has(e))throw new Ml("Cannot represent a circular array during local evaluation");t.add(e);try{for(let r=0;r<e.length;r++)r in e&&RZr(e[r],t)}finally{t.delete(e)}return}if(typeof e=="object"){let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&r!==null)throw new Ml("Cannot represent a non-JSON object like the flags service");if(t.has(e))throw new Ml("Cannot represent a circular object during local evaluation");t.add(e);try{for(let n of Object.keys(e))i9t(n),RZr(e[n],t)}finally{t.delete(e)}return}throw new Ml(`Cannot represent ${typeof e} like the flags service`)}}function Oth(e,t){let r=0,n=0;for(;r<e.length&&n<t.length;){let i=e.charCodeAt(r),o=t.charCodeAt(n),s=i>=55296&&i<=56319,a=o>=55296&&o<=56319,c=s?e.charCodeAt(r+1):0,l=a?t.charCodeAt(n+1):0,u=s?(i-55296)*1024+c-56320+65536:i,p=a?(o-55296)*1024+l-56320+65536:o;if(u!==p)return u-p;r+=s?2:1,n+=a?2:1}return e.length-t.length}function Sqo(e,t=new Set){if(e===null)return"null";if(typeof e=="string")return i9t(e),JSON.stringify(e);if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number"){if(!Number.isFinite(e))throw new Ml(`Cannot stringify non-finite number ${e} like the flags service`);if(Number.isInteger(e))throw new Ml(`Cannot distinguish integer ${e} from an integral JSON float during local evaluation`);return String(e)}if(Array.isArray(e)){if(t.has(e))throw new Ml("Cannot stringify a circular array during local evaluation");t.add(e);try{let r=[];for(let n=0;n<e.length;n++)r.push(n in e?Sqo(e[n],t):"null");return`[${r.join(",")}]`}finally{t.delete(e)}}if(typeof e=="object"){let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&r!==null)throw new Ml("Cannot stringify a non-JSON object like the flags service");if(t.has(e))throw new Ml("Cannot stringify a circular object during local evaluation");t.add(e);try{let n=Object.keys(e);return n.forEach(i9t),`{${n.sort(Oth).map(i=>`${JSON.stringify(i)}:${Sqo(e[i],t)}`).join(",")}}`}finally{t.delete(e)}}throw new Ml(`Cannot stringify ${typeof e} like the flags service`)}function DZr(e){return typeof e=="string"?(i9t(e),e):Sqo(e)}function u$l(e){try{return new RegExp(e),!0}catch{return!1}}function _5(e){return String(e).replace(/[A-Z]/g,t=>t.toLowerCase())}function f$l(e,t,r){if(!/^\d+$/.test(e)||r==="strict"&&e.length>1&&e[0]==="0")throw new Ml(`Invalid semver: ${t}`);return parseInt(e,10)}function dw(e,t="strict"){let n=String(e).trim().replace(/^[vV]/,"").split("-")[0].split("+")[0];if(!n||n.startsWith("."))throw new Ml(`Invalid semver: ${e}`);let i=n.split("."),o=s=>s===void 0||s===""?0:f$l(s,e,t);return[o(i[0]),o(i[1]),o(i[2])]}function U5(e,t){for(let r=0;r<3;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return 0}function Pth(e,t){let r=dw(e,t);return{lower:[r[0],r[1],r[2]],upper:[r[0],r[1]+1,0]}}function Bth(e,t){let[r,n,i]=dw(e,t),o=[r,n,i],s;return s=r>0?[r+1,0,0]:n>0?[0,n+1,0]:[0,0,i+1],{lower:o,upper:s}}function Dth(e,t){let n=String(e).trim().replace(/^[vV]/,"").replace(/\.\*$/,"").replace(/\*$/,"");if(!n)throw new Ml(`Invalid wildcard semver: ${e}`);let i=n.split("."),o=c=>{if(t==="legacy-permissive"){let l=parseInt(c,10);if(!isNaN(l))return l}else try{return f$l(c,e,t)}catch{}throw new Ml(`Invalid wildcard semver: ${e}`)},s=o(i[0]);if(i.length===1)return{lower:[s,0,0],upper:[s+1,0,0]};let a=o(i[1]);return{lower:[s,a,0],upper:[s,a+1,0]}}function p$l(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 Ml(`${e} is in an invalid date format`)}throw new Ml(`The date provided ${e} must be a string, number, or date object`)}function wqo(e){let t=/^-?(?<number>[0-9]+)(?<interval>[a-z])$/,r=e.match(t),n=new Date(new Date().toISOString());if(!r||!r.groups)return null;let i=parseInt(r.groups.number);if(i>=1e4)return null;let o=r.groups.interval;if(o==="h")n.setUTCHours(n.getUTCHours()-i);else if(o==="d")n.setUTCDate(n.getUTCDate()-i);else if(o==="w")n.setUTCDate(n.getUTCDate()-7*i);else if(o==="m")n.setUTCMonth(n.getUTCMonth()-i);else{if(o!=="y")return null;n.setUTCFullYear(n.getUTCFullYear()-i)}return n}function Tqo(e,t,r={}){let n=e.key,i=e.value,o=e.operator||"exact",s=r.semverParsingPolicy??"strict";if(Object.prototype.hasOwnProperty.call(t,n)){if(o==="is_not_set")return!1;if(o==="is_set")return!0}else throw new Ml(`Property ${n} not found in propertyValues`);let c=t[n];if(c===void 0)return r.warnFunction?.(`Property ${n} cannot have a value of undefined with the ${o} operator`),o==="is_not";if(c===null&&!wth.includes(o)&&o!=="exact"&&o!=="is_not")return r.warnFunction?.(`Property ${n} cannot have a value of null with the ${o} operator`),!1;let l=(p,d)=>{if(r.propertyMatchingVersion!==2&&Cqo(p)||Array.isArray(p)&&p.length===0)return RZr(d),xqo(p)===xqo(d);if(r.propertyMatchingVersion===2&&typeof d=="number"&&Cqo(p))return RZr(d),!1;if(Array.isArray(p)){let f=DZr(d).toLowerCase();return p.some(m=>DZr(m).toLowerCase()===f)}return DZr(p).toLowerCase()===DZr(d).toLowerCase()},u=(p,d,f)=>{if(f==="gt")return p>d;if(f==="gte")return p>=d;if(f==="lt")return p<d;if(f==="lte")return p<=d;throw new Error(`Invalid operator: ${f}`)};switch(o){case"exact":return l(i,c);case"is_not":return!l(i,c);case"is_set":return!0;case"icontains":return _5(c).includes(_5(i));case"not_icontains":return!_5(c).includes(_5(i));case"starts_with":return _5(c).startsWith(_5(i));case"not_starts_with":return!_5(c).startsWith(_5(i));case"ends_with":return _5(c).endsWith(_5(i));case"not_ends_with":return!_5(c).endsWith(_5(i));case"regex":return u$l(String(i))&&String(c).match(String(i))!==null;case"not_regex":return u$l(String(i))&&String(c).match(String(i))===null;case"gt":case"gte":case"lt":case"lte":{let p=typeof i=="number"?i:parseFloat(String(i)),d=typeof c=="number"?c:c!=null?parseFloat(String(c)):NaN;return Number.isFinite(p)&&Number.isFinite(d)?u(d,p,o):u(String(c),String(i),o)}case"is_date_after":case"is_date_before":{if(typeof i=="boolean")throw new Ml("Date operations cannot be performed on boolean values");let p=wqo(String(i));p==null&&(p=p$l(i));let d=p$l(c);return o==="is_date_before"?d<p:d>p}case"semver_eq":return U5(dw(String(c),s),dw(String(i),s))===0;case"semver_neq":return U5(dw(String(c),s),dw(String(i),s))!==0;case"semver_gt":return U5(dw(String(c),s),dw(String(i),s))>0;case"semver_gte":return U5(dw(String(c),s),dw(String(i),s))>=0;case"semver_lt":return U5(dw(String(c),s),dw(String(i),s))<0;case"semver_lte":return U5(dw(String(c),s),dw(String(i),s))<=0;case"semver_tilde":{let p=dw(String(c),s),{lower:d,upper:f}=Pth(String(i),s);return U5(p,d)>=0&&U5(p,f)<0}case"semver_caret":{let p=dw(String(c),s),{lower:d,upper:f}=Bth(String(i),s);return U5(p,d)>=0&&U5(p,f)<0}case"semver_wildcard":{let p=dw(String(c),s),{lower:d,upper:f}=Dth(String(i),s);return U5(p,d)>=0&&U5(p,f)<0}default:throw new Ml(`Unknown operator: ${o}`)}}async function d$l(e){let t=globalThis.crypto?.subtle;if(!t)throw new Error("SubtleCrypto API not available");let r=await t.digest("SHA-1",new TextEncoder().encode(e));return Array.from(new Uint8Array(r)).map(n=>n.toString(16).padStart(2,"0")).join("")}async function o9t(e,t,r="",n="."){let i=await d$l(`${e}${n}${t}${r}`);return parseInt(i.slice(0,15),16)/Tth}async function Oqo(e,t){if(e==null||e.id==null||e.exclusion_percentage==null)return;let r=Number(e.exclusion_percentage);if(!Number.isFinite(r))return;let n=Math.min(Math.max(r,0),100);if(!(n!==100&&await o9t("holdout",t,"","-")>n/100))return`holdout-${e.id}`}function kZr(e){let t=[],r=0;for(let n of e){let i=r+n.rollout_percentage/100;t.push({valueMin:r,valueMax:i,key:n.key}),r=i}return t}async function Pqo(e,t,r){let n=await o9t(e,t,"variant");return kZr(r).find(i=>n>=i.valueMin&&n<i.valueMax)?.key}function Bqo(e,t){if(t===!1||t==null||!e)return null;let r=typeof t=="boolean"?t.toString():t,n=e[r]||null;return n==null?null:rlt(n)}var m$l=9223372036854776e3,Rth="9223372036854775808",kth=Object.prototype.propertyIsEnumerable;function Fth(){return{ancestors:new WeakSet,remainingNodes:1e4}}function Gte(e,t){try{return h$l(e,t,Fth(),0)}catch{return[]}}function Nth(e,t){let r=e.toString(),n=BigInt(Rth);return e>=n||e<-n?(t?.debug(`Attribute ${r} is outside the int64 range; encoding it as a string`),{stringValue:r}):{intValue:r}}function kqo(e,t,r,n){if(r.remainingNodes<=0)return{stringValue:vZr};if(r.remainingNodes--,fZl(e))return{boolValue:e};if(typeof e=="bigint")return Nth(e,t);if(typeof e=="number"){if(!Number.isFinite(e))return{stringValue:String(e)};if(Number.isInteger(e)){if(Number.isSafeInteger(e))return{intValue:String(e)};if("u"<typeof BigInt)return{stringValue:String(e)};let i=BigInt(e).toString();return e>=m$l||e<-m$l?(t?.debug(`Attribute ${i} is outside the int64 range; encoding it as a string`),{stringValue:i}):{intValue:i}}return{doubleValue:e}}if(typeof e=="string")return{stringValue:Ute(e)};if(typeof e=="function")return{stringValue:FZl};if(typeof e=="symbol")return{stringValue:String(e)};if(typeof e=="object"&&e!==null){if(r.ancestors.has(e))return{stringValue:IZr};if(n>=20)return{stringValue:vZr};if(e instanceof Date){let i=e.getTime(),o=Number.isFinite(i)?e.toISOString():String(e);return{stringValue:typeof o=="string"?Ute(o):String(o)}}r.ancestors.add(e);try{try{let i=e.toJSON;if(typeof i=="function")return kqo(i.call(e),t,r,n+1)}catch{}return j3(e)?{arrayValue:{values:jth(e,t,r,n+1)}}:{kvlistValue:{values:h$l(e,t,r,n+1)}}}finally{r.ancestors.delete(e)}}return{stringValue:Ute(String(e))}}function jth(e,t,r,n){let i=[],o=Math.min(e.length,1e3),s=0;for(;s<o&&r.remainingNodes>0;s++)try{let a=s in e?e[s]:void 0;if(TK(a))continue;i.push(kqo(a,t,r,n))}catch{i.push({stringValue:M5})}return e.length>s&&i.push({stringValue:vZr}),i}function h$l(e,t,r,n){let i=[];for(let o in e)if(kth.call(e,o)){if(!o){t?.debug("Dropping an attribute with an empty key");continue}if(i.length>=1e3||r.remainingNodes<=0){t?.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{let s=e[o];if(Z9o(s)||fme(s))continue;i.push({key:Ute(o),value:kqo(s,t,r,n)})}catch{i.push({key:Ute(o),value:{stringValue:M5}})}}return i}function a9t(e,t,r){return{...dme({},e.resourceAttributes),"service.name":e.serviceName||"unknown_service",...e.environment&&{"deployment.environment":e.environment},...e.serviceVersion&&{"service.version":e.serviceVersion},"telemetry.sdk.name":t,"telemetry.sdk.version":r}}var zth=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function c9t(e,t){let r=dme({},e),n={};for(let i of zth)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i],delete r[i]);return[...Gte(r,t),...Gte(n,t)]}var g$l={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","Mac OS X":"macOS"};function Qth(e){if(e)return Object.prototype.hasOwnProperty.call(g$l,e)?g$l[e]:e}function Fqo(e,t){let r=Qth(e);return{...r?{"os.name":r}:{},...t?{"os.version":t}:{}}}var Mth={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},JVv=Mth.info;var tUe=class{constructor(t){this._onFire=t,this._firesAt=0}get pending(){return!!this._timer}arm(t){this.clear(),this._firesAt=Date.now()+t,this._timer=T2(()=>{this._timer=void 0,this._onFire()},t)}armNoEarlierThan(t){this._timer&&Date.now()+t<=this._firesAt||this.arm(t)}clear(){this._timer&&(clearTimeout(this._timer),this._timer=void 0)}};function l9t(){return 1-.25+Math.random()*.25*2}var V5=1;function u9t(e,t,r,n){let i=Math.min(Math.max(0,t-1),6),o=e*2**i,s=n===void 0?o:Math.min(o,Math.max(n,e));return Math.round(s*r)}var p9t=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function Nqo(e){return String(e)+"000000"}function jqo(e,t,r,n){let i="";return n&&(i=Object.keys(n).sort().map(s=>`${JSON.stringify(s)}:${JSON.stringify(n[s])}`).join(",")),`${e}\0${t}\0${r??""}\0${i}`}function A$l(e,t){for(let r=0;r<t.length;r++)if(e<=t[r])return r;return t.length}function zqo(e,t,r){return a9t(e,t,r)}function Qqo(e,t,r,n){return{resourceMetrics:[{resource:{attributes:c9t(t)},scopeMetrics:[{scope:{name:r,version:n},metrics:e}]}]}}function NZr(e){let t=e?.resourceAttributes;return{serviceName:t?.["service.name"]??e?.serviceName,serviceVersion:t?.["service.version"]??e?.serviceVersion,environment:t?.["deployment.environment"]??e?.environment,resourceAttributes:t,beforeSend:e?.beforeSend,flushIntervalMs:e?.flushIntervalMs??1e4,maxSeriesPerFlush:e?.maxSeriesPerFlush??1e3}}var y$l=1,f9t=class{constructor(t,r,n){this._instance=t,this._config=r,this._logger=n,this._series=new Map,this._flushTimer=new tUe(()=>this.flush().catch(i=>{this._logger.error("Metrics flush failed:",i)})),this._flushPromise=null,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,this._retryAfter=new $_e,this._consecutiveFlushFailures=0,this._flushJitter=V5,this._generation=0}count(t,r=1,n){this._capture({name:t,type:"count",value:r,unit:n?.unit,attributes:n?.attributes})}gauge(t,r,n){this._capture({name:t,type:"gauge",value:r,unit:n?.unit,attributes:n?.attributes})}histogram(t,r,n){this._capture({name:t,type:"histogram",value:r,unit:n?.unit,attributes:n?.attributes})}flush(){let t=this._flushPromise,n=(async()=>{t&&await t.catch(()=>{}),await this._doFlush()})().finally(()=>{this._flushPromise===n&&(this._flushPromise=null)});return this._flushPromise=n,n}drainWindow(){if(this._series.size===0)return null;let t=this._series;return this._series=new Map,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set,this._buildPayload(t)}reset(){this._generation++,this._retryAfter.reset(),this._consecutiveFlushFailures=0,this._flushJitter=V5,this._flushTimer.clear(),this._series=new Map,this._flushPromise=null,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set}_capture(t){if(this._instance.isDisabled||this._instance.optedOut)return;let r=this._runBeforeSend(t);if(r===null)return;if(!r.name||typeof r.name!="string")return void this._logger.warn("Dropping metric with empty name");if(typeof r.value!="number"||!Number.isFinite(r.value))return void this._logger.warn(`Dropping metric '${r.name}': value must be a finite number`);if(r.type==="count"&&r.value<0)return void this._logger.warn(`Dropping count '${r.name}': counters are monotonic, value must be >= 0`);let n,i;try{n=r.attributes?{...r.attributes}:void 0,i=jqo(r.type,r.name,r.unit,n)}catch(a){this._logger.warn(`Dropping metric '${r.name}': attributes could not be serialized`,a);return}let o=this._series.get(i);if(!o){if(!this._admitNewSeries())return;o={name:r.name,type:r.type,unit:r.unit,attributes:n,windowStartMs:Date.now()},this._series.set(i,o)}let s=this._typeByName.get(r.name);s===void 0?this._typeByName.set(r.name,r.type):s!==r.type&&!this._typeCollisionWarned.has(r.name)&&(this._typeCollisionWarned.add(r.name),this._logger.warn(`Metric name '${r.name}' is already used as a ${s}; recording it as a ${r.type} too will blend both series in charts. Use a distinct name.`)),this._fold(o,r.value),this._armFlushTimer()}_admitNewSeries(){return this._series.size<this._config.maxSeriesPerFlush?!0:(this._seriesCapWarned||(this._seriesCapWarned=!0,this._logger.warn(`Metric series cap reached (${this._config.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}_fold(t,r){switch(t.type){case"count":t.total=(t.total??0)+r;break;case"gauge":t.last=r;break;case"histogram":{t.hist||(t.hist={count:0,sum:0,min:r,max:r,bucketCounts:new Array(p9t.length+1).fill(0)});let n=t.hist;n.count+=1,n.sum+=r,n.min=Math.min(n.min,r),n.max=Math.max(n.max,r),n.bucketCounts[A$l(r,p9t)]+=1;break}}}_runBeforeSend(t){let r=this._config.beforeSend;if(!r)return t;let n=j3(r)?r:[r],i=t;for(let o of n)try{let s=o(i);if(!s)return this._logger.info("Metric was rejected in beforeSend function"),null;i=s}catch(s){return this._logger.error("Error in beforeSend function for metric:",s),null}return i}_armFlushTimer(){this._flushTimer.pending||this._flushTimer.arm(this._nextFlushDelay())}_nextFlushDelay(){return Math.max(u9t(this._config.flushIntervalMs,this._consecutiveFlushFailures,this._flushJitter,3e4),this._retryAfter.remainingMs())}async _doFlush(){if(this._flushTimer.clear(),this._series.size===0)return;let t=this._series;this._series=new Map,this._seriesCapWarned=!1,this._typeByName=new Map,this._typeCollisionWarned=new Set;let r=this._generation,n=await this._instance._sendMetricsBatch(this._buildPayload(t));if(r===this._generation)switch(this._retryAfter.record(n),n.kind==="retry-later"?(this._consecutiveFlushFailures++,this._flushJitter=l9t()):(this._consecutiveFlushFailures=0,this._flushJitter=V5),this._flushTimer.pending&&this._flushTimer.arm(this._nextFlushDelay()),n.kind){case"ok":return;case"retry-later":this._mergeWindowBack(t),this._flushTimer.armNoEarlierThan(this._nextFlushDelay());return;case"too-large":this._logger.warn("Metrics batch exceeded the server size limit and was dropped");return;case"fatal":this._logger.error("Failed to send metrics batch:",n.error);return}}_buildPayload(t){return Qqo(this._buildMetrics(t),zqo(this._config,this._instance.getLibraryId(),this._instance.getLibraryVersion()),this._instance.getLibraryId(),this._instance.getLibraryVersion())}_buildMetrics(t){let r=Nqo(Date.now()),n=new Map;for(let i of t.values()){let o=jqo(i.type,i.name,i.unit,void 0),s=n.get(o);s||(s={name:i.name,...i.unit&&{unit:i.unit}},i.type==="count"?s.sum={aggregationTemporality:y$l,isMonotonic:!0,dataPoints:[]}:i.type==="gauge"?s.gauge={dataPoints:[]}:s.histogram={aggregationTemporality:y$l,dataPoints:[]},n.set(o,s));let a=Gte(i.attributes??{},this._logger),c=Nqo(i.windowStartMs);if(i.type==="count"){let l={attributes:a,startTimeUnixNano:c,timeUnixNano:r,asDouble:i.total??0};s.sum.dataPoints.push(l)}else if(i.type==="gauge"){let l={attributes:a,timeUnixNano:r,asDouble:i.last??0};s.gauge.dataPoints.push(l)}else if(i.hist){let l={attributes:a,startTimeUnixNano:c,timeUnixNano:r,count:i.hist.count,sum:i.hist.sum,min:i.hist.min,max:i.hist.max,bucketCounts:i.hist.bucketCounts,explicitBounds:p9t};s.histogram.dataPoints.push(l)}}return Array.from(n.values())}_mergeWindowBack(t){for(let[r,n]of t){let i=this._series.get(r);if(!i){this._admitNewSeries()&&this._series.set(r,n);continue}switch(i.windowStartMs=Math.min(i.windowStartMs,n.windowStartMs),i.type){case"count":i.total=(i.total??0)+(n.total??0);break;case"gauge":break;case"histogram":if(n.hist)if(i.hist){i.hist.count+=n.hist.count,i.hist.sum+=n.hist.sum,i.hist.min=Math.min(i.hist.min,n.hist.min),i.hist.max=Math.max(i.hist.max,n.hist.max);for(let o=0;o<i.hist.bucketCounts.length;o++)i.hist.bucketCounts[o]+=n.hist.bucketCounts[o]}else i.hist=n.hist;break}}}};var Vth="0".repeat(32),Gth="0".repeat(16),qth=/^[0-9a-f]+$/;function Wth(e){let t=new Uint8Array(e),r=globalThis.crypto;if(r&&typeof r.getRandomValues=="function")try{return r.getRandomValues(t),t}catch{}for(let n=0;n<e;n++)t[n]=Math.floor(256*Math.random());return t}function Hth(e){let t="";for(let r=0;r<e.length;r++)t+=e[r].toString(16).padStart(2,"0");return t}function b$l(e){let t=Hth(Wth(e));return/[^0]/.test(t)?t:t.slice(0,-1)+"1"}function E$l(){return b$l(16)}function I$l(){return b$l(8)}function v$l(e,t,r){return typeof e=="string"&&e.length===t&&e!==r&&qth.test(e)}function C$l(e){return v$l(e,32,Vth)}function x$l(e){return v$l(e,16,Gth)}var Kth=/^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})(-.*)?$/;function S$l(e){let t=w$l(e);return t&&{traceId:t.traceId,spanId:t.spanId,flags:Jth(t.flags)}}function Jth(e){return 1&parseInt(e,16)?zZr:Yth}function w$l(e){if(typeof e!="string")return;let t=Kth.exec(e.trim());if(!t)return;let[,r,n,i,o,s]=t;if(r!=="ff"&&!(r==="00"&&s)&&!(!C$l(n)||!x$l(i)))return{version:r,traceId:n,spanId:i,flags:o}}function T$l(e){return w$l(e)&&e.trim()}function jZr(e){return Array.isArray(e)&&e.length===1?e[0]:e}var zZr="01",Yth="00";function O$l(e,t,r=zZr){return`00-${e}-${t}-${r}`}var Xth=32,Mqo=512;function QZr(e){if(typeof e!="string")return;let t=e.trim();if(!t||/[^\x20-\x7e\t]/.test(t))return;let r=t.split(",");if(!(r.length>Xth)){for(let n of r)if(n.trim()&&!n.includes("="))return;return t.length<=Mqo?t:$th(r)}}var Zth=128;function $th(e){let t=[...e],r=()=>t.reduce((n,i)=>n+i.length,0)+t.length-1;for(let n=t.length-1;n>=0&&r()>Mqo;n--)t[n].length>Zth&&t.splice(n,1);for(;t.length&&r()>Mqo;)t.pop();return t.length?t.join(","):void 0}var P$l="unknown";function rUe(e,t,r,n){return typeof e=="string"&&e.trim()?e.length>r?e.slice(0,r):e:(n?.debug(`${t} must be a non-empty string; using "${P$l}"`),P$l)}function ilt(e){if(e==null)return;let t=e;if(e instanceof Date)try{t=e.getTime()}catch{return}if(!(typeof t!="number"||!Number.isFinite(t))&&!(t<0||t>9223372036854))return t}function B$l(e,t,r){let n=ilt(e);return n===void 0?(e!==void 0&&r?.debug("Span startTime is out of range or not a valid time; using the current time"),t):(t-n>864e5?r?.debug("Span startTime is more than 24 hours in the past; the server will clamp it to receive time and keep the original in $originalTimestamp"):n>t&&r?.debug("Span startTime is in the future; the span may export with a zero duration"),n)}function MZr(e,t){return e<t?t:e}function d9t(e,t,r,n){let i=ilt(e);return i===void 0?(e!==void 0&&n?.debug(`Span ${r} is out of range or not a valid time; using the derived time`),t):i}function _Zr(){let e=globalThis.performance;return typeof e?.now=="function"?e.now():void 0}var olt=class{constructor(t,r,n){this._onEnd=r,this._logger=n,this._events=[],this._ended=!1,this._userAttributeCount=0,this._userEventCount=0,this._droppedAttributes=0,this._droppedEvents=0,this._traceId=t.traceId,this._spanId=t.spanId,this._parentSpanId=t.parentSpanId,this._traceState=t.traceState,this._traceFlags=t.traceFlags??zZr,this._parentIsRemote=t.parentIsRemote??!1,this._name=t.name,this._kind=t.kind,this._autoKeys=new Set(t.autoAttributeKeys),this._maxAttributes=t.maxAttributes,this._maxEvents=t.maxEvents,this._maxAttributesPerEvent=t.maxAttributesPerEvent,this._maxAttributeValueLength=t.maxAttributeValueLength,this._attributes=Object.create(null);for(let i of Object.keys(t.attributes))this._writeAttribute(i,t.attributes[i]);this._startMono=t.backdated?void 0:_Zr(),this._startTime=t.clockAnchor&&this._startMono!==void 0?t.clockAnchor.wall+(this._startMono-t.clockAnchor.mono):t.startTime,this._startMono!==void 0&&(this._clockAnchor=t.clockAnchor??{wall:this._startTime,mono:this._startMono})}_now(){if(this._startMono!==void 0){let t=_Zr();if(t!==void 0)return this._startTime+Math.max(0,t-this._startMono)}return Date.now()}_mutable(t){return this._ended?(this._logger?.debug(`Ignoring ${t} on a span that has already ended`),!1):!0}_writeAttribute(t,r){if(TK(r)){t in this._attributes&&!this._autoKeys.has(t)&&this._userAttributeCount--,delete this._attributes[t];return}if(!this._autoKeys.has(t)&&!(t in this._attributes)){if(this._userAttributeCount>=this._maxAttributes)return void this._droppedAttributes++;this._userAttributeCount++}this._attributes[t]=VZr(r,this._maxAttributeValueLength)}setAttribute(t,r){return this._mutable("setAttribute")&&this._writeAttribute(t,r),this}setAttributes(t){if(this._mutable("setAttributes")){let r=dme({},t);for(let n of Object.keys(r))this._writeAttribute(n,r[n])}return this}addEvent(t,r,n){if(this._mutable("addEvent")){if(this._userEventCount>=this._maxEvents)return this._droppedEvents++,this;this._userEventCount++;let i=r&&F$l(r,this._maxAttributesPerEvent,this._maxAttributeValueLength);this._events.push({name:rUe(t,"Span event name",this._maxAttributeValueLength,this._logger),timestamp:d9t(n,this._now(),"event timestamp",this._logger),...i&&{attributes:i.attributes,...i.dropped&&{droppedAttributesCount:i.dropped}}})}return this}setStatus(t,r){if(this._mutable("setStatus")){if(t!=="ok"&&t!=="error")return this._logger?.debug(`Ignoring unknown span status "${String(t)}"; expected "ok" or "error"`),this;this._status={code:t,...r&&{message:Lqo(r,this._maxAttributeValueLength)}}}return this}get statusIsExplicitlyOk(){return this._status?.code==="ok"}recordException(t){if(!this._mutable("recordException"))return this;let{type:r,message:n,stack:i}=_qo(t);return this.addEvent(erh,{"exception.type":r,"exception.message":n,...i&&{"exception.stacktrace":i}}),this.setStatus("error",n)}updateName(t){return this._mutable("updateName")&&(this._name=rUe(t,"Span name",this._maxAttributeValueLength,this._logger)),this}traceparent(){return O$l(this._traceId,this._spanId,this._traceFlags)}tracestate(){return this._traceState??null}childContext(){return{traceId:this._traceId,parentSpanId:this._spanId,traceState:this._traceState,traceFlags:this._traceFlags,clockAnchor:this._clockAnchor}}end(t){if(this._ended)return void this._logger?.debug("Ignoring end() on a span that has already ended");this._ended=!0;let r=this._now(),n=d9t(t,r,"end time",this._logger);this._onEnd({traceId:this._traceId,spanId:this._spanId,...this._parentSpanId&&{parentSpanId:this._parentSpanId},...this._traceState&&{traceState:this._traceState},traceFlags:this._traceFlags,parentIsRemote:this._parentIsRemote,name:this._name,kind:this._kind,...this._status&&{status:this._status},attributes:{...this._attributes},events:this._events,startTime:this._startTime,endTime:MZr(n,this._startTime),...this._droppedAttributes&&{droppedAttributesCount:this._droppedAttributes},...this._droppedEvents&&{droppedEventsCount:this._droppedEvents}},this._autoKeys)}},erh="exception",trh=4294967295;function rrh(e){try{return typeof e=="string"?e:String(e)}catch{return M5}}function nUe(e){return typeof e!="number"||!Number.isFinite(e)||e<=0?0:Math.min(Math.floor(e),trh)}function nrh(e,t){if(!t.length)return Object.keys(e);let r=t.filter(i=>Object.prototype.propertyIsEnumerable.call(e,i)),n=new Set(r);return[...r,...Object.keys(e).filter(i=>!n.has(i))]}function R$l(e,t,r,n,i,o,s=[]){let a=0,c=0,l={};for(let f of nrh(e.attributes,s)){let m=e.attributes[f];if(!TK(m)){if(!t.has(f)){if(a>=r){c++;continue}a++}Object.defineProperty(l,f,{value:VZr(m,o),enumerable:!0,writable:!0,configurable:!0})}}e.attributes=l,c&&(e.droppedAttributesCount=nUe(e.droppedAttributesCount)+c);let u=0,p=0,d=[];for(let f of e.events){if(u>=n){p++;continue}if(u++,f.attributes){let m=F$l(f.attributes,i,o);f.attributes=m.attributes,m.dropped&&(f.droppedAttributesCount=nUe(f.droppedAttributesCount)+m.dropped)}d.push(f)}e.events=d,p&&(e.droppedEventsCount=nUe(e.droppedEventsCount)+p),e.status?.message&&(e.status={...e.status,message:Lqo(rrh(e.status.message),o)})}var UZr=class{setAttribute(){return this}setAttributes(){return this}addEvent(){return this}setStatus(){return this}recordException(){return this}updateName(){return this}traceparent(){return null}tracestate(){return null}end(){}},k$l=new UZr,m9t=class extends UZr{constructor(t,r){super(),this._traceparent=t,this._tracestate=r}traceparent(){return this._traceparent}tracestate(){return this._tracestate??null}};function irh(e){try{let t=e.stack;return typeof t=="string"&&t?{stack:t}:{}}catch{return{}}}function ISe(e,t){let r=jZr(e?.parent)??t,n=typeof r=="string"||r==null?r:D$l(r,"traceparent"),i=T$l(n);if(!i)return k$l;let o=typeof r=="string"||r==null?e?.tracestate:D$l(r,"tracestate");return new m9t(i,QZr(o))}function D$l(e,t){try{let r=e[t];return typeof r=="function"?r.call(e):void 0}catch{return}}function Lqo(e,t){return e.length>t?e.slice(0,t):e}function VZr(e,t){return LZr(e,t,{ancestors:new WeakSet,remainingNodes:1e4},0)}function LZr(e,t,r,n){if(e===null||typeof e!="object")return TK(e)||r.remainingNodes<=0?e:(r.remainingNodes--,typeof e=="string"?Lqo(e,t):e);if(r.ancestors.has(e))return IZr;if(r.remainingNodes<=0||n>=20)return e;r.remainingNodes--,r.ancestors.add(e);try{if(e instanceof Date)return e;let i=orh(e);if(i.selfDescribed)return TK(i.value)?String(i.value):LZr(i.value,t,r,n+1);if(j3(e)){let a=Math.min(e.length,1e3),c=[];for(let l=0;l<a;l++)try{c.push(LZr(e[l],t,r,n+1))}catch{c.push(M5)}return e.length>a&&(c.length=e.length),c}let o={},s=0;for(let a of Object.keys(e)){if(s>=1e3)break;let c;try{c=LZr(e[a],t,r,n+1)}catch{c=M5}a&&!TK(c)&&s++,Object.defineProperty(o,a,{value:c,enumerable:!0,writable:!0,configurable:!0})}return o}catch{return e}finally{r.ancestors.delete(e)}}function orh(e){try{let t=e.toJSON;if(typeof t=="function")return{selfDescribed:!0,value:t.call(e)}}catch{}return{selfDescribed:!1}}function F$l(e,t,r){let n;try{n=Object.keys(e)}catch{return{attributes:{},dropped:0}}let i={},o=0,s=0;for(let a of n){if(o>=t){s++;continue}let c;try{c=VZr(e[a],r)}catch{c=M5}TK(c)||(o++,Object.defineProperty(i,a,{value:c,enumerable:!0,writable:!0,configurable:!0}))}return{attributes:i,dropped:s}}function N$l(e,t){for(let r of Object.keys(e))e[r]=VZr(e[r],t);return e}function h9t(e,t,r){return t===k$l?r(t):e.with(t,()=>r(t))}function _qo(e){try{let t=irh(e);if(bSe(e))return{type:e.name||"Error",message:e.message||"",...t};if(typeof e=="string")return{type:"string",message:e};if(e&&typeof e=="object"){let r=e;if(typeof r.message=="string")return{type:typeof r.name=="string"?r.name:"Object",message:r.message,...t}}return{type:typeof e,message:String(e)}}catch{return{type:typeof e,message:""}}}var Uqo={internal:1,server:2,client:3,producer:4,consumer:5},srh={ok:1,error:2},arh=1,crh=256,lrh=512;function urh(e){let t=parseInt(e.traceFlags,16);return(Number.isFinite(t)?255&t:arh)|crh|(e.parentIsRemote?lrh:0)}function GZr(e){if(typeof e=="string")return Ute(e);try{return Ute(String(e))}catch{return M5}}function prh(e){return e&&Object.prototype.hasOwnProperty.call(Uqo,e)?Uqo[e]:Uqo.internal}function Vqo(e){let t=Math.floor(e),r=Math.round((e-t)*1e6);return r>=1e6&&(t+=1,r=0),String(t)+String(r).padStart(6,"0")}function frh(e,t){let r={name:GZr(e.name),timeUnixNano:Vqo(e.timestamp)};if(e.attributes){let i=Gte(e.attributes,t);i.length&&(r.attributes=i)}let n=nUe(e.droppedAttributesCount);return n&&(r.droppedAttributesCount=n),r}function j$l(e,t){let r={traceId:e.traceId,spanId:e.spanId,name:GZr(e.name),kind:prh(e.kind),startTimeUnixNano:Vqo(e.startTime),endTimeUnixNano:Vqo(e.endTime),flags:urh(e)};e.parentSpanId&&(r.parentSpanId=e.parentSpanId),e.traceState&&(r.traceState=GZr(e.traceState));let n=Gte(e.attributes,t);n.length&&(r.attributes=n),e.events.length&&(r.events=e.events.map(s=>frh(s,t)));let i=nUe(e.droppedAttributesCount);i&&(r.droppedAttributesCount=i);let o=nUe(e.droppedEventsCount);return o&&(r.droppedEventsCount=o),e.status&&(r.status={code:srh[e.status.code],...e.status.message&&{message:GZr(e.status.message)}}),r}function z$l(e,t,r){return a9t(e,t,r)}function Q$l(e,t,r,n,i){return{resourceSpans:[{resource:{attributes:c9t(t,i)},scopeSpans:[{scope:{name:r,version:n},spans:e}]}]}}var M$l=8;function qZr(){return _Zr()??Date.now()}function Gqo(e){try{return e instanceof olt}catch{return!1}}function L$l(e,t){let r=S$l(e);if(r)return{traceId:r.traceId,parentSpanId:r.spanId,traceState:QZr(t),traceFlags:r.flags,isRemote:!0}}function drh(e){try{return typeof e.traceparent=="function"}catch{return!1}}function mrh(e){return!!e.attributes&&typeof e.attributes=="object"&&!Array.isArray(e.attributes)&&Array.isArray(e.events)&&e.name!==void 0&&e.kind!==void 0&&e.startTime!==void 0&&e.endTime!==void 0}function WZr(e,t,r){e[t]!==r&&(e[t]=r)}function hrh(e,t){try{let r=Object.getOwnPropertyDescriptors(e);for(let n of["traceId","spanId","parentSpanId","traceState"])r[n]={value:t[n],enumerable:!0,writable:!0,configurable:!0};return Object.create(Object.getPrototypeOf(e),r)}catch{return e}}var g9t=class{constructor(t,r,n,i,o,s){this._instance=t,this._config=r,this._logger=n,this._getContext=i,this._contextManager=o,this._onSpanQueued=s,this._queue=[],this._flushTimer=new tUe(()=>this._flushInBackground()),this._flushPromise=null,this._droppedSinceWarning=0,this._lastDropWarningAt=0,this._dropReasons=new Set,this._consecutiveFlushFailures=0,this._flushJitter=V5,this._retryAfter=new $_e,this._headBatchFailures=0,this._headBatchSize=0,this._headBatchChargeableAt=0,this._generation=0,this._liveSpans=new Map,this._maxExportBatchSize=r.maxExportBatchSize}startSpan(t,r){if(this._instance.isDisabled||this._instance.optedOut)return ISe(r,this._contextManager.active());let n=jZr(r?.parent);if(n&&typeof n!="string"&&!Gqo(n)){if(drh(n))return this._logger.debug("Span parent is not a span from this SDK; returning an inert span"),ISe(r,this._contextManager.active());this._logger.debug("Ignoring an unusable span parent")}let i=this._resolveParent(n,r);if(this._liveSpans.size>=this._config.maxLiveSpans&&this._evictAgedSpans(),this._liveSpans.size>=this._config.maxLiveSpans)return this._recordDrop(1,`the live-span limit (${this._config.maxLiveSpans}) was reached \u2014 spans are being started and never ended`),ISe(r,this._contextManager.active());let o=Date.now(),s=B$l(r?.startTime,o,this._logger),a=I$l();this._liveSpans.set(a,qZr());let c=this._autoContextAttributes();return new olt({traceId:i?.traceId??E$l(),spanId:a,parentSpanId:i?.parentSpanId,traceState:i?.traceState,traceFlags:i?.traceFlags,parentIsRemote:i?.isRemote,name:rUe(t,"Span name",this._config.maxAttributeValueLength,this._logger),kind:r?.kind??"internal",attributes:dme({...c},r?.attributes),autoAttributeKeys:Object.keys(c),maxAttributes:this._config.maxAttributesPerSpan,maxEvents:this._config.maxEventsPerSpan,maxAttributesPerEvent:this._config.maxAttributesPerEvent,maxAttributeValueLength:this._config.maxAttributeValueLength,startTime:s,backdated:s!==o,clockAnchor:ilt(r?.startTime)===void 0?i?.clockAnchor:void 0},(l,u)=>this._onSpanEnd(l,u),this._logger)}withSpan(t,r,n){let i=typeof r=="function"?void 0:r,o=typeof r=="function"?r:n,s=this.startSpan(t,i);try{let a=h9t(this._contextManager,s,o);return QZl(a)?a.then(c=>(s.end(),c),c=>{throw this._recordCallbackError(s,c),s.end(),c}):(s.end(),a)}catch(a){throw this._recordCallbackError(s,a),s.end(),a}}getActiveSpan(){return this._contextManager.active()??null}get throttled(){return this._retryAfter.isOpen()}async flush(){for(;;)if(!this._queue.length||!await(this._flushPromise??this._startFlush()))return}_startFlush(){this._flushTimer.clear();let t=this._generation,r=Promise.resolve().then(()=>t===this._generation?this._flushInner():0).finally(()=>{this._flushPromise===r&&(this._flushPromise=null),this._armFlushTimerIfQueuedNoEarlierThan()});return this._flushPromise=r,r}reset(){this._flushTimer.clear(),this._queue.length&&this._logger.critical(`Discarding ${this._queue.length} span(s) that were still queued when tracing was shut down. Raise the shutdown timeout or flush earlier if they matter.`),this._queue=[],this._liveSpans.clear(),this._flushPromise=null,this._generation++,this._maxExportBatchSize=this._config.maxExportBatchSize,this._droppedSinceWarning=0,this._dropReasons.clear(),this._lastDropWarningAt=0,this._consecutiveFlushFailures=0,this._flushJitter=V5,this._retryAfter.reset(),this._resetHeadBatchBudget()}_resetHeadBatchBudget(){this._headBatchFailures=0,this._headBatchChargeableAt=0}_resolveParent(t,r){if(typeof t=="string"){let i=L$l(t,r?.tracestate);return i||this._logger.debug("Ignoring malformed traceparent; starting a new trace"),i}if(Gqo(t))return t.childContext();let n=this._contextManager.active();if(Gqo(n))return n.childContext();if(n instanceof m9t)return L$l(n.traceparent(),n.tracestate()??void 0)}_autoContextAttributes(){let t;try{t=this._getContext()}catch(n){return this._logger.debug("Failed to read tracing context; span will carry no PostHog attributes",n),{}}let r={};return t.distinctId&&(r.posthogDistinctId=t.distinctId),t.sessionId&&(r.sessionId=t.sessionId),t.currentUrl&&(r["url.full"]=t.currentUrl),t.screenName&&(r["screen.name"]=t.screenName),t.appState&&(r["app.state"]=t.appState),r}_recordCallbackError(t,r){if(!(t instanceof olt))return;let{type:n,message:i,stack:o}=_qo(r);t.addEvent("exception",{"exception.type":n,"exception.message":i,...o&&{"exception.stacktrace":o}}),t.statusIsExplicitlyOk||t.setStatus("error",i)}_evictAgedSpans(){let t=qZr()-this._config.maxSpanAgeMs,r=0;for(let[n,i]of this._liveSpans){if(i>t)break;this._liveSpans.delete(n),r++}r&&this._recordDrop(r,`they were still live after ${this._config.maxSpanAgeMs}ms`)}_onSpanEnd(t,r){if(!this._liveSpans.delete(t.spanId))return;if(this._instance.isDisabled||this._instance.optedOut)return void this._recordDrop(1,"the user has opted out");let n=this._runBeforeSpanSend(t,r);if(n){if(this._reportLimitDrops(n),this._queue.length>=this._config.maxQueueSize)return void this._recordDrop(1,`the queue is full (${this._config.maxQueueSize}) \u2014 raise the flush frequency or reduce span volume`);this._queue.push(n);try{this._onSpanQueued?.()}catch(i){this._logger.debug("Span queue notification failed",i)}!(this._queue.length>=this._maxExportBatchSize)||this._consecutiveFlushFailures||this._retryAfter.isOpen()?this._armFlushTimerIfQueued():this._flushInBackground()}}_reportLimitDrops(t){let r=t.droppedAttributesCount??0,n=t.droppedEventsCount??0,i=0;for(let o of t.events)i+=o.droppedAttributesCount??0;(r||n||i)&&this._logger.debug(`Span limits discarded data from "${t.name}": ${r} attributes, ${n} events, ${i} event attributes`)}_runBeforeSpanSend(t,r){if(!this._config.beforeSpanSend.length)return t;let n={traceId:t.traceId,spanId:t.spanId,parentSpanId:t.parentSpanId,traceState:t.traceState},i={startTime:t.startTime,endTime:t.endTime},o={attributes:t.droppedAttributesCount,events:t.droppedEventsCount},s=Object.keys(t.attributes),a={traceFlags:t.traceFlags,parentIsRemote:t.parentIsRemote},c=t.status&&{...t.status},l=t,u=t;try{for(let f of this._config.beforeSpanSend){let m=f(l);if(!m)return this._recordDrop(1,"beforeSpanSend dropped it"),null;l=this._keepSpanIdentity(m,n)}if(u={traceId:n.traceId,spanId:n.spanId,parentSpanId:n.parentSpanId,traceState:n.traceState,name:l.name,kind:l.kind,status:l.status,attributes:l.attributes,events:l.events,startTime:l.startTime,endTime:l.endTime,traceFlags:a.traceFlags,parentIsRemote:a.parentIsRemote,droppedAttributesCount:o.attributes,droppedEventsCount:o.events},!mrh(u))return this._logger.debug("beforeSpanSend did not return a span record; dropping the span"),this._recordDrop(1,"beforeSpanSend returned an unusable record"),null;u.name=rUe(u.name,"Span name",this._config.maxAttributeValueLength,this._logger),u.status&&u.status.code!=="ok"&&u.status.code!=="error"&&(this._logger.debug("beforeSpanSend set an unknown span status; keeping the original"),u.status=c),u.startTime=ilt(u.startTime)??i.startTime,u.endTime=MZr(ilt(u.endTime)??i.endTime,u.startTime);let d=[];for(let f of u.events)try{d.push({...f,name:rUe(f.name,"Span event name",this._config.maxAttributeValueLength,this._logger),timestamp:d9t(f.timestamp,u.startTime,"event timestamp",this._logger)})}catch{this._logger.debug("beforeSpanSend left an unreadable span event; dropping it")}return u.events=d,R$l(u,r,this._config.maxAttributesPerSpan,this._config.maxEventsPerSpan,this._config.maxAttributesPerEvent,this._config.maxAttributeValueLength,s),u}catch(p){return this._logger.debug("beforeSpanSend failed; dropping the span rather than exporting it unscrubbed",p),this._recordDrop(1,"beforeSpanSend failed"),null}}_keepSpanIdentity(t,r){(t.traceId!==r.traceId||t.spanId!==r.spanId||t.parentSpanId!==r.parentSpanId)&&this._logger.debug("beforeSpanSend changed a span identity field; keeping the original ids");try{WZr(t,"traceId",r.traceId),WZr(t,"spanId",r.spanId),WZr(t,"parentSpanId",r.parentSpanId),WZr(t,"traceState",r.traceState)}catch{return hrh(t,r)}return t}_recordDrop(t,r){this._droppedSinceWarning+=t,this._dropReasons.add(r),Date.now()-this._lastDropWarningAt>=this._config.flushIntervalMs&&this._warnAboutDrops()}_warnAboutDrops(){this._droppedSinceWarning&&(this._lastDropWarningAt=Date.now(),this._logger.warn(`Dropping ${this._droppedSinceWarning} span(s): ${[...this._dropReasons].join("; ")}`),this._droppedSinceWarning=0,this._dropReasons.clear())}_encodeBatch(t){let r=[];for(let n of t)try{r.push(j$l(n,this._logger))}catch(i){this._logger.debug("Failed to encode a span; dropping it",i),this._recordDrop(1,"its attributes could not be encoded")}return r}_discardQueueIfConsentWithdrawn(){if(!this._instance.isDisabled&&!this._instance.optedOut)return 0;let t=this._queue.length;return this._queue=[],this._resetHeadBatchBudget(),this._recordDrop(t,"the user has opted out"),this._warnAboutDrops(),t}async _flushInner(){if(!this._queue.length)return 0;let t=this._discardQueueIfConsentWithdrawn();if(t)return t;let r=N$l(z$l(this._config,this._instance.getLibraryId(),this._instance.getLibraryVersion()),this._config.maxAttributeValueLength),n=this._instance.getLibraryId(),i=this._instance.getLibraryVersion(),o=this._queue.length,s=0,a=1/0,c=this._generation;try{for(;o>0&&this._queue.length>0;){let l=this._discardQueueIfConsentWithdrawn();if(l)return s+l;let u=this._headBatchFailures>0?Math.min(this._maxExportBatchSize,this._headBatchSize):this._maxExportBatchSize,p=Math.max(1,Math.min(u,a,o,this._queue.length)),d=this._queue.slice(0,p),f=this._encodeBatch(d);if(!f.length){this._queue.splice(0,p),o-=p,s+=p,this._resetHeadBatchBudget();continue}let m=qZr()>=this._headBatchChargeableAt&&!this._retryAfter.isOpen(),g=await this._instance._sendTracesBatch(Q$l(f,r,n,i,this._logger));if(c!==this._generation)break;if(this._retryAfter.record(g),g.kind==="ok"){this._consecutiveFlushFailures=0,this._flushJitter=V5,this._resetHeadBatchBudget(),this._queue.splice(0,p),o-=p,s+=p,this._maxExportBatchSize<this._config.maxExportBatchSize&&this._maxExportBatchSize++;continue}if(g.kind==="too-large"){if(p===1){this._queue.splice(0,1),o-=1,s+=1,this._recordDrop(1,"it is too large for the ingestion endpoint"),this._consecutiveFlushFailures=0,this._flushJitter=V5,this._resetHeadBatchBudget();continue}let A=Math.max(1,Math.floor(p/2));g.measuredLocally?a=A:this._maxExportBatchSize=A,this._resetHeadBatchBudget(),this._logger.debug(`Batch too large; retrying the same spans in batches of ${A}`);continue}if(g.kind==="retry-later"){if(this._consecutiveFlushFailures++,this._flushJitter=l9t(),this._headBatchSize=p,m&&(this._headBatchFailures++,this._headBatchChargeableAt=qZr()+this._nextFlushDelay()),this._headBatchFailures<M$l)return this._logger.debug("Span export failed; retrying on the next flush",g.error),s;if(this._queue.splice(0,p),o-=p,s+=p,this._consecutiveFlushFailures=0,this._flushJitter=V5,this._resetHeadBatchBudget(),this._recordDrop(p,`the ingestion endpoint failed ${M$l} times in a row`),this._retryAfter.isOpen())return s;continue}this._logger.debug("Dropping a span batch the ingestion endpoint rejected",g.error),this._queue.splice(0,p),o-=p,s+=p,this._consecutiveFlushFailures=0,this._flushJitter=V5,this._resetHeadBatchBudget(),this._recordDrop(p,"the ingestion endpoint rejected the batch")}return s}finally{this._warnAboutDrops()}}_flushInBackground(){this._backgroundFlush||(this._backgroundFlush=this.flush().catch(t=>{this._logger.debug("Background span flush failed",t)}).finally(()=>{this._backgroundFlush=void 0,this._armFlushTimerIfQueuedNoEarlierThan()}))}_armFlushTimerIfQueued(){this._flushTimer.pending||!this._queue.length||this._flushTimer.arm(this._nextFlushDelay())}_armFlushTimerIfQueuedNoEarlierThan(){this._queue.length&&this._flushTimer.armNoEarlierThan(this._nextFlushDelay())}_nextFlushDelay(){return Math.max(u9t(this._config.flushIntervalMs,this._consecutiveFlushFailures,this._flushJitter,3e4),this._retryAfter.remainingMs())}};var A9t=class{active(){return this._active}with(t,r){let n=this._active;this._active=t;try{return r()}finally{this._active=n}}};var grh=5e3,Arh=512,yrh=2048,brh=128,Erh=128,Irh=128,vrh=8192,Crh=1e4,xrh=36e5;function vSe(e,t){return typeof e=="number"&&Number.isInteger(e)&&e>=1?e:t}var _$l=["service.name","service.version","deployment.environment"];function Srh(e){if(!(!e||typeof e!="object"||Array.isArray(e)))try{if(_$l.every(r=>!(r in e)||typeof e[r]=="string"))return e;let t={...e};for(let r of _$l)r in t&&typeof t[r]!="string"&&delete t[r];return t}catch{return}}function wrh(e,t){if(!e)return[];let r=[e].flat().filter(i=>!!i),n=r.filter(i=>typeof i=="function");return n.length!==r.length&&t?.critical(`beforeSpanSend: ignoring ${r.length-n.length} of ${r.length} entries that are not functions. Spans export without them, so whatever they were redacting is not redacted.`),n}function qqo(e,t,r){let n=dme({...t},Srh(e?.resourceAttributes)),i=vSe(e?.maxExportBatchSize,Arh);return{serviceName:n?.["service.name"]??e?.serviceName,serviceVersion:n?.["service.version"]??e?.serviceVersion,environment:n?.["deployment.environment"]??e?.environment,resourceAttributes:n,beforeSpanSend:wrh(e?.beforeSpanSend,r),maxAttributesPerSpan:vSe(e?.maxAttributesPerSpan,brh),maxEventsPerSpan:vSe(e?.maxEventsPerSpan,Erh),maxAttributesPerEvent:Irh,maxAttributeValueLength:vSe(e?.maxAttributeValueLength,vrh),flushIntervalMs:vSe(e?.flushIntervalMs,grh),maxExportBatchSize:i,maxQueueSize:Math.max(vSe(e?.maxQueueSize,yrh),i),maxLiveSpans:vSe(e?.maxLiveSpans,Crh),maxSpanAgeMs:vSe(e?.maxSpanAgeMs,xrh)}}var Wqo=require("fs"),G$l=require("fs/promises"),Kqo=require("path"),q$l=require("readline"),HZr=new mT.ReduceableCache(25),y9t=new mT.ReduceableCache(20),Jqo=7,Trh=1e3,Orh=1e4,Hqo=10485760;async function W$l(e,t=G$l.open,r){let n={},i;try{i=process.cwd()}catch{}for(let a=e.length-1;a>=0;a--){let c=e[a],l=c?.filename;if(!c||typeof l!="string"||typeof c.lineno!="number"||krh(l)||Frh(c)||!(0,Kqo.isAbsolute)(l)&&i===void 0)continue;n[l]||(n[l]=[]),n[l].push(c.lineno)}let o=Object.keys(n);if(o.length==0)return e;let s=[];for(let a of o){let c=H$l(a,i);if(c===void 0||y9t.get(c))continue;let l=n[a];if(!l)continue;l.sort((d,f)=>d-f);let u=jrh(l);if(u.every(d=>Nrh(c,d)))continue;let p=zrh(HZr,c,{});s.push(Brh(a,u,p,c,t,r))}return await Promise.all(s).catch(()=>{}),e&&e.length>0&&Drh(e,HZr,i),HZr.reduce(),e}async function Prh(e,t,r){let n,i=!1;try{n=await t(e,Wqo.constants.O_RDONLY|Wqo.constants.O_NONBLOCK);let o=await n.stat();return o.isFile()?o.size>Hqo?void r?.debug(`Skipping source context for oversized file ${e}: ${o.size} bytes exceeds ${Hqo}`):(i=!0,n):void 0}catch{return}finally{n&&!i&&await n.close().catch(()=>{})}}async function Brh(e,t,r,n,i,o){let s=await Prh(e,i,o);if(s===void 0)return void y9t.set(n,1);let a=s;return new Promise(c=>{let l=!1;function u(C){l||(l=!0,C?.destroy(),a.close().then(c,c))}let p;try{p=a.createReadStream({autoClose:!1,start:0,end:Hqo-1})}catch{y9t.set(n,1),u();return}let d;try{d=(0,q$l.createInterface)({input:p})}catch{y9t.set(n,1),u(p);return}let f=0,m=0,g=t[m];if(g===void 0)return void u(p);let A=g[0],y=g[1];function I(){y9t.set(n,1),d.close(),d.removeAllListeners(),u(p)}p.on("error",I),d.on("error",I),d.on("close",()=>u(p)),d.on("line",C=>{if(f++,!(f<A)&&(r[f]=Qrh(C,0),f>=y)){if(m===t.length-1){d.close(),d.removeAllListeners();return}m++;let x=t[m];if(x===void 0){d.close(),d.removeAllListeners();return}A=x[0],y=x[1]}})})}function Drh(e,t,r){for(let n of e)if(n.filename&&n.context_line===void 0&&typeof n.lineno=="number"){let i=H$l(n.filename,r),o=i===void 0?void 0:t.get(i);if(o===void 0)continue;Rrh(n.lineno,n,o)}}function Rrh(e,t,r){if(t.lineno===void 0||r===void 0)return;t.pre_context=[];for(let i=K$l(e);i<e;i++){let o=r[i];if(o===void 0)return void U$l(t);t.pre_context.push(o)}if(r[e]===void 0)return void U$l(t);t.context_line=r[e];let n=J$l(e);t.post_context=[];for(let i=e+1;i<=n;i++){let o=r[i];if(o===void 0)break;t.post_context.push(o)}}function U$l(e){delete e.pre_context,delete e.context_line,delete e.post_context}function krh(e){return e.startsWith("node:")||e.endsWith(".min.js")||e.endsWith(".min.cjs")||e.endsWith(".min.mjs")||e.startsWith("data:")}function Frh(e){return e.lineno!==void 0&&e.lineno>Orh||e.colno!==void 0&&e.colno>Trh}function H$l(e,t){return(0,Kqo.isAbsolute)(e)?JSON.stringify([null,e]):t===void 0?void 0:JSON.stringify([t,e])}function Nrh(e,t){let r=HZr.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 jrh(e){if(!e.length)return[];let t=0,r=e[0];if(typeof r!="number")return[];let n=V$l(r),i=[];for(;;){if(t===e.length-1){i.push(n);break}let o=e[t+1];if(typeof o!="number")break;o<=n[1]?n[1]=o+Jqo:(i.push(n),n=V$l(o)),t++}return i}function V$l(e){return[K$l(e),J$l(e)]}function K$l(e){return Math.max(1,e-Jqo)}function J$l(e){return e+Jqo}function zrh(e,t,r){let n=e.get(t);return n===void 0?(e.set(t,r),r):n}function Qrh(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 o=Math.min(i+140,n);return o>n-5&&(o=n),o===n&&(i=Math.max(o-140,0)),r=r.slice(i,o),i>0&&(r=`...${r}`),o<n&&(r+="..."),r}var slt=require("path");function Y$l(e=process.cwd()){let t=slt.sep==="\\",r=i=>t?i.replace(/\\/g,"/"):i,n=r(e);return async i=>{for(let o of i)!o.filename||o.filename.startsWith("node:")||o.filename.startsWith("data:")||(0,slt.isAbsolute)(o.filename)&&(o.filename=r((0,slt.relative)(n,r(o.filename))));return i}}var X$l="5.55.0";var hme={ERRORS_WHILE_COMPUTING:"errors_while_computing_flags",FLAG_MISSING:"flag_missing",QUOTA_LIMITED:"quota_limited",UNKNOWN_ERROR:"unknown_error"};var CSe=class e{constructor(t){this._host=t.host,this._distinctId=t.distinctId,this._groups=t.groups,this._disableGeoip=t.disableGeoip,this._flags=t.flags,this._requestId=t.requestId,this._evaluatedAt=t.evaluatedAt,this._flagDefinitionsLoadedAt=t.flagDefinitionsLoadedAt,this._errorsWhileComputing=t.errorsWhileComputing??!1,this._quotaLimited=t.quotaLimited??!1,this._accessed=t.accessed??new Set,this._isSlice=t.isSlice??!1}isEnabled(t,r={}){let n=this._flags[t];return this._recordAccess(t),n?.enabled??r.defaultValue??!1}getFlag(t){let r=this._flags[t];if(this._recordAccess(t),!!r)return r.enabled?r.variant??!0:!1}getFlagPayload(t){return this._flags[t]?.payload}onlyAccessed(){let t={};for(let r of this._accessed){let n=this._flags[r];n&&(t[r]=n)}return this._cloneWith(t)}only(t){let r={},n=[];for(let i of t){let o=this._flags[i];o?r[i]=o:n.push(i)}return n.length>0&&this._host.logWarning(`FeatureFlagEvaluations.only() was called with flag keys that are not in the evaluation set and will be dropped: ${n.join(", ")}`),this._cloneWith(r)}get keys(){return Object.keys(this._flags)}_getEventProperties(){let t={},r=[];for(let[n,i]of Object.entries(this._flags)){let o=i.enabled===!1?!1:i.variant??!0;t[`$feature/${n}`]=o,i.enabled&&r.push(n)}return r.length>0&&(r.sort(),t.$active_feature_flags=r),t}_cloneWith(t){return new e({host:this._host,distinctId:this._distinctId,groups:this._groups,disableGeoip:this._disableGeoip,flags:t,requestId:this._requestId,evaluatedAt:this._evaluatedAt,flagDefinitionsLoadedAt:this._flagDefinitionsLoadedAt,errorsWhileComputing:this._errorsWhileComputing,quotaLimited:this._quotaLimited,accessed:new Set(this._accessed),isSlice:!0})}_recordAccess(t){if(this._accessed.add(t),this._distinctId===""||this._isSlice&&!(t in this._flags))return;let r=this._flags[t],n=r===void 0?void 0:r.enabled===!1?!1:r.variant??!0,i={$feature_flag:t,$feature_flag_response:n,$feature_flag_id:r?.id,$feature_flag_version:r?.version,$feature_flag_reason:r?.reason,locally_evaluated:r?.locallyEvaluated??!1,[`$feature/${t}`]:n,$feature_flag_request_id:this._requestId,$feature_flag_evaluated_at:r?.locallyEvaluated?Date.now():this._evaluatedAt};r?.hasExperiment!==void 0&&(i.$feature_flag_has_experiment=r.hasExperiment),r?.locallyEvaluated&&this._flagDefinitionsLoadedAt!==void 0&&(i.$feature_flag_definitions_loaded_at=this._flagDefinitionsLoadedAt);let o=[];this._errorsWhileComputing&&o.push(hme.ERRORS_WHILE_COMPUTING),this._quotaLimited&&o.push(hme.QUOTA_LIMITED),r===void 0&&o.push(hme.FLAG_MISSING),o.length>0&&(i.$feature_flag_error=o.join(",")),this._host.captureFlagCalledEventIfNeeded({distinctId:this._distinctId,key:t,response:n,groups:this._groups,disableGeoip:this._disableGeoip,properties:i})}};var Mrh=6e4;function Z$l(e){return e==="client"||e==="server"?e:"all"}function Lrh(e,t){return e===t||e==="all"||t==="all"}var alt=class e extends Error{constructor(t){super(),Error.captureStackTrace(this,this.constructor),this.name="ClientError",this.message=t,Object.setPrototypeOf(this,e.prototype)}};function _rh(e,t){e.name=t.name,Error.captureStackTrace(e,t),Object.setPrototypeOf(e,t.prototype)}var qte=class e extends Error{constructor(t){super(t),_rh(this,e)}},KZr=class{constructor({pollingInterval:t,personalApiKey:r,projectApiKey:n,timeout:i,host:o,customHeaders:s,...a}){this.debugMode=!1,this.shouldBeginExponentialBackoff=!1,this.backOffCount=0,this.pollerStopped=!1,this.filteredOutFlagKeys=new Set,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=o,this.poller=void 0,this.fetch=a.fetch||fetch,this.onError=a.onError,this.customHeaders=s,this.onLoad=a.onLoad,this.onMinimalFlagCalledEvents=a.onMinimalFlagCalledEvents,this.cacheProvider=a.cacheProvider,this.strictLocalEvaluation=a.strictLocalEvaluation??!1,this.evaluationContexts=a.evaluationContexts,this.loadFeatureFlags()}debug(t=!0){this.debugMode=t}logMsgIfDebug(t){this.debugMode&&t()}withEvaluationSnapshot(t){return t.definitions?t:{...t,evaluationCache:{},definitions:{featureFlagsByKey:this.featureFlagsByKey,groupTypeMapping:this.groupTypeMapping,cohorts:this.cohorts,filteredOutFlagKeys:this.filteredOutFlagKeys,propertyMatchingVersion:this.propertyMatchingVersion}}}createEvaluationContext(t,r={},n={},i={},o={}){return{distinctId:t,groups:r,personProperties:n,groupProperties:i,evaluationCache:o}}async getFeatureFlag(t,r,n={},i={},o={}){await this.loadFeatureFlags();let s,a;if(!this.loadedSuccessfullyOnce)return s;if(a=this.featureFlagsByKey[t],a!==void 0){let c=this.createEvaluationContext(r,n,i,o);try{s=(await this.computeFlagAndPayloadLocally(a,c)).value,this.logMsgIfDebug(()=>console.debug(`Successfully computed flag locally: ${t} -> ${s}`))}catch(l){l instanceof qte||l instanceof Ml?this.logMsgIfDebug(()=>console.debug(`${l.name} when computing flag locally: ${t}: ${l.message}`)):l instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${t}: ${l}`))}}return s}async getAllFlagsAndPayloads(t,r){await this.loadFeatureFlags();let n={},i={},o=this.featureFlags.length==0,s=r?r.map(c=>this.featureFlagsByKey[c]).filter(Boolean):this.featureFlags,a=this.withEvaluationSnapshot({...t,definitions:void 0});return await Promise.all(s.map(async c=>{try{let{value:l,payload:u}=await this.computeFlagAndPayloadLocally(c,a,{skipLoadCheck:!0});n[c.key]=l,u&&(i[c.key]=u)}catch(l){l instanceof qte||l instanceof Ml?this.logMsgIfDebug(()=>console.debug(`${l.name} when computing flag locally: ${c.key}: ${l.message}`)):l instanceof Error&&this.onError?.(new Error(`Error computing flag locally: ${c.key}: ${l}`)),o=!0}})),{response:n,payloads:i,fallbackToFlags:o}}async computeFlagAndPayloadLocally(t,r,n={}){let{matchValue:i,skipLoadCheck:o=!1}=n;if(this.loadedSuccessfullyOnce&&(r=this.withEvaluationSnapshot(r)),o||await this.loadFeatureFlags(),!this.loadedSuccessfullyOnce)return{value:!1,payload:null};r=this.withEvaluationSnapshot(r),t=r.definitions.featureFlagsByKey[t.key]??t;let s;s=i!==void 0?i:await this.computeFlagValueLocally(t,r);let a=Bqo(t.filters?.payloads,s);return{value:s,payload:a}}async computeFlagValueLocally(t,r){let{distinctId:n,groups:i,personProperties:o,groupProperties:s}=r;if(!t.active)return!1;if(t.ensure_experience_continuity)throw new Ml("Flag has experience continuity enabled");let c=(t.filters||{}).aggregation_group_type_index;if(c!=null){let l=r.definitions.groupTypeMapping[String(c)];if(!l)throw this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Unknown group type index ${c} for feature flag ${t.key}`)),new Ml("Flag has unknown group type index");if(!(l in i))return this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Can't compute group feature flag: ${t.key} without group names passed in`)),!1;t.bucketing_identifier==="device_id"&&(o?.$device_id===void 0||o?.$device_id===null||o?.$device_id==="")&&this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Ignoring bucketing_identifier for group flag: ${t.key}`));let u=s[l];return await this.matchFeatureFlagProperties(t,i[l],u,r)}{let l=this.getBucketingValueForFlag(t,n,o);if(l===void 0)throw this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Can't compute feature flag: ${t.key} without $device_id, falling back to server evaluation`)),new Ml(`Can't compute feature flag: ${t.key} without $device_id`);return await this.matchFeatureFlagProperties(t,l,o,r)}}getBucketingValueForFlag(t,r,n){if(t.filters?.aggregation_group_type_index!=null)return r;if(t.bucketing_identifier==="device_id"){let i=n?.$device_id;return i==null||i===""?void 0:i}return r}async evaluateFlagDependency(t,r,n){let{evaluationCache:i}=n,o=t.key;if(!n.definitions.featureFlagsByKey)throw new Ml("Feature flags not available for dependency evaluation");if(!("dependency_chain"in t))throw new Ml(`Flag dependency property for '${o}' is missing required 'dependency_chain' field`);let s=t.dependency_chain;if(!Array.isArray(s))throw new Ml(`Flag dependency property for '${o}' has an invalid 'dependency_chain' (expected array, got ${typeof s})`);if(s.length===0)throw new Ml(`Circular dependency detected for flag '${o}' (empty dependency chain)`);for(let c of s){if(!(c in i)){let u=n.definitions.featureFlagsByKey[c];if(u)if(u.active)try{let p=await this.computeFlagValueLocally(u,n);i[c]=p}catch(p){throw new Ml(`Error evaluating flag dependency '${c}' for flag '${o}': ${p}`)}else i[c]=!1;else if(n.definitions.filteredOutFlagKeys.has(c))i[c]=!1;else throw new Ml(`Missing flag dependency '${c}' for flag '${o}'`)}if(i[c]==null)throw new Ml(`Dependency '${c}' could not be evaluated`)}let a=i[o];return this.flagEvaluatesToExpectedValue(t.value,a)}flagEvaluatesToExpectedValue(t,r){return typeof t=="boolean"?t===r||typeof r=="string"&&r!==""&&t===!0:typeof t=="string"?r===t:!1}async matchFeatureFlagProperties(t,r,n,i){i=this.withEvaluationSnapshot(i);let o=t.filters||{},s=await Oqo(o.holdout,r);if(s!==void 0)return s;let a=o.groups||[],c=o.aggregation_group_type_index,l=o.early_exit??!1,{groups:u,groupProperties:p}=i,d=!1,f;for(let m of a)try{let g=m.aggregation_group_type_index!==void 0?m.aggregation_group_type_index:c,A=n,y=r;if(g!==c&&g!=null){let C=i.definitions.groupTypeMapping[String(g)];if(!C||!(C in u)){this.logMsgIfDebug(()=>console.debug(`[FEATURE FLAGS] Skipping group condition for flag '${t.key}': group type index ${g} not available`));continue}if(!(C in p)){d=!0;continue}A=p[C],y=u[C]}let I=await this.isConditionMatch(t,y,m,A,i);if(I==="match"){let C=m.variant,x=o.multivariate?.variants||[];f=C&&x.some(S=>S.key===C)?C:await this.getMatchingVariant(t,y)||!0;break}if(l&&I==="out_of_rollout_bound"){if(d)break;return!1}}catch(g){if(g instanceof qte)throw g;if(g instanceof Ml)d=!0;else throw g}if(f!==void 0)return f;if(d)throw new Ml("Can't determine if feature flag is enabled or not with given properties");return!1}async isConditionMatch(t,r,n,i,o){o=this.withEvaluationSnapshot(o);let s=o.definitions,a=n.rollout_percentage,c=l=>{this.logMsgIfDebug(()=>console.warn(l))};if((n.properties||[]).length>0){for(let l of n.properties){let u=l.type,p=!1;if(u==="cohort"){let d=await eeu(l,i,s.cohorts,this.debugMode,f=>this.evaluateFlagDependency(f,i,o),s.propertyMatchingVersion);p=l.operator==="not_in"?!d:d}else p=u==="flag"?await this.evaluateFlagDependency(l,i,o):$$l(l,i,c,s.propertyMatchingVersion);if(!p)return"no_match"}if(a==null)return"match"}return a!=null&&await o9t(t.key,r)>a/100?"out_of_rollout_bound":"match"}async getMatchingVariant(t,r){return Pqo(t.key,r,t.filters?.multivariate?.variants||[])}variantLookupTable(t){return kZr(t.filters?.multivariate?.variants||[])}filterFlagsByEvaluationContexts(t){if(!this.evaluationContexts||this.evaluationContexts.length===0)return t;let r=new Set(this.evaluationContexts);return t.filter(n=>{let i=n.evaluation_contexts??n.evaluation_tags;return!i||i.length===0?!0:i.some(o=>r.has(o))})}getEvaluationRuntimeForFlag(t){let r=this.featureFlagsByKey[t];return r?Z$l(r.evaluation_runtime):void 0}getFlagKeysByEvaluationRuntime(t){return this.featureFlags.filter(r=>Lrh(Z$l(r.evaluation_runtime),t)).map(r=>r.key)}updateFlagState(t){let r=this.filterFlagsByEvaluationContexts(t.flags);this.featureFlags=r,this.featureFlagsByKey=r.reduce((i,o)=>(i[o.key]=o,i),{});let n=new Set(r.map(i=>i.key));this.filteredOutFlagKeys=new Set(t.flags.filter(i=>!n.has(i.key)).map(i=>i.key)),this.groupTypeMapping=t.group_type_mapping??t.groupTypeMapping??{},this.cohorts=t.cohorts,this.propertyMatchingVersion=t.property_matching_version??t.propertyMatchingVersion,this.loadedSuccessfullyOnce=!0,this.onMinimalFlagCalledEvents?.((t.minimal_flag_called_events??t.minimalFlagCalledEvents)===!0)}warnAboutExperienceContinuityFlags(t){if(this.strictLocalEvaluation)return;let r=t.filter(n=>n.ensure_experience_continuity);r.length>0&&console.warn(`[PostHog] You are using local evaluation but ${r.length} flag(s) have experience continuity enabled: ${r.map(n=>n.key).join(", ")}. Experience continuity is incompatible with local evaluation and will cause a server request on every flag evaluation, negating local evaluation cost savings. To avoid server requests and unexpected costs, either disable experience continuity on these flags in PostHog, use strictLocalEvaluation: true in client init, or pass onlyEvaluateLocally: true per flag call (flags that cannot be evaluated locally will return undefined).`)}async loadFromCache(t){if(!this.cacheProvider)return!1;try{let r=await this.cacheProvider.getFlagDefinitions();return r?(this.updateFlagState(r),this.logMsgIfDebug(()=>console.debug(`[FEATURE FLAGS] ${t} (${r.flags.length} flags)`)),this.onLoad?.(this.featureFlags.length),this.warnAboutExperienceContinuityFlags(this.featureFlags),!0):!1}catch(r){return this.onError?.(new Error(`Failed to load from cache: ${r}`)),!1}}async loadFeatureFlags(t=!1){if(!(this.loadedSuccessfullyOnce&&!t))return!t&&this.nextFetchAllowedAt&&Date.now()<this.nextFetchAllowedAt?void this.logMsgIfDebug(()=>console.debug("[FEATURE FLAGS] Skipping fetch, in backoff period")):(this.loadingPromise||(this.loadingPromise=this._loadFeatureFlags().catch(r=>this.logMsgIfDebug(()=>console.debug(`[FEATURE FLAGS] Failed to load feature flags: ${r}`))).finally(()=>{this.loadingPromise=void 0})),this.loadingPromise)}isLocalEvaluationReady(){return(this.loadedSuccessfullyOnce??!1)&&(this.featureFlags?.length??0)>0}getFlagDefinitionsLoadedAt(){return this.flagDefinitionsLoadedAt}getPollingInterval(){let t=this.pollingInterval??3e4;return this.shouldBeginExponentialBackoff?Math.min(Mrh,t*2**this.backOffCount):t}beginBackoff(){this.shouldBeginExponentialBackoff=!0,this.backOffCount+=1,this.nextFetchAllowedAt=Date.now()+this.getPollingInterval()}clearBackoff(){this.shouldBeginExponentialBackoff=!1,this.backOffCount=0,this.nextFetchAllowedAt=void 0}async _loadFeatureFlags(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);try{let t=!0;if(this.cacheProvider)try{t=await this.cacheProvider.shouldFetchFlagDefinitions()}catch(n){this.onError?.(new Error(`Error in shouldFetchFlagDefinitions: ${n}`))}if(!t&&(await this.loadFromCache("Loaded flags from cache (skipped fetch)")||this.loadedSuccessfullyOnce))return;let r=await this._requestFeatureFlagDefinitions();if(!r)return;switch(r.status){case 304:this.logMsgIfDebug(()=>console.debug("[FEATURE FLAGS] Flags not modified (304), using cached data")),this.flagsEtag=r.headers?.get("ETag")??this.flagsEtag,this.loadedSuccessfullyOnce=!0,this.clearBackoff();return;case 401:throw this.beginBackoff(),new alt(`Your project key or secret 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.filteredOutFlagKeys=new Set,this.groupTypeMapping={},this.cohorts={},this.propertyMatchingVersion=void 0,this.onMinimalFlagCalledEvents?.(!1);return;case 403:throw this.beginBackoff(),new alt(`Your secret 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 secret and Project API key pair? More information: https://posthog.com/docs/api/overview`);case 429:throw this.beginBackoff(),new alt(`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 n=await r.json()??{};if(!("flags"in n))return void this.onError?.(new Error(`Invalid response when getting feature flags: ${JSON.stringify(n)}`));this.flagsEtag=r.headers?.get("ETag")??void 0;let i=n.group_type_mapping||{},o=n.minimal_flag_called_events===!0,s={flags:n.flags??[],group_type_mapping:i,cohorts:n.cohorts||{},minimal_flag_called_events:o,property_matching_version:n.property_matching_version,propertyMatchingVersion:n.property_matching_version,groupTypeMapping:i,minimalFlagCalledEvents:o};if(this.updateFlagState(s),this.flagDefinitionsLoadedAt=Date.now(),this.clearBackoff(),this.cacheProvider&&t)try{await this.cacheProvider.onFlagDefinitionsReceived(s)}catch(a){this.onError?.(new Error(`Failed to store in cache: ${a}`))}this.onLoad?.(this.featureFlags.length),this.warnAboutExperienceContinuityFlags(this.featureFlags);break}default:return}}catch(t){t instanceof alt&&this.onError?.(t)}finally{!this.pollerStopped&&this.pollingInterval!==null&&(this.poller=setTimeout(()=>this.loadFeatureFlags(!0),this.getPollingInterval()))}}getPersonalApiKeyRequestOptions(t="GET",r){let n={...this.customHeaders,"Content-Type":"application/json",Authorization:`Bearer ${this.personalApiKey}`};return r&&(n["If-None-Match"]=r),{method:t,headers:n}}async _requestFeatureFlagDefinitions(){let t=`${this.host}/flags/definitions?token=${this.projectApiKey}&send_cohorts`,r=this.getPersonalApiKeyRequestOptions("GET",this.flagsEtag),n=null;if(this.timeout&&typeof this.timeout=="number"){let o=new AbortController;n=T2(()=>{o.abort()},this.timeout),r.signal=o.signal}let i=()=>clearTimeout(n);try{let o=this.fetch,s=await o(t,r);return s.status!==200?(i(),s):{status:s.status,headers:s.headers,body:s.body,text:async()=>{try{return await s.text()}finally{i()}},json:async()=>{try{return await s.json()}finally{i()}}}}catch(o){throw i(),o}}async stopPoller(t=3e4){if(this.pollerStopped=!0,clearTimeout(this.poller),this.poller=void 0,this.cacheProvider)try{let r=this.cacheProvider.shutdown();r instanceof Promise&&await ESe(r,t,()=>{throw new Error(`Cache shutdown timeout after ${t}ms`)})}catch(r){this.onError?.(new Error(`Error during cache shutdown: ${r}`))}}};function $$l(e,t,r,n){return Tqo(e,t,{warnFunction:r,propertyMatchingVersion:n})}function Urh(e,t){if(!(e in t))throw new qte(`cohort ${e} not found in local cohorts - likely a static cohort that requires server evaluation`)}async function eeu(e,t,r,n=!1,i,o){let s=String(e.value);Urh(s,r);let a=r[s];return teu(a,t,r,n,i,o)}async function teu(e,t,r,n=!1,i,o){if(!e)return!0;let s=e.type,a=e.values;if(!a||a.length===0)return!0;let c=!1;if("values"in a[0]){for(let l of a)try{let u=await teu(l,t,r,n,i,o);if(s==="AND"){if(!u)return!1}else if(u)return!0}catch(u){if(u instanceof qte)throw u;if(u instanceof Ml)n&&console.debug(`Failed to compute property ${l} locally: ${u}`),c=!0;else throw u}if(c)throw new Ml("Can't match cohort without a given cohort property value");return s==="AND"}for(let l of a)try{let u;if(l.type==="cohort")u=await eeu(l,t,r,n,i,o);else if(l.type==="flag"){if(!i)throw new Ml(`Flag dependency '${l.key||"unknown"}' cannot be evaluated without a flag dependency evaluator`);u=await i(l)}else u=$$l(l,t,void 0,o);let p=l.negation||!1;if(s==="AND"){if(!u&&!p||u&&p)return!1}else if(u&&!p||!u&&p)return!0}catch(u){if(u instanceof qte)throw u;if(u instanceof Ml)n&&console.debug(`Failed to compute property ${l} locally: ${u}`),c=!0;else throw u}if(c)throw new Ml("can't match cohort without a given cohort property value");return s==="AND"}var Vrh=["--unhandled-rejections","--unhandled_rejections"],Grh=new Set(["throw","strict","warn","warn-with-error-code","none"]),qrh=[...globalThis.process?.execArgv??[]],Wrh=globalThis.process?.env?.NODE_OPTIONS;function Hrh(e){let t=[],r="",n=!1;for(let i=0;i<e.length;i++){let o=e[i];o==="\\"&&n&&i+1<e.length?r+=e[++i]:o!==" "||n?o==='"'?n=!n:r+=o:r&&(t.push(r),r="")}return r&&t.push(r),t}function reu(e){let t;for(let r=0;r<e.length;r++){let n=e[r],i=Vrh.find(s=>n===s||n.startsWith(`${s}=`));if(!i)continue;let o=n===i?e[++r]:n.slice(i.length+1);Grh.has(o)&&(t=o)}return t}function Krh(e=qrh,t=Wrh){return reu(e)??reu(Hrh(t??""))??"throw"}var neu=Krh();function ieu(e,t,r){e(t,{mechanism:{type:r==="unhandledRejection"?"onunhandledrejection":"onuncaughtexception",handled:!1}})}function Jrh(e,t){let r=!1;return Object.assign((n,i)=>{let o=global.process.listeners("uncaughtException").filter(s=>s.name!=="domainUncaughtExceptionClear"&&s._posthogErrorHandler!==!0).length;ieu(e,n,i),!r&&o===0&&(r=!0,t(n))},{_posthogErrorHandler:!0})}function oeu(e,t,r=neu){let n=globalThis.process;if(n){if(r==="strict")return void n.on("uncaughtExceptionMonitor",(i,o)=>ieu(e,i,o));n.on("uncaughtException",Jrh(e,t))}}function seu(e,t=neu){let r=globalThis.process;!r||t==="throw"||t==="strict"||t==="warn-with-error-code"||r.on("unhandledRejection",n=>{e(n,{mechanism:{type:"onunhandledrejection",handled:!1}})})}var Yrh=2e3,Yqo=class e{constructor(t,r,n){this.client=t,this._exceptionAutocaptureEnabled=r.enableExceptionAutocapture||!1,this._logger=n,this._rateLimiter=new dZr({...AZl(r),refillInterval:1e4,_logger:this._logger}),this.startAutocaptureIfEnabled()}static isPreviouslyCapturedError(t){return VGt(t)&&"__posthog_previously_captured_error"in t&&t.__posthog_previously_captured_error===!0}static async buildEventMessage(t,r,n,i,o){let s={...o},a=t.buildFromUnknown(r,n);a.$exception_list=await t.modifyFrames(a.$exception_list);let c=mT.getInjectedReleaseId();return c&&(s.$release_id=c),{event:"$exception",distinctId:i,properties:{...a,...s},_originatedFromCaptureException:!0}}startAutocaptureIfEnabled(){this.isEnabled()&&(oeu(this.onException.bind(this),this.onFatalError.bind(this)),seu(this.onException.bind(this)))}onException(t,r){this.client.addPendingPromise((async()=>{if(!e.isPreviouslyCapturedError(t)){let n=await e.buildEventMessage(this.client.getErrorPropertiesBuilder(),t,r),o=n.properties?.$exception_list[0]?.type??"Exception";return this._rateLimiter.consumeRateLimit(o)?void this._logger.info("Skipping exception capture because of client rate limiting.",{exception:o}):this.client._capturePreparedEvent(n,!1)}})())}async onFatalError(t){console.error(t),await this.client.shutdown(Yrh),globalThis.process.exit(1)}isEnabled(){return!this.client.isDisabled&&this._exceptionAutocaptureEnabled}shutdown(){this._rateLimiter.stop()}},iUe=Yqo;var JZr=class{getProperty(t){return this._memoryStorage[t]}setProperty(t,r){this._memoryStorage[t]=r!==null?r:void 0}constructor(){this._memoryStorage={}}};function Xrh(e){return e==="v0"||e==="v1"}function aeu(){let e="u">typeof process?process.env?.POSTHOG_CAPTURE_MODE:void 0;return Xrh(e)?e:"v0"}var Zrh="$ai_",b9t="analytics";function ceu(e){return typeof e.event=="string"&&e.event.startsWith(Zrh)}var clt=class e extends Error{constructor({requestId:t,drops:r,retryExhausted:n,cause:i}){super(e.buildMessage(t,r,n,i)),this.name="CaptureV1Error",this.requestId=t,this.drops=r,this.retryExhausted=n,this.cause=i}static buildMessage(t,r,n,i){let o=`Capture V1 batch ${t} did not fully deliver: ${r.length} dropped, ${n.length} undelivered`;return i instanceof Error&&(o+=` (${i.message})`),o}};function Xqo(e){if(typeof e=="boolean")return e;if(typeof e=="number")return e!==0;if(typeof e=="string"){let t=e.trim().toLowerCase();if(t==="true"||t==="1")return!0;if(t==="false"||t==="0")return!1}}function $rh(e){return typeof e=="string"?e:void 0}var enh=[{property:"$cookieless_mode",optionKey:"cookieless_mode",coerce:Xqo},{property:"$ignore_sent_at",optionKey:"disable_skew_correction",coerce:Xqo},{property:"$process_person_profile",optionKey:"process_person_profile",coerce:Xqo},{property:"$product_tour_id",optionKey:"product_tour_id",coerce:$rh}],tnh=[{property:"$session_id",field:"session_id"},{property:"$window_id",field:"window_id"}];function rnh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function nnh(e){if(typeof e=="string"){let r=new Date(e);if(Number.isNaN(r.getTime()))return new Date().toISOString();let n=r.toISOString(),i=e.match(/\.(\d+)(?:Z|[+-]\d{2}:?\d{2})?$/i)?.[1];return i&&i.length>3?n.replace(/\.\d{3}Z$/,`.${i}Z`):n}if(e instanceof Date)return Number.isNaN(e.getTime())?new Date().toISOString():e.toISOString();let t=e==null?new Date:new Date(e);return Number.isNaN(t.getTime())?new Date().toISOString():t.toISOString()}function leu(e,t,r){r!==void 0&&!(t in e)&&(e[t]=r)}function inh(e){let r={...rnh(e.properties)?e.properties:{}},n={};for(let{property:o,optionKey:s,coerce:a}of enh)if(o in r){let c=a(r[o]);c!==void 0&&(n[s]=c),delete r[o]}let i={};for(let{property:o,field:s}of tnh)if(o in r){let a=r[o];typeof a=="string"&&(i[s]=a),delete r[o]}return delete r.$lib,delete r.$lib_version,leu(r,"$set",e.$set),leu(r,"$set_once",e.$set_once),{event:String(e.event??""),uuid:String(e.uuid??""),distinct_id:String(e.distinct_id??""),timestamp:nnh(e.timestamp),...i,options:n,properties:r}}function ueu(e,{createdAt:t,historicalMigration:r}){let n={created_at:t,batch:e.map(inh)};return r&&(n.historical_migration=!0),n}var onh="/i/v1/analytics/events",snh=3e4,anh=new Set([408,500,502,503,504]),YZr=class{constructor(t,r){this.config=t,this.maxBackoffMs=t.maxBackoffMs??snh,this.fetchFn=r.fetch,this.onError=r.onError,this.now=r.now??Date.now,this.sleep=r.sleep??(n=>new Promise(i=>T2(i,n))),this.generateRequestId=r.generateRequestId??w2,this.compress=r.compress??r9t}async sendV1Batch(t){if(t.length===0)return;let r=this.generateRequestId(),n=new Date(this.now()).toISOString(),{batch:i}=ueu(t,{createdAt:n,historicalMigration:this.config.historicalMigration}),o=`${this.config.host}${onh}`,s=[],a=i,c=Math.max(1,this.config.maxAttempts);for(let l=1;l<=c;l++){let u=l===c,p=ySe({created_at:n,...this.config.historicalMigration?{historical_migration:!0}:{},batch:a}),d,f;try{d=await this.sendOnce(o,p,l,r);let{response:m,signal:g}=d,{status:A}=m;if(A<200||A>=300)if(!u&&anh.has(A)){let y=this.parseRetryAfter(m);await d.waitFor(d.cancelBody()).catch(()=>{}),f=this.backoffDelay(l,y)}else{let y=await this.buildHttpError(m,A,d.waitFor);return this.surfaceBatchFailure(r,s,a,y)}else{let y;try{y=await d.waitFor(this.parseResponse(m))}catch(x){if(g.aborted)throw x;return this.surfaceBatchFailure(r,s,a,new Error(`Capture V1 returned an unparseable ${A} response body`))}let I=this.classify(a,y,s);if(I.length===0)return this.surfacePartialDrops(r,s);if(u)return void this.onError(new clt({requestId:r,drops:s,retryExhausted:I.map(x=>x.uuid)}));a=I;let C=this.parseRetryAfter(m);f=this.backoffDelay(l,C)}}catch(m){if(d&&!d.signal.aborted)throw m;if(u)return this.surfaceBatchFailure(r,s,a,m);f=this.backoffDelay(l)}finally{d?.cleanup()}f!==void 0&&await this.sleep(f)}}async sendOnce(t,r,n,i){let o=this.buildHeaders(n,i),s=r;if(this.config.compressionEnabled){let p=await this.compress(r,this.config.isDebug);p!==null&&(s=p,o["Content-Encoding"]="gzip")}let a=new AbortController,c="waiting for response headers",l,u=new Promise((p,d)=>{l=T2(()=>{let f=new Error(`Capture V1 request timed out ${c} after ${this.config.requestTimeoutMs}ms`);f.name="AbortError",d(f),a.abort(f)},this.config.requestTimeoutMs)});try{let p=this.fetchFn(t,{method:"POST",headers:o,body:s,signal:a.signal}),d=!1;p.then(y=>{a.signal.aborted&&!d&&this.cancelBody(y)}).catch(()=>{});let f=await Promise.race([p,u]);d=!0,c="while reading the response body";let m=!1,g,A=()=>g??=this.cancelBody(f);return{response:f,signal:a.signal,waitFor:y=>Promise.race([y,u]),cancelBody:A,cleanup:()=>{m||(m=!0,clearTimeout(l),a.signal.aborted&&A())}}}catch(p){throw clearTimeout(l),p}}buildHeaders(t,r){let n=`${this.config.libraryId}/${this.config.libraryVersion}`,i={"Content-Type":"application/json",Authorization:`Bearer ${this.config.apiKey}`,"PostHog-Sdk-Info":n,"PostHog-Attempt":String(t),"PostHog-Request-Id":r,"PostHog-Request-Timestamp":new Date(this.now()).toISOString()};return this.config.userAgent&&(i["User-Agent"]=this.config.userAgent),i}classify(t,r,n){let i=r.results??{},o=[];for(let s of t){let a=i[s.uuid];a&&(a.result==="drop"?n.push({uuid:s.uuid,details:a.details??void 0}):a.result==="retry"&&o.push(s))}return o}backoffDelay(t,r){let n=Math.min(this.config.initialRetryDelayMs*2**(t-1),this.maxBackoffMs);return r===void 0?n:Math.max(n,Math.min(r,this.maxBackoffMs))}parseRetryAfter(t){let r=t.headers?.get("Retry-After");if(!r)return;let n=r.trim();if(/^\d+$/.test(n)){let s=parseInt(n,10);return Number.isFinite(s)&&s>0?1e3*s:void 0}let i=Date.parse(n);if(Number.isNaN(i))return;let o=i-this.now();return o>0?o:void 0}async parseResponse(t){let r=await t.text(),n=JSON.parse(r);if(typeof n!="object"||n===null||Array.isArray(n))throw new Error("unexpected response shape");let i=n.results;if(i!==void 0&&(typeof i!="object"||i===null||Array.isArray(i)))throw new Error("unexpected results shape");return{results:i??{}}}async buildHttpError(t,r,n){let i="";try{i=(await n(t.text())).slice(0,512)}catch{}let o=i?`: ${i}`:"";return new Error(`Capture V1 request failed with HTTP ${r}${o}`)}surfaceBatchFailure(t,r,n,i){this.onError(new clt({requestId:t,drops:r,retryExhausted:n.map(o=>o.uuid),cause:i}))}surfacePartialDrops(t,r){r.length>0&&this.onError(new clt({requestId:t,drops:r,retryExhausted:[]}))}async cancelBody(t){try{await t.body?.cancel()}catch{}}};var oUe="ai-capture",XZr="/i/v0/ai/batch/";var lnh=new TextEncoder;function $qo(e){return lnh.encode(ySe(e)).length}function peu(e,t=8388608,r=5242880){let n=[],i=[],o=[],s=0;for(let a of e){if(a===void 0)continue;let c=$qo(a);if(c>t){i.push({event:typeof a.event=="string"?a.event:"unknown",bytes:c});continue}o.length>0&&s+c>r&&(n.push(o),o=[],s=0),o.push(a),s+=c}return o.length>0&&n.push(o),{batches:n,dropped:i}}var unh=100,feu=3e4,pnh=5e4,fnh=50,dnh=500,mnh="https://us.i.posthog.com",deu=new Set;function $Zr(e,t){deu.has(e)||(deu.add(e),console.warn(`[PostHog] ${t}`))}function hnh(e){return typeof e=="string"?e.trim():""}function gnh(e){return(typeof e=="string"?e.trim():"")||void 0}function Anh(e){return(typeof e=="string"?e.trim():"")||mnh}function ynh(e){return(Array.isArray(e)?e:[e]).filter(r=>typeof r=="string"&&r.trim().length>0)}function bnh(e){if(!e)return{};let t={};for(let[n,i]of Object.entries(e))t[`$feature/${n}`]=i;let r=Object.keys(e).filter(n=>e[n]!==!1).sort();return r.length>0&&(t.$active_feature_flags=r),t}var e$r=class extends n9t{constructor(t,r={}){let n=hnh(t),i={...r,maxQueueSize:r.maxQueueSize??1e4,flushInterval:r.flushInterval??5e3,host:Anh(r.host),personalApiKey:gnh(r.secretKey??r.personalApiKey)};if(super(n,i),this._memoryStorage=new JZr,this._aiCaptureRouteActive=!1,this._minimalFlagCalledEvents=!1,this.options=i,this.captureMode=aeu(),this.enableFullAiCapture=i.enableFullAiCapture===!0,this.context=this.initializeContext(),this.options.featureFlagsPollingInterval=typeof i.featureFlagsPollingInterval=="number"?Math.max(i.featureFlagsPollingInterval,unh):i.featureFlagsPollingInterval===null?null:feu,typeof i.waitUntilDebounceMs=="number"&&(this.options.waitUntilDebounceMs=Math.max(i.waitUntilDebounceMs,0)),typeof i.waitUntilMaxWaitMs=="number"&&(this.options.waitUntilMaxWaitMs=Math.max(i.waitUntilMaxWaitMs,0)),!this.disabled&&i.personalApiKey){if(i.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.');i.enableLocalEvaluation!==!1&&(this.featureFlagsPoller=new KZr({pollingInterval:this.options.featureFlagsPollingInterval,personalApiKey:i.personalApiKey,projectApiKey:n,timeout:i.requestTimeout??1e4,host:this.host,fetch:i.fetch,onError:s=>{this._events.emit("error",s)},onLoad:s=>{this._events.emit("localEvaluationFlagsLoaded",s)},onMinimalFlagCalledEvents:s=>{this._minimalFlagCalledEvents=s},customHeaders:this.getCustomHeaders(),cacheProvider:i.flagDefinitionCacheProvider,strictLocalEvaluation:i.strictLocalEvaluation,evaluationContexts:i.evaluationContexts??i.evaluationEnvironments}))}this.errorTracking=new iUe(this,i,this._logger),this.distinctIdHasSentFlagCalls={},this.maxCacheSize=i.maxCacheSize||pnh}enqueue(t,r,n,i){super.enqueue(t,r,n,i),this.scheduleDebouncedFlush()}_flushEventsAndSpans(t=!1){let r=this.flushWithPendingPromises();return!this._traces||t&&this._traces.throttled?r:WGt([r,this._traces.flush().catch(()=>{})]).then(([n])=>{if(n.status==="rejected")throw n.reason})}flushAutomatic(){return this._flushKeepingRuntimeAlive(!0)}async flush(){return this._flushKeepingRuntimeAlive(!1)}_flushKeepingRuntimeAlive(t){let r=this._flushEventsAndSpans(t),n=this.options.waitUntil;if(n&&!this._waitUntilCycle)try{n(r.catch(()=>{}))}catch{}return r}scheduleDebouncedFlush(){let t=this.options.waitUntil;if(!t||this.disabled||this.optedOut)return;if(!this._waitUntilCycle){let s,a=new Promise(c=>{s=c});try{t(a)}catch{return}this._waitUntilCycle={resolve:s,startedAt:Date.now(),timer:void 0}}let r=Date.now()-this._waitUntilCycle.startedAt,n=this.options.waitUntilMaxWaitMs??dnh,i=r>=n;if(this._waitUntilCycle.timer!==void 0&&clearTimeout(this._waitUntilCycle.timer),i)return void this.resolveWaitUntilFlush();let o=this.options.waitUntilDebounceMs??fnh;this._waitUntilCycle.timer=T2(()=>{this.resolveWaitUntilFlush()},o)}_consumeWaitUntilCycle(){let t=this._waitUntilCycle;return t&&(clearTimeout(t.timer),this._waitUntilCycle=void 0),t?.resolve}async resolveWaitUntilFlush(){let t=this._consumeWaitUntilCycle();try{await this._flushEventsAndSpans()}catch{}finally{t?.()}}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):fetch(t,r)}getQueueRouteKey(t){return this.captureMode==="v1"&&ceu(t)?"ai":b9t}persistedQueueKeyForRoute(t){return t===oUe?vQ.AiCaptureQueue:t==="ai"?vQ.AiQueue:vQ.Queue}getActiveQueueRoutes(){let t=this.captureMode==="v1"?[b9t,"ai"]:[b9t];return this._aiCaptureRouteActive&&t.push(oUe),t}getBatchEndpointPath(t){return t===oUe?XZr:super.getBatchEndpointPath(t)}async sendBatch(t,r,n=b9t){if(n===oUe)return this.sendAiCaptureBatch(t,r);if(this.captureMode!=="v1"||n==="ai")return super.sendBatch(t,r,n);let i=t.filter(o=>o!==void 0);await this.getV1Sender().sendV1Batch(i)}async sendAiCaptureBatch(t,r){let{batches:n,dropped:i}=peu(t);for(let{event:o,bytes:s}of i){let a=`Event ${o} (${s} bytes) exceeds the ${8388608/1048576}MiB limit for ${XZr}, dropping.`;this._logger.error(a),this._events.emit("error",new Error(a))}for(let o of n)await this.sendAiSubBatch(o,r)}async sendAiSubBatch(t,r){try{await super.sendBatch(t,r,oUe)}catch(n){if(!nlt(n))throw n;if(t.length===1){let[o]=t,a=`Event ${typeof o.event=="string"?o.event:"unknown"} (${$qo(o)} bytes) was rejected with 413 by ${XZr} on its own, dropping.`;this._logger.error(a),this._events.emit("error",new Error(a));return}let i=Math.ceil(t.length/2);await this.sendAiSubBatch(t.slice(0,i),r),await this.sendAiSubBatch(t.slice(i),r)}}getV1Sender(){return this._v1Sender||(this._v1Sender=new YZr({host:this.host,apiKey:this.apiKey,libraryId:this.getLibraryId(),libraryVersion:this.getLibraryVersion(),userAgent:this.getCustomUserAgent()||void 0,historicalMigration:this.historicalMigration,compressionEnabled:!this.disableCompression,requestTimeoutMs:this.requestTimeout,maxAttempts:(this.options.fetchRetryCount??3)+1,initialRetryDelayMs:this.options.fetchRetryDelay??3e3,isDebug:this.isDebug},{fetch:(t,r)=>this.fetch(t,r),onError:t=>this._events.emit("error",t),compress:t=>this.compressPayload(t)})),this._v1Sender}getLibraryVersion(){return X$l}get metrics(){return this._metrics||(this._metrics=new f9t(this,NZr(this.options.metrics),this._logger)),this._metrics}initializeSpanContextManager(){return new A9t}hostResourceAttributes(){return{}}get _spanContextManager(){return this._spanContext||(this._spanContext=this.initializeSpanContextManager()),this._spanContext}get _tracesPipeline(){if(this.options.traces)return this._traces||(this._traces=new g9t(this,qqo(this.options.traces,this.hostResourceAttributes(),this._logger),this._logger,()=>this._tracingContext(),this._spanContextManager,()=>this.scheduleDebouncedFlush())),this._traces}_tracingContext(){let t=this.context?.get();return{distinctId:t?.distinctId,sessionId:t?.sessionId}}startSpan(t,r){return this._tracesPipeline?.startSpan(t,r)??ISe(r,this._spanContextManager.active())}withSpan(t,r,n){let i=typeof r=="function"?void 0:r,o=typeof r=="function"?r:n,s=this._tracesPipeline;return s?i?s.withSpan(t,i,o):s.withSpan(t,o):h9t(this._spanContextManager,ISe(i,this._spanContextManager.active()),o)}getActiveSpan(){return this._spanContextManager.active()??null}getCustomUserAgent(){return`${this.getLibraryId()}/${this.getLibraryVersion()}`}getEvaluationRuntime(){return"server"}getCommonEventProperties(){let t=super.getCommonEventProperties();return(this.options.isServer??!0)&&(t.$is_server=!0),t}enable(){return super.optIn()}disable(){return super.optOut()}debug(t=!0){super.debug(t),this.featureFlagsPoller?.debug(t)}_warnIfInvalidCapture(t,r,n){typeof t=="string"&&this._logger.warn(r),t.event==="$exception"&&!t._originatedFromCaptureException&&this._logger.warn(n)}_sendPreparedEvent(t,r,n,i,o){return this.addPendingPromise(this._prepareEventMessage(r,i).then(({distinctId:s,event:a,properties:c,options:l})=>{let u={timestamp:l.timestamp,disableGeoip:l.disableGeoip,uuid:l.uuid},p={distinctId:s,event:a,properties:{...c,...this.getCommonEventProperties()}};return n?this.sendImmediate(t,p,u,o):this.enqueue(t,p,u,o)}).catch(s=>{s&&console.error(s)}))}_capturePreparedEvent(t,r){return this._sendPreparedEvent("capture",t,r)}capture(t){this._warnIfInvalidCapture(t,"Called capture() with a string as the first argument when an object was expected.","Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this._capturePreparedEvent(t,!1)}async captureImmediate(t){return this._warnIfInvalidCapture(t,"Called captureImmediate() with a string as the first argument when an object was expected.","Capturing a `$exception` event via `posthog.captureImmediate('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureExceptionImmediate(error)` instead, which attaches this metadata by default."),this._capturePreparedEvent(t,!0)}captureAi(t){if(this.disabled)return;let r=eUe(t.uuid,w2);return this._sendPreparedAiEvent({...t,uuid:r},!1),r}async captureAiImmediate(t){if(this.disabled)return;let r=eUe(t.uuid,w2);return await this._sendPreparedAiEvent({...t,uuid:r},!0),r}_sendPreparedAiEvent(t,r){return typeof t?.event=="string"&&!t.event.startsWith("$ai_")&&this._logger.debug(`captureAi called with non-AI event ${t.event}; routing it to the AI endpoint anyway.`),this._aiCaptureRouteActive=!0,this._sendPreparedEvent("capture",t,r,void 0,oUe)}identify({distinctId:t,properties:r={},disableGeoip:n}){let{$set:i,$set_once:o,$anon_distinct_id:s,...a}=r,u={$set:i||a,$set_once:o||{},$anon_distinct_id:s??void 0};this._sendPreparedEvent("identify",{distinctId:t,event:"$identify",properties:u,disableGeoip:n},!1,{includeContextProperties:!1})}async identifyImmediate({distinctId:t,properties:r={},disableGeoip:n}){let{$set:i,$set_once:o,$anon_distinct_id:s,...a}=r,u={$set:i||a,$set_once:o||{},$anon_distinct_id:s??void 0};await this._sendPreparedEvent("identify",{distinctId:t,event:"$identify",properties:u,disableGeoip:n},!0,{includeContextProperties:!1})}setPersonProperties({distinctId:t,properties:r={},propertiesOnce:n={}}){if(Object.keys(r).length===0&&Object.keys(n).length===0)return;let i={};Object.keys(r).length>0&&(i.$set=r),Object.keys(n).length>0&&(i.$set_once=n),this.capture({distinctId:t,event:"$set",properties:i})}unsetPersonProperties({distinctId:t,properties:r}){let n=ynh(r);n.length!==0&&this.capture({distinctId:t,event:"$set",properties:{$unset:n}})}alias(t){this._sendPreparedEvent("alias",{distinctId:t.distinctId,event:"$create_alias",properties:{distinct_id:t.distinctId,alias:t.alias},disableGeoip:t.disableGeoip},!1,{includeContextProperties:!1})}async aliasImmediate(t){await this._sendPreparedEvent("alias",{distinctId:t.distinctId,event:"$create_alias",properties:{distinct_id:t.distinctId,alias:t.alias},disableGeoip:t.disableGeoip},!0,{includeContextProperties:!1})}isLocalEvaluationReady(){return this.featureFlagsPoller?.isLocalEvaluationReady()??!1}getFeatureFlagEvaluationRuntime(t){return this.featureFlagsPoller?.getEvaluationRuntimeForFlag(t)}getFeatureFlagKeysByEvaluationRuntime(t){return this.featureFlagsPoller?.getFlagKeysByEvaluationRuntime(t)??[]}async waitForLocalEvaluationReady(t=feu){return this.isLocalEvaluationReady()?!0:this.featureFlagsPoller===void 0?!1:new Promise(r=>{let n=setTimeout(()=>{i(),r(!1)},t),i=this._events.on("localEvaluationFlagsLoaded",o=>{clearTimeout(n),i(),r(o>0)})})}_resolveDistinctId(t,r){return typeof t=="string"?{distinctId:t,options:r}:{distinctId:this.context?.get()?.distinctId,options:t}}async _getFeatureFlagResult(t,r,n={},i){if(this.disabled)return void this._logger.warn("The client is disabled");let o=n.sendFeatureFlagEvents??!0;if(this._flagOverrides!==void 0&&t in this._flagOverrides){let D=this._flagOverrides[t];if(D===void 0)return;let R=this._payloadOverrides?.[t];return{key:t,enabled:D!==!1,variant:typeof D=="string"?D:void 0,payload:R}}let{groups:s,disableGeoip:a}=n,{onlyEvaluateLocally:c,personProperties:l,groupProperties:u}=n,p=this.addLocalPersonAndGroupProperties(r,s,l,u);l=p.allPersonProperties,u=p.allGroupProperties;let d=this.createFeatureFlagEvaluationContext(r,s,this.personPropertiesForLocalEvaluation(r,l),u);c==null&&(c=this.options.strictLocalEvaluation??!1);let f,m=!1,g,A,y,I,C,x,S;if(this.featureFlagsPoller!==void 0){await this.featureFlagsPoller?.loadFeatureFlags();let D=this.featureFlagsPoller?.featureFlagsByKey[t];if(D)try{let R=await this.featureFlagsPoller?.computeFlagAndPayloadLocally(D,d,{matchValue:i});if(R){m=!0;let O=R.value;I=D.id,x="Evaluated locally",S=D.has_experiment,f={key:t,enabled:O!==!1,variant:typeof O=="string"?O:void 0,payload:R.payload??void 0,reason:x,reasonCode:D.active===!1?"flag_disabled":void 0}}}catch(R){if(R instanceof qte||R instanceof Ml)this._logger?.info(`${R.name} when computing flag locally: ${t}: ${R.message}`);else throw R}}if(!m&&!c){let D=await super.getFeatureFlagDetailsStateless(d.distinctId,d.groups,l,u,a,[t]);if(D===void 0)y=hme.UNKNOWN_ERROR;else{this._minimalFlagCalledEvents=D.minimalFlagCalledEvents===!0,g=D.requestId,A=D.evaluatedAt;let R=[];D.errorsWhileComputingFlags&&R.push(hme.ERRORS_WHILE_COMPUTING),D.quotaLimited?.includes("feature_flags")&&R.push(hme.QUOTA_LIMITED);let O=D.flags[t];if(O===void 0)R.push(hme.FLAG_MISSING);else{I=O.metadata?.id,C=O.metadata?.version,x=O.reason?.description??O.reason?.code,S=O.metadata?.has_experiment;let z;if(O.metadata?.payload!==void 0)try{z=JSON.parse(O.metadata.payload)}catch{z=O.metadata.payload}f={key:t,enabled:O.enabled,variant:O.variant??void 0,payload:z,reason:x,reasonCode:O.reason?.code}}R.length>0&&(y=R.join(","))}}if(o){let D=f===void 0?void 0:f.enabled===!1?!1:f.variant??!0,R={$feature_flag:t,$feature_flag_response:D,$feature_flag_id:I,$feature_flag_version:C,$feature_flag_reason:x,locally_evaluated:m,[`$feature/${t}`]:D,$feature_flag_request_id:g,$feature_flag_evaluated_at:m?Date.now():A};if(S!==void 0&&(R.$feature_flag_has_experiment=S),m&&this.featureFlagsPoller){let O=this.featureFlagsPoller.getFlagDefinitionsLoadedAt();O!==void 0&&(R.$feature_flag_definitions_loaded_at=O)}y&&(R.$feature_flag_error=y),this._captureFlagCalledEventIfNeeded({distinctId:r,key:t,response:D,groups:s,disableGeoip:a,properties:R})}return f!==void 0&&this._payloadOverrides!==void 0&&t in this._payloadOverrides&&(f={...f,payload:this._payloadOverrides[t]}),f}async getFeatureFlag(t,r,n){$Zr("getFeatureFlag","`getFeatureFlag` is deprecated and will be removed in a future major version. Use `posthog.evaluateFlags(distinctId, ...)` and call `flags.getFlag(key)` instead \u2014 this consolidates flag evaluation into a single `/flags` request per incoming request.");let i=await this._getFeatureFlagResult(t,r,{...n,sendFeatureFlagEvents:n?.sendFeatureFlagEvents??this.options.sendFeatureFlagEvent??!0});if(i!==void 0)return i.enabled===!1?!1:i.variant??!0}async getFeatureFlagPayload(t,r,n,i){if($Zr("getFeatureFlagPayload","`getFeatureFlagPayload` is deprecated and will be removed in a future major version. Use `posthog.evaluateFlags(distinctId, ...)` and call `flags.getFlagPayload(key)` instead \u2014 this consolidates flag evaluation into a single `/flags` request per incoming request."),this._payloadOverrides!==void 0&&t in this._payloadOverrides)return this._payloadOverrides[t];let o=await this._getFeatureFlagResult(t,r,{...i,sendFeatureFlagEvents:!1},n);if(o!==void 0)return o.payload??null}async getFeatureFlagResult(t,r,n){let{distinctId:i,options:o}=this._resolveDistinctId(r,n);return i?this._getFeatureFlagResult(t,i,{...o,sendFeatureFlagEvents:o?.sendFeatureFlagEvents??this.options.sendFeatureFlagEvent??!0}):void this._logger.warn("[PostHog] distinctId is required \u2014 pass it explicitly or use withContext()")}async getRemoteConfigPayload(t){if(this.disabled)return void this._logger.warn("The client is disabled");if(!this.options.personalApiKey)throw new Error("Personal API key is required for remote config payload decryption");let r=await this._requestRemoteConfigPayload(t);if(!r)return;let n=await r.json();if(typeof n=="string")try{return JSON.parse(n)}catch{}return n}async isFeatureEnabled(t,r,n){$Zr("isFeatureEnabled","`isFeatureEnabled` is deprecated and will be removed in a future major version. Use `posthog.evaluateFlags(distinctId, ...)` and call `flags.isEnabled(key)` instead \u2014 this consolidates flag evaluation into a single `/flags` request per incoming request.");let i=await this._getFeatureFlagResult(t,r,{...n,sendFeatureFlagEvents:n?.sendFeatureFlagEvents??this.options.sendFeatureFlagEvent??!0});return i===void 0?void 0:i.enabled===!1?!1:!!(i.variant??!0)||!1}async getAllFlags(t,r){let{distinctId:n,options:i}=this._resolveDistinctId(t,r);return n?(await this.getAllFlagsAndPayloads(n,i)).featureFlags||{}:(this._logger.warn("[PostHog] distinctId is required to get feature flags \u2014 pass it explicitly or use withContext()"),{})}async getAllFlagsAndPayloads(t,r){let{distinctId:n,options:i}=this._resolveDistinctId(t,r);if(!n)return this._logger.warn("[PostHog] distinctId is required to get feature flags and payloads \u2014 pass it explicitly or use withContext()"),{featureFlags:{},featureFlagPayloads:{}};if(this.disabled)return this._logger.warn("The client is disabled"),{featureFlags:{},featureFlagPayloads:{}};let{groups:o,disableGeoip:s,flagKeys:a}=i||{},{onlyEvaluateLocally:c,personProperties:l,groupProperties:u}=i||{},p=this.addLocalPersonAndGroupProperties(n,o,l,u);l=p.allPersonProperties,u=p.allGroupProperties;let d=this.createFeatureFlagEvaluationContext(n,o,this.personPropertiesForLocalEvaluation(n,l),u);c==null&&(c=this.options.strictLocalEvaluation??!1);let f=await this.featureFlagsPoller?.getAllFlagsAndPayloads(d,a),m={},g={},A=!0;if(f&&(m=f.response,g=f.payloads,A=f.fallbackToFlags),A&&!c){let y=await super.getFeatureFlagsAndPayloadsStateless(d.distinctId,d.groups,l,u,s,a);m={...m,...y.flags||{}},g={...g,...y.payloads||{}}}return this._flagOverrides!==void 0&&(m={...m,...this._flagOverrides}),this._payloadOverrides!==void 0&&(g={...g,...this._payloadOverrides}),{featureFlags:m,featureFlagPayloads:g}}async evaluateFlags(t,r){let{distinctId:n,options:i}=this._resolveDistinctId(t,r);if(!n)return this._logger.warn("[PostHog] distinctId is required to evaluate feature flags \u2014 pass it explicitly or use withContext()"),new CSe({host:this._getFeatureFlagEvaluationsHost(),distinctId:"",flags:{}});if(this.disabled)return this._logger.warn("The client is disabled"),new CSe({host:this._getFeatureFlagEvaluationsHost(),distinctId:n,flags:{}});let{groups:o,disableGeoip:s}=i||{},a=i?.flagKeys??void 0;if(a?.length===0)return new CSe({host:this._getFeatureFlagEvaluationsHost(),distinctId:n,groups:o,disableGeoip:s,flags:{}});let{onlyEvaluateLocally:c,personProperties:l,groupProperties:u}=i||{},p=this.addLocalPersonAndGroupProperties(n,o,l,u);l=p.allPersonProperties,u=p.allGroupProperties;let d=this.createFeatureFlagEvaluationContext(n,o,this.personPropertiesForLocalEvaluation(n,l),u);c==null&&(c=this.options.strictLocalEvaluation??!1);let f=a?new Set(a):void 0,m={},g,A,y=!1,I=!1,C=await this.featureFlagsPoller?.getAllFlagsAndPayloads(d,a),x=new Set;if(C)for(let[D,R]of Object.entries(C.response)){let O=this.featureFlagsPoller?.featureFlagsByKey[D];m[D]={key:D,enabled:R!==!1,variant:typeof R=="string"?R:void 0,payload:C.payloads[D],id:O?.id,version:void 0,reason:"Evaluated locally",locallyEvaluated:!0,hasExperiment:O?.has_experiment},x.add(D)}let S=f!==void 0&&Array.from(f).some(D=>this.featureFlagsPoller?.featureFlagsByKey[D]===void 0);if((C?C.fallbackToFlags||S:!0)&&!c){let D=await super.getFeatureFlagDetailsStateless(d.distinctId,d.groups,l,u,s,a);if(D){this._minimalFlagCalledEvents=D.minimalFlagCalledEvents===!0,g=D.requestId,A=D.evaluatedAt,y=!!D.errorsWhileComputingFlags,I=Array.isArray(D.quotaLimited)&&D.quotaLimited.includes("feature_flags");for(let[R,O]of Object.entries(D.flags)){if(x.has(R))continue;let z;if(O.metadata?.payload!==void 0)try{z=JSON.parse(O.metadata.payload)}catch{z=O.metadata.payload}m[R]={key:R,enabled:O.enabled,variant:O.variant,payload:z,id:O.metadata?.id,version:O.metadata?.version,reason:O.reason?.description??O.reason?.code,locallyEvaluated:!1,hasExperiment:O.metadata?.has_experiment}}}}if(this._flagOverrides!==void 0)for(let[D,R]of Object.entries(this._flagOverrides)){if(R===void 0){delete m[D];continue}let O=m[D];m[D]={key:D,enabled:R!==!1,variant:typeof R=="string"?R:void 0,payload:O?.payload,id:O?.id,version:O?.version,reason:O?.reason,locallyEvaluated:O?.locallyEvaluated??!1,hasExperiment:O?.hasExperiment}}if(this._payloadOverrides!==void 0)for(let[D,R]of Object.entries(this._payloadOverrides)){let O=m[D];O&&(m[D]={...O,payload:R})}if(f!==void 0)for(let D of Object.keys(m))f.has(D)||delete m[D];return new CSe({host:this._getFeatureFlagEvaluationsHost(),distinctId:n,groups:o,disableGeoip:s,flags:m,requestId:g,evaluatedAt:A,flagDefinitionsLoadedAt:this.featureFlagsPoller?.getFlagDefinitionsLoadedAt(),errorsWhileComputing:y,quotaLimited:I})}_shouldSendMinimalFlagCalledEvent(t,r){return t==="$feature_flag_called"&&this._minimalFlagCalledEvents&&r.$feature_flag_has_experiment===!1}_captureFlagCalledEventIfNeeded(t){let{distinctId:r,key:n,response:i,groups:o,disableGeoip:s,properties:a}=t,c=o&&Object.keys(o).length>0?`_${JSON.stringify(Object.entries(o).sort(([u],[p])=>u<p?-1:u>p?1:0))}`:"",l=`${n}_${i}${c}`;r in this.distinctIdHasSentFlagCalls&&this.distinctIdHasSentFlagCalls[r].has(l)||(Object.keys(this.distinctIdHasSentFlagCalls).length>=this.maxCacheSize&&(this.distinctIdHasSentFlagCalls={}),this.distinctIdHasSentFlagCalls[r]instanceof Set?this.distinctIdHasSentFlagCalls[r].add(l):this.distinctIdHasSentFlagCalls[r]=new Set([l]),this.capture({distinctId:r,event:"$feature_flag_called",properties:a,groups:o,disableGeoip:s}))}_getFeatureFlagEvaluationsHost(){return this._featureFlagEvaluationsHost||(this._featureFlagEvaluationsHost={captureFlagCalledEventIfNeeded:t=>this._captureFlagCalledEventIfNeeded(t),logWarning:t=>{this.options.featureFlagsLogWarnings!==!1&&console.warn(`[PostHog] ${t}`)}}),this._featureFlagEvaluationsHost}groupIdentify({groupType:t,groupKey:r,properties:n,distinctId:i,disableGeoip:o}){this._sendPreparedEvent("capture",{distinctId:i||`$${t}_${r}`,event:"$groupidentify",properties:{$group_type:t,$group_key:r,$group_set:n||{}},disableGeoip:o},!1,{includeContextProperties:!1})}async groupIdentifyImmediate({groupType:t,groupKey:r,properties:n,distinctId:i,disableGeoip:o}){await this._sendPreparedEvent("capture",{distinctId:i||`$${t}_${r}`,event:"$groupidentify",properties:{$group_type:t,$group_key:r,$group_set:n||{}},disableGeoip:o},!0,{includeContextProperties:!1})}async reloadFeatureFlags(){await this.featureFlagsPoller?.loadFeatureFlags(!0)}overrideFeatureFlags(t){let r=n=>Object.fromEntries(n.map(i=>[i,!0]));if(t===!1){this._flagOverrides=void 0,this._payloadOverrides=void 0;return}if(Array.isArray(t)){this._flagOverrides=r(t);return}if(this._isFeatureFlagOverrideOptions(t)){"flags"in t&&(t.flags===!1?this._flagOverrides=void 0:Array.isArray(t.flags)?this._flagOverrides=r(t.flags):t.flags!==void 0&&(this._flagOverrides={...t.flags})),"payloads"in t&&(t.payloads===!1?this._payloadOverrides=void 0:t.payloads!==void 0&&(this._payloadOverrides={...t.payloads}));return}this._flagOverrides={...t}}_isFeatureFlagOverrideOptions(t){if(typeof t!="object"||t===null||Array.isArray(t))return!1;let r=t;if("flags"in r){let n=r.flags;if(n===!1||Array.isArray(n)||typeof n=="object"&&n!==null)return!0}if("payloads"in r){let n=r.payloads;if(n===!1||typeof n=="object"&&n!==null)return!0}return!1}withContext(t,r,n){return this.context?this.context.run(t,r,n):r()}getContext(){return this.context?.get()}enterContext(t,r){this.context?.enter(t,r)}async _shutdown(t){let r=Date.now()+(t??3e4),n=this._consumeWaitUntilCycle();await this.featureFlagsPoller?.stopPoller(t),this.errorTracking.shutdown(),this._metrics&&(await ESe(this._metrics.flush().catch(()=>{}),Math.max(0,r-Date.now())),this._metrics.reset()),this._traces&&(await ESe(this._traces.flush().catch(()=>{}),Math.max(0,r-Date.now())),this._traces.reset());try{return await super._shutdown(Math.max(0,r-Date.now()))}finally{this.distinctIdHasSentFlagCalls={},n?.()}}async _requestRemoteConfigPayload(t){if(this.disabled||!this.apiKey||!this.options.personalApiKey)return;let r=`${this.host}/api/projects/@current/feature_flags/${t}/remote_config?token=${encodeURIComponent(this.apiKey)}`,n={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",Authorization:`Bearer ${this.options.personalApiKey}`}},i=null;if(this.options.requestTimeout&&typeof this.options.requestTimeout=="number"){let o=new AbortController;i=T2(()=>{o.abort()},this.options.requestTimeout),n.signal=o.signal}try{return await this.fetch(r,n)}catch(o){this._events.emit("error",o);return}finally{i&&clearTimeout(i)}}extractPropertiesFromEvent(t,r){if(!t)return{personProperties:{},groupProperties:{}};let n={},i={};for(let[o,s]of Object.entries(t))if(mZl(s)&&r&&o in r){let a={};for(let[c,l]of Object.entries(s))a[String(c)]=String(l);i[String(o)]=a}else n[String(o)]=String(s);return{personProperties:n,groupProperties:i}}async getFeatureFlagsForEvent(t,r,n,i){if(this.disabled||!this.apiKey)return void this._logger.warn("The client is disabled");let o=i?.personProperties||{},s=i?.groupProperties||{},a=i?.flagKeys;if(i?.onlyEvaluateLocally??this.options.strictLocalEvaluation??!1)if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let l={};for(let[u,p]of Object.entries(r||{}))l[u]=String(p);return await this.getAllFlags(t,{groups:l,personProperties:o,groupProperties:s,disableGeoip:n,onlyEvaluateLocally:!0,flagKeys:a})}else return{};if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let l={};for(let[u,p]of Object.entries(r||{}))l[u]=String(p);return await this.getAllFlags(t,{groups:l,personProperties:o,groupProperties:s,disableGeoip:n,onlyEvaluateLocally:!0,flagKeys:a})}return(await super.getFeatureFlagsStateless(t,r,o,s,n)).flags}addLocalPersonAndGroupProperties(t,r,n,i){let o={...n||{}},s={};if(r)for(let a of Object.keys(r))s[a]={$group_key:r[a],...i?.[a]||{}};return{allPersonProperties:o,allGroupProperties:s}}personPropertiesForLocalEvaluation(t,r){return{distinct_id:t,...r||{}}}createFeatureFlagEvaluationContext(t,r,n,i){return{distinctId:t,groups:r||{},personProperties:n||{},groupProperties:i||{},evaluationCache:{}}}captureException(t,r,n,i,o){if(!iUe.isPreviouslyCapturedError(t)){let s=new Error("PostHog syntheticException");this.addPendingPromise(iUe.buildEventMessage(this.getErrorPropertiesBuilder(),t,{syntheticException:s},r,n).then(a=>this._capturePreparedEvent({...a,uuid:i,flags:o},!1)))}}async captureExceptionImmediate(t,r,n,i){if(!iUe.isPreviouslyCapturedError(t)){let o=new Error("PostHog syntheticException");return this.addPendingPromise(iUe.buildEventMessage(this.getErrorPropertiesBuilder(),t,{syntheticException:o},r,n).then(s=>this.captureImmediate({...s,flags:i})))}}async prepareEventMessage(t){return this._prepareEventMessage(t)}async _prepareEventMessage(t,r={}){let{distinctId:n,event:i,properties:o,groups:s,flags:a,sendFeatureFlags:c,timestamp:l,disableGeoip:u,uuid:p}=t,d=this.context?.get(),f=r.includeContextProperties??!0,m=n||d?.distinctId,g=f?{...this.props,...d?.properties||{},...o||{}}:{...o||{}};m||(m=w2(),g.$process_person_profile=!1),f&&d?.sessionId&&!g.$session_id&&(g.$session_id=d.sessionId);let A=this._shouldSendMinimalFlagCalledEvent(i,g)?e9t(g):g,y=this._runBeforeSend({distinctId:m,event:i,properties:A,groups:s,flags:a,sendFeatureFlags:c,timestamp:l,disableGeoip:u,uuid:p});if(!y)return Promise.reject(null);let I=await Promise.resolve().then(async()=>{if(a)return c&&console.warn("[PostHog] Both `flags` and `sendFeatureFlags` were passed to capture(); using `flags` and ignoring `sendFeatureFlags`."),a._getEventProperties();if(c){$Zr("sendFeatureFlags","`sendFeatureFlags` is deprecated and will be removed in a future major version. Pass a `flags` snapshot from `posthog.evaluateFlags(...)` instead \u2014 it avoids a second `/flags` request per capture and guarantees the event carries the exact flag values your code branched on.");let C=typeof c=="object"?c:void 0,x=await this.getFeatureFlagsForEvent(y.distinctId,s,u,C);return bnh(x)}return{}}).catch(()=>({})).then(C=>{let x=y.groups||s;return{...C,...y.properties||{},...x!==void 0&&Object.keys(x).length>0?{$groups:x}:{}}});return y.event==="$pageview"&&this.options.__preview_capture_bot_pageviews&&typeof I.$raw_user_agent=="string"&&gZl(I.$raw_user_agent,this.options.custom_blocked_useragents||[])&&(y.event="$bot_pageview",I.$browser_type="bot"),{distinctId:y.distinctId,event:y.event,properties:I,options:{timestamp:y.timestamp,disableGeoip:y.disableGeoip,uuid:y.uuid}}}_runBeforeSend(t){let r=this.options.before_send;if(!r)return t;let n=Array.isArray(r)?r:[r],i=t;for(let o of n)try{if(i=o(i),!i)return this._logger.info(`Event '${t.event}' was rejected in beforeSend function`),null;if(!i.properties||Object.keys(i.properties).length===0){let s=`Event '${i.event}' has no properties after beforeSend function, this is likely an error.`;this._logger.warn(s)}}catch(s){return this._logger.error(`Error in before_send function for event '${t.event}':`,s),null}return i}};var meu=require("async_hooks"),t$r=class{constructor(){this.storage=new meu.AsyncLocalStorage}get(){return this.storage.getStore()}run(t,r,n){return this.storage.run(this.resolve(t,n),r)}enter(t,r){this.storage.enterWith(this.resolve(t,r))}resolve(t,r){if(r?.fresh===!0)return t;let n=this.get()||{};return{distinctId:t.distinctId??n.distinctId,sessionId:t.sessionId??n.sessionId,properties:{...n.properties||{},...t.properties||{}}}}};var heu=require("async_hooks"),r$r=class{active(){return this._storage.getStore()}with(t,r){return this._storage.run(t,r)}constructor(){this._storage=new heu.AsyncLocalStorage}};var geu=require("zlib"),Aeu=require("util"),Enh=(0,Aeu.promisify)(geu.gzip);async function yeu(e,t=!0){try{let r=await Enh(e);return new Uint8Array(r)}catch(r){return t&&console.error("Failed to gzip compress data",r),null}}var n$r=require("os");function beu(){let e,t;try{e=(0,n$r.platform)(),t=(0,n$r.release)()}catch{}return Fqo(e,t)}var Eeu="posthog-node";function Inh(e,{organization:t,projectId:r,prefix:n,severityAllowList:i=["error"],sendExceptionsToPostHog:o=!0}={}){return s=>{if(!(i==="*"||i.includes(s.level)))return s;s.tags||(s.tags={});let c=s.tags[eWo.POSTHOG_ID_TAG];if(c===void 0)return s;let l=e.options.host??"https://us.i.posthog.com",u=new URL(`/project/${e.apiKey}/person/${c}`,l).toString();s.tags["PostHog Person URL"]=u;let p=s.exception?.values||[],d=p.map(g=>({...g,stacktrace:g.stacktrace?{...g.stacktrace,type:"raw",frames:(g.stacktrace.frames||[]).map(A=>({...A,platform:"node:javascript"}))}:void 0})),f={$exception_message:p[0]?.value||s.message,$exception_type:p[0]?.type,$exception_level:s.level,$exception_list:d,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:p[0]?.value||s.message,$sentry_exception_type:p[0]?.type,$sentry_tags:s.tags},m=mT.getInjectedReleaseId();return m&&(f.$release_id=m),t&&r&&(f.$sentry_url=(n||"https://sentry.io/organizations/")+t+"/issues/?project="+r+"&query="+s.event_id),o&&e.capture({event:"$exception",distinctId:c,properties:f}),s}}var eWo=class{static{this.POSTHOG_ID_TAG="posthog_distinct_id"}constructor(t,r,n,i,o){this.name=Eeu,this.name=Eeu,this.setupOnce=function(s,a){let c=a()?.getClient()?.getDsn()?.projectId;s(Inh(t,{organization:r,projectId:c,prefix:n,severityAllowList:i,sendExceptionsToPostHog:o??!0}))}}};var Wte=class extends e$r{getLibraryId(){return"posthog-node"}compressPayload(t){return yeu(t,this.isDebug)}initializeContext(){return new t$r}initializeSpanContextManager(){return new r$r}hostResourceAttributes(){return beu()}createErrorPropertiesBuilder(){return new mT.ErrorPropertiesBuilder([new mT.EventCoercer,new mT.ErrorCoercer,new mT.ObjectCoercer,new mT.StringCoercer,new mT.PrimitiveCoercer],mT.createStackParser("node:javascript",mT.nodeStackLineParser),[lZl(),t=>W$l(t,void 0,this._logger),Y$l()])}};function Ieu(e){return e==null||!e.enabled?!1:e.variant==null||e.variant==="true"}var i$r=class{isEnabled(){return Promise.resolve(!1)}getCachedValue(){}flush(){return Promise.resolve()}},vnh="feature_flag_evaluated",Cnh=3e3,xnh=3e3,o$r=class{evaluator;environment;sendFeatureFlagEvents;pending=new Map;resolved=new Map;constructor({environment:t,sendFeatureFlagEvents:r,posthogApiKey:n,evaluator:i}){this.environment=t,this.sendFeatureFlagEvents=r,this.evaluator=i??new Wte(n??"",{featureFlagsRequestTimeoutMs:Cnh,isServer:!1})}isEnabled(t,r){let n=veu(t,r),i=this.pending.get(n);if(i!=null)return i;let o=this.evaluateAndRemember(t,r,n);return this.pending.set(n,o),o}async evaluateAndRemember(t,r,n){let i=await this.evaluate(t,r);return this.resolved.set(n,i),i}getCachedValue(t,r){return this.resolved.get(veu(t,r))}async flush(){if(!this.sendFeatureFlagEvents)return;let t;try{await Promise.race([this.flushAfterPendingEvaluations(),new Promise(r=>{t=setTimeout(r,xnh),t.unref()})])}catch{}finally{clearTimeout(t)}}async flushAfterPendingEvaluations(){await Promise.allSettled(this.pending.values()),await this.evaluator.flush()}async evaluate(t,r){let{org:n}=r,i=wnh(r,this.environment),o;try{o=await this.evaluator.getFeatureFlagResult(t,tWo(n),{personProperties:i,groups:{organization:n},groupProperties:{organization:i},sendFeatureFlagEvents:!1})}catch{return!1}return this.sendFeatureFlagEvents&&this.captureFlagUsage({flag:t,org:n,result:o,properties:i}),Ieu(o)}captureFlagUsage({flag:t,org:r,result:n,properties:i}){let o=Snh(n),s={...i,...n?.reason!=null?{$feature_flag_reason:n.reason}:{},version:"5.198.0"};this.tryCapture({distinctId:tWo(r),event:"$feature_flag_called",groups:{organization:r},properties:{...s,$feature_flag:t,$feature_flag_response:o,[`$feature/${t}`]:o}}),this.tryCapture({distinctId:tWo(r),event:vnh,groups:{organization:r},properties:{...s,flag:t,response:o,enabled:Ieu(n)}})}tryCapture(t){try{this.evaluator.capture(t)}catch{}}};function Snh(e){if(e!=null)return e.enabled?e.variant??!0:!1}function tWo(e){return`org:${e}`}function wnh({org:e,generator:t,language:r},n){return{org:e,environment:n,...t!=null?{generator:t}:{},...r!=null?{language:r}:{}}}function veu(e,{org:t,generator:r,language:n}){return JSON.stringify([e,t,r??null,n??null])}var s$r;function a$r(){return s$r==null&&(s$r=Tnh()),s$r}async function rWo(){await s$r?.flush()}function Tnh(){let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal";return e==null||e.trim().length===0?new i$r:new o$r({posthogApiKey:e,environment:wK(),sendFeatureFlagEvents:lZr()})}var c$r=class{posthog;constructor({posthogApiKey:t}){this.posthog=new Wte(t,{isServer:!1})}async identify(){}async sendEvent(t){t.orgId!=null&&this.posthog.capture({distinctId:t.orgId,event:"CLI",properties:{...t,...t.properties,version:"5.198.0",usingAccessToken:!0,cliReleaseEnvironment:wK(),...Tpe()}})}sendAutomationEvent(t){this.posthog.capture({distinctId:t.distinctId,event:t.event,properties:{...t.properties,cliReleaseEnvironment:wK()}})}async flush(){try{await Promise.race([this.posthog.flush(),new Promise(t=>setTimeout(t,3e3))])}catch{}}};var E9t=class{async sendEvent(){}async sendAutomationEvent(){}async identify(){}async flush(){}};ef();tr();var llt=require("fs/promises"),Ceu=require("os"),xeu=require("path");r_e();var Onh="id",Pnh=".fern",I9t=class{posthog;userId;token;constructor({token:t,posthogApiKey:r}){this.posthog=new Wte(r,{isServer:!1}),this.userId=t==null?void 0:Hqi(t),this.token=t}async identify(){this.userId!=null&&this.posthog.alias({distinctId:this.userId,alias:await this.getPersistedDistinctId()})}async sendEvent(t){let r=await this.getUserEmail();this.posthog.capture({distinctId:this.userId??await this.getPersistedDistinctId(),event:"CLI",properties:{version:"5.198.0",...t,...t.properties,usingAccessToken:!1,cliReleaseEnvironment:wK(),agent:Dcr(),...r!=null?{userEmail:r}:{},...Tpe()}})}sendAutomationEvent(t){this.posthog.capture({distinctId:t.distinctId,event:t.event,properties:{...t.properties,cliReleaseEnvironment:wK()}})}async flush(){try{await Promise.race([this.posthog.flush(),new Promise(t=>setTimeout(t,3e3))])}catch{}}userEmail;async getUserEmail(){if(this.userEmail!==null){if(this.userEmail!=null)return this.userEmail;if(this.token==null){this.userEmail=null;return}try{let t=await kl({token:this.token.value}).user.getMyself();if(t.ok&&t.body.email!=null)return this.userEmail=t.body.email,this.userEmail}catch{}this.userEmail=null}}persistedDistinctId;async getPersistedDistinctId(){if(this.persistedDistinctId==null){let t=uw(),r=Re(Zt.of((0,Ceu.homedir)()),be.of(Pnh),be.of(Onh));try{await Ut(r)?this.persistedDistinctId=(await(0,llt.readFile)(r)).toString():(await(0,llt.mkdir)((0,xeu.dirname)(r),{recursive:!0}),await(0,llt.writeFile)(r,t),this.persistedDistinctId=t)}catch{this.persistedDistinctId=t}}return this.persistedDistinctId}};var nWo;async function v9t(){return nWo==null&&(nWo=await Bnh()),nWo}async function Bnh(){try{let e="phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal";if(e==null||!lZr())return new E9t;let t=await CYe();return t!=null?new I9t({token:t,posthogApiKey:e}):await oz()!=null?new c$r({posthogApiKey:e}):new I9t({token:void 0,posthogApiKey:e})}catch{return new E9t}}cn();It();Dt();cQ();var C9t=Ae(require("process"),1);P7e();var Teu=Ae(n6o(),1),Oeu=Ae(weu(),1);function hT(e,t={}){if(typeof e!="string"||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=QW(e),e.length===0))return 0;e=e.replace((0,Oeu.default)()," ");let r=t.ambiguousIsNarrow?1:2,n=0;for(let i of e){let o=i.codePointAt(0);if(o<=31||o>=127&&o<=159||o>=768&&o<=879)continue;switch(Teu.default.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}cn();function l$r(e){let t=0;for(let r of e.split(`
|
|
3474
3475
|
`))t=Math.max(t,hT(r));return t}var Keu=Ae(oWo(),1);var Rnh=/[\p{Lu}]/u,knh=/[\p{Ll}]/u,Deu=/^[\p{Lu}](?![\p{Lu}])/gu,Feu=/([\p{Alpha}\p{N}_]|$)/u,sWo=/[_.\- ]+/,Fnh=new RegExp("^"+sWo.source),Reu=new RegExp(sWo.source+Feu.source,"gu"),keu=new RegExp("\\d+"+Feu.source,"gu"),Nnh=(e,t,r,n)=>{let i=!1,o=!1,s=!1,a=!1;for(let c=0;c<e.length;c++){let l=e[c];a=c>2?e[c-3]==="-":!0,i&&Rnh.test(l)?(e=e.slice(0,c)+"-"+e.slice(c),i=!1,s=o,o=!0,c++):o&&s&&knh.test(l)&&(!a||n)?(e=e.slice(0,c-1)+"-"+e.slice(c-1),s=o,o=!1,i=!0):(i=t(l)===l&&r(l)!==l,s=o,o=r(l)===l&&t(l)!==l)}return e},jnh=(e,t)=>(Deu.lastIndex=0,e.replace(Deu,r=>t(r))),znh=(e,t)=>(Reu.lastIndex=0,keu.lastIndex=0,e.replace(Reu,(r,n)=>t(n)).replace(keu,r=>t(r)));function aWo(e,t){if(!(typeof e=="string"||Array.isArray(e)))throw new TypeError("Expected the input to be `string | string[]`");if(t={pascalCase:!1,preserveConsecutiveUppercase:!1,...t},Array.isArray(e)?e=e.map(o=>o.trim()).filter(o=>o.length).join("-"):e=e.trim(),e.length===0)return"";let r=t.locale===!1?o=>o.toLowerCase():o=>o.toLocaleLowerCase(t.locale),n=t.locale===!1?o=>o.toUpperCase():o=>o.toLocaleUpperCase(t.locale);return e.length===1?sWo.test(e)?"":t.pascalCase?n(e):r(e):(e!==r(e)&&(e=Nnh(e,r,n,t.preserveConsecutiveUppercase)),e=e.replace(Fnh,""),e=t.preserveConsecutiveUppercase?jnh(e,r):r(e),t.pascalCase&&(e=n(e.charAt(0))+e.slice(1)),znh(e,n))}var pWo=Ae(jeu(),1);P7e();var zeu=(e=0)=>t=>`\x1B[${t+e}m`,Qeu=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Meu=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,HE={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},L9v=Object.keys(HE.modifier),_nh=Object.keys(HE.color),Unh=Object.keys(HE.bgColor),_9v=[..._nh,...Unh];function Vnh(){let e=new Map;for(let[t,r]of Object.entries(HE)){for(let[n,i]of Object.entries(r))HE[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=HE[n],e.set(i[0],i[1]);Object.defineProperty(HE,t,{value:r,enumerable:!1})}return Object.defineProperty(HE,"codes",{value:e,enumerable:!1}),HE.color.close="\x1B[39m",HE.bgColor.close="\x1B[49m",HE.color.ansi=zeu(),HE.color.ansi256=Qeu(),HE.color.ansi16m=Meu(),HE.bgColor.ansi=zeu(10),HE.bgColor.ansi256=Qeu(10),HE.bgColor.ansi16m=Meu(10),Object.defineProperties(HE,{rgbToAnsi256:{value(t,r,n){return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(o=>o+o).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>HE.rgbToAnsi256(...HE.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,i;if(t>=232)r=((t-232)*10+8)/255,n=r,i=r;else{t-=16;let a=t%36;r=Math.floor(t/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let o=Math.max(r,n,i)*2;if(o===0)return 30;let s=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return o===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>HE.ansi256ToAnsi(HE.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>HE.ansi256ToAnsi(HE.hexToAnsi256(t)),enumerable:!1}}),HE}var Gnh=Vnh(),Leu=Gnh;var u$r=new Set(["\x1B","\x9B"]),qnh=39,lWo="\x07",Veu="[",Wnh="]",Geu="m",uWo=`${Wnh}8;;`,_eu=e=>`${u$r.values().next().value}${Veu}${e}${Geu}`,Ueu=e=>`${u$r.values().next().value}${uWo}${e}${lWo}`,Hnh=e=>e.split(" ").map(t=>hT(t)),cWo=(e,t,r)=>{let n=[...t],i=!1,o=!1,s=hT(QW(e[e.length-1]));for(let[a,c]of n.entries()){let l=hT(c);if(s+l<=r?e[e.length-1]+=c:(e.push(c),s=0),u$r.has(c)&&(i=!0,o=n.slice(a+1).join("").startsWith(uWo)),i){o?c===lWo&&(i=!1,o=!1):c===Geu&&(i=!1);continue}s+=l,s===r&&a<n.length-1&&(e.push(""),s=0)}!s&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Knh=e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(hT(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},Jnh=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let n="",i,o,s=Hnh(e),a=[""];for(let[l,u]of e.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let p=hT(a[a.length-1]);if(l!==0&&(p>=t&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),p=0),(p>0||r.trim===!1)&&(a[a.length-1]+=" ",p++)),r.hard&&s[l]>t){let d=t-p,f=1+Math.floor((s[l]-d-1)/t);Math.floor((s[l]-1)/t)<f&&a.push(""),cWo(a,u,t);continue}if(p+s[l]>t&&p>0&&s[l]>0){if(r.wordWrap===!1&&p<t){cWo(a,u,t);continue}a.push("")}if(p+s[l]>t&&r.wordWrap===!1){cWo(a,u,t);continue}a[a.length-1]+=u}r.trim!==!1&&(a=a.map(l=>Knh(l)));let c=[...a.join(`
|
|
3475
3476
|
`)];for(let[l,u]of c.entries()){if(n+=u,u$r.has(u)){let{groups:d}=new RegExp(`(?:\\${Veu}(?<code>\\d+)m|\\${uWo}(?<uri>.*)${lWo})`).exec(c.slice(l).join(""))||{groups:{}};if(d.code!==void 0){let f=Number.parseFloat(d.code);i=f===qnh?void 0:f}else d.uri!==void 0&&(o=d.uri.length===0?void 0:d.uri)}let p=Leu.codes.get(Number(i));c[l+1]===`
|
|
3476
3477
|
`?(o&&(n+=Ueu("")),i&&p&&(n+=_eu(p))):u===`
|
|
@@ -4100,7 +4101,7 @@ let credentials = Data("${r.username}:${r.password}".utf8).base64EncodedString()
|
|
|
4100
4101
|
`)),Object.keys(u).length>0&&(s.css=u)}let c;if(i!=null){let{inline:l,...u}=i;l!=null&&l.length>0&&(c=l.join(`
|
|
4101
4102
|
`)),Object.keys(u).length>0&&(s.js=u)}return{stripped:s,header:t!=null&&t.length>0?t:void 0,footer:r!=null&&r.length>0?r:void 0,cssInline:a,jsInline:c}}var A_u=require("fs/promises");function W8e(e){return e.outputMode._visit({downloadFiles:()=>{},github:t=>`https://github.com/${t.owner}/${t.repo}`,githubV2:t=>t._visit({commitAndRelease:r=>`https://github.com/${r.owner}/${r.repo}`,pullRequest:r=>`https://github.com/${r.owner}/${r.repo}`,push:r=>`https://github.com/${r.owner}/${r.repo}`,_other:()=>{}}),publish:()=>{},publishV2:()=>{},_other:()=>{}})}async function H8e(e,t,r){let n;try{n=await(0,A_u.readFile)(e,"utf8")}catch{return}let i=new Set([t]),o="fernapi/";t.startsWith(o)&&i.add(t.slice(o.length));let s=n.split(`
|
|
4102
4103
|
`),a=0,c=/^\s*-\s+name:\s*["']?([A-Za-z0-9/_.\-@]+)["']?\s*(#.*)?$/;for(let l=0;l<s.length;l++){let u=s[l];if(u==null)continue;let p=u.match(c);if(!(p==null||p[1]==null)&&i.has(p[1])){if(a===r)return l+1;a++}}}var q8e=class{#e=new WeakMap;#t=new Map;recordOccurrences(t){for(let r of t){let n=this.#t.get(r.name)??0;this.#e.set(r,n),this.#t.set(r.name,n+1)}}lookup(t){return this.#e.get(t)??0}};It();Dt();var E_u=Ae(ly(),1),Pmi=new Map;async function I_u({origin:e,organization:t,token:r,generatorId:n,language:i}){let o=JSON.stringify([e,t,r.value,n,i]),s=Pmi.get(o);if(s!=null)return s;let a=Ugs({origin:e,organization:t,token:r,generatorId:n,language:i,currentVersion:"latest",includeMajor:!0});Pmi.set(o,a);try{return await a}finally{Pmi.get(o)===a&&Pmi.delete(o)}}async function Ugs({origin:e,organization:t,token:r,generatorId:n,language:i,currentVersion:o,includeMajor:s}){let a=new URL("v1/fern/generator-versions/discover",`${Zg(e)}/`),c=`${n}@${o}`,l;try{l=await fetch(a,{method:"POST",headers:{Authorization:`Bearer ${r.value}`,"X-Fern-Organization-Id":t,"content-type":"application/json"},body:JSON.stringify({targets:[{targetId:"generator",generatorId:n,language:i,currentVersion:o,includeMajor:s}]})})}catch(u){throw new Error(`SDK Gen API version discovery failed for ${c} because the API could not be reached. Verify FERN_SDK_GEN_API_ORIGIN and the selected environment.`,{cause:u})}if(!l.ok)throw new Error(`SDK Gen API version discovery failed for ${c} with HTTP ${l.status}. Verify FERN_SDK_GEN_API_ORIGIN and the selected environment.`);return geg(await l.json())}function geg(e){if(!b_u(e,["targets"])||!Array.isArray(e.targets)||e.targets.length!==1)throw new Error("SDK Gen API returned an invalid generator version discovery response");let t=e.targets[0];if(!Pr(t)||t.targetId!=="generator")throw new Error("SDK Gen API returned an invalid generator version discovery target");if(t.state==="UNAVAILABLE"){if(!b_u(t,["targetId","state","reason"])||t.reason!=="IDENTITY_UNAVAILABLE"&&t.reason!=="LANGUAGE_MISMATCH"&&t.reason!=="VERSION_UNAVAILABLE")throw new Error("SDK Gen API returned an invalid unavailable generator version result");return{targetId:"generator",state:"UNAVAILABLE",reason:t.reason}}if(t.state!=="RESOLVED")throw new Error("SDK Gen API returned an unknown generator version discovery state");if(!v_u(t,["targetId","state","compatibleVersion","withheldMajorVersion"]))throw new Error("SDK Gen API returned an invalid resolved generator version result");let r=y_u(t,"compatibleVersion"),n=y_u(t,"withheldMajorVersion");if(r==null&&n==null)throw new Error("SDK Gen API returned an empty generator version discovery result");return{targetId:"generator",state:"RESOLVED",...r==null?{}:{compatibleVersion:r},...n==null?{}:{withheldMajorVersion:n}}}function y_u(e,t){if(!Object.hasOwn(e,t))return;let r=e[t];if(typeof r!="string"||E_u.default.valid(r)!==r)throw new w({message:`SDK Gen API returned invalid ${t} ${JSON.stringify(r)}. Expected an exact semantic version such as 1.2.3.`,code:w.Code.VersionError});return r}function b_u(e,t){return Pr(e)&&Object.keys(e).length===t.length&&v_u(e,t)}function v_u(e,t){let r=new Set(t);return Object.keys(e).every(n=>r.has(n))}var _Yt=require("os"),C_u=require("v8"),eFe=require("worker_threads"),kmi=require("zlib");dy();Dt();o4();P2();ep();function Bmi({workspace:e,generators:t,context:r}){return t.map(n=>{let i=Mg({workspace:e,generationLanguage:n.language,keywords:void 0,smartCasing:n.smartCasing,smartCasingDigitWordBoundary:n.smartCasingDigitWordBoundary,exampleGeneration:{disabled:!0,skipAutogenerationIfManualExamplesExist:!0,skipErrorAutogenerationIfManualErrorExamplesExist:!0},audiences:{type:"all"},readme:void 0,packageName:n.packageName,version:void 0,context:r,sourceResolver:new Dh(r,e),dynamicGeneratorConfig:n.dynamicGeneratorConfig}),o=m4e({ir:i,disableExamples:!0,smartCasing:n.smartCasing,smartCasingDigitWordBoundary:n.smartCasingDigitWordBoundary,generationLanguage:n.language,generatorConfig:n.dynamicGeneratorConfig});return[n.language,o]})}var x_u="fernDynamicIrWorker",S_u;function Vgs(e){S_u=e}function Ggs(){return!eFe.isMainThread&&eFe.workerData?.[x_u]===!0}function w_u(e){return JSON.parse((0,kmi.gunzipSync)(e).toString("utf8"))}function qgs(){let e=eFe.parentPort;e?.on("message",t=>{let r=[],n=e0e({logger:D0((o,...s)=>r.push([o,s]))}),i;try{let o=yeg(t.workspace),s=Bmi({workspace:o,generators:t.generators,context:n});i={id:t.id,ok:!0,results:s.map(([a,c])=>[a,c==null?void 0:(0,kmi.gzipSync)(JSON.stringify(c),{level:1})]),logs:r}}catch(o){i={id:t.id,ok:!1,error:o instanceof Error?o.stack??o.message:String(o)}}e.postMessage(i)})}function Aeg(e){return{args:Dmi({generatorsConfiguration:e.generatorsConfiguration,workspaceName:e.workspaceName,cliVersion:e.cliVersion,absoluteFilePath:e.absoluteFilePath,changelog:e.changelog,dependenciesConfiguration:{dependencies:{}},sources:e.sources}),definition:e.definition,sourceDerivedGlobalHeaderNames:e.definition.sourceDerivedGlobalHeaderNames}}function yeg({args:e,definition:t,sourceDerivedGlobalHeaderNames:r}){return r!=null&&Object.defineProperty(t,"sourceDerivedGlobalHeaderNames",{configurable:!0,enumerable:!1,value:r,writable:!0}),new FD({...e,definition:t})}function Dmi(e,t=new Map){if(e==null||typeof e!="object")return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){let n=[];t.set(e,n);for(let i of e)n.push(typeof i=="function"?void 0:Dmi(i,t));return n}let r={};t.set(e,r);for(let[n,i]of Object.entries(e))typeof i!="function"&&(r[n]=Dmi(i,t));return r}var T_u=1024**3,beg=1536,Eeg=8*T_u,Ieg=1.5*T_u;function veg(){let e=process.constrainedMemory?.()??0;return e>0?Math.min(e,(0,_Yt.totalmem)()):(0,_Yt.totalmem)()}function Ceg({registrationConcurrency:e,cores:t=(0,_Yt.availableParallelism)(),memoryBytes:r=veg()}){if(e<=1)return 0;let n=Math.floor((r-Eeg)/Ieg);return Math.max(0,Math.min(e,t-1,n))}var Rmi=class e{size;createWorker;idle=[];running=new Map;queue=[];workerCount=0;nextId=0;terminated=!1;constructor(t,r){this.size=t,this.createWorker=r}static create({registrationConcurrency:t,context:r}){let n=Ceg({registrationConcurrency:t}),i=S_u;if(n===0||i==null)return;r.logger.debug(`Generating dynamic snippet IRs on up to ${n} worker thread(s)`);let o=Math.min(beg,Math.floor((0,C_u.getHeapStatistics)().heap_size_limit/1024/1024));return new e(n,()=>new eFe.Worker(i,{workerData:{[x_u]:!0},execArgv:process.execArgv.filter(s=>s==="--enable-source-maps"),resourceLimits:{maxOldGenerationSizeMb:o},stdout:!1,stderr:!1}))}get threadCount(){return this.workerCount}get isTerminated(){return this.terminated}run(t,r){if(this.terminated)return Promise.reject(new Error("Dynamic IR worker pool was terminated"));let n;try{n={id:this.nextId++,workspace:Aeg(t),generators:Dmi(r)}}catch(i){return Promise.reject(i)}return new Promise((i,o)=>{this.queue.push({request:n,resolve:i,reject:o}),this.dispatch()})}async terminate(){this.terminated=!0;for(let r of this.queue.splice(0))r.reject(new Error("Dynamic IR worker pool was terminated"));let t=[...this.idle.splice(0),...this.running.keys()];await Promise.all(t.map(r=>r.terminate()))}dispatch(){for(;this.queue.length>0;){let t=this.idle.pop()??(this.workerCount<this.size?this.spawn():void 0);if(t==null)return;let r=this.queue.shift();if(r==null){this.idle.push(t);return}try{t.postMessage(r.request),this.running.set(t,r),t.ref()}catch(n){this.idle.push(t),r.reject(n instanceof Error?n:new Error(String(n)))}}}spawn(){let t=this.createWorker();this.workerCount++,t.unref();let r=!1;t.on("message",i=>{if(r)return;let o=this.running.get(t);this.running.delete(t),t.unref(),this.idle.push(t),o!=null&&(i.ok?o.resolve({results:i.results,logs:i.logs}):o.reject(new Error(i.error))),this.dispatch()});let n=i=>{r||(r=!0,this.removeWorker(t),this.running.get(t)?.reject(i),this.running.delete(t),this.terminated||this.dispatch())};return t.on("error",n),t.on("exit",i=>n(new Error(`Dynamic IR worker exited with code ${i}`))),t}removeWorker(t){let r=this.idle.indexOf(t);r!==-1&&this.idle.splice(r,1),this.workerCount--}};yc();It();tr();var zXt=Ae(jge(),1);Dt();cQ();var Pse=require("crypto"),E7u=Ae(AJe(),1),I7u=require("zlib");var F0s="Direct RubyGems publishing is not supported. Use output.delivery: github with publish.registry: rubygems so the gem is published by the GitHub Actions workflow generated in that repository.",Blg=/^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/;function vhi(e){return e==null?void 0:Blg.exec(e)?.[1]}function N0s(e,t,r){if(r!=null&&e.registry!==r)throw new Error(`Direct publication credential registry ${e.registry} does not match requested registry ${r}`);switch(t!=null&&gVu(t),e.registry){case"npm":case"crates":return iFe(e.registry,"token",e.token),{registry:e.registry,token:e.token};case"pypi":return iFe("pypi","username",e.username),iFe("pypi","password",e.password),{registry:"pypi",username:e.username,password:e.password};case"maven":{iFe("maven","username",e.username),iFe("maven","password",e.password);let n=Dlg(e.signature);return{registry:"maven",username:e.username,password:e.password,...n==null?{}:{signature:n}}}case"rubygems":throw new Error(F0s);case"nuget":case"go":case"composer":case"postman":throw new Error(`sdk-gen-api does not support direct ${e.registry} registry publication`)}}function hVu(e){gVu(e)}function Chi(e){let t=e.flatMap(n=>{if(!n.publicationRequested)return[];if(n.publishCredential==null){if(n.credentialsRequired)throw new Error("SDK Config direct publication is missing its credential configuration");return[]}return[N0s(n.publishCredential,n.publishUrl,n.publishRegistry)]});if(t.length>64)throw new Error("sdk-gen-api supports at most 64 direct publish credential targets");let r=Buffer.from(JSON.stringify({schemaVersion:"fern-publish-credentials/v1",credentialSetId:"00000000-0000-8000-8000-000000000000",targets:t.map(n=>({targetId:"0".repeat(20),...n}))}));if(r.length>65536)throw new Error(`sdk-gen-api publish credentials file is ${Rlg(r.length)}, exceeding the 64 KiB limit`)}function Dlg(e){if(e!=null)return iFe("maven","signature.keyId",e.keyId),iFe("maven","signature.password",e.password),iFe("maven","signature.secretKey",e.secretKey),{keyId:e.keyId,password:e.password,secretKey:e.secretKey}}function iFe(e,t,r){if(r==null||r.trim().length===0)throw new Error(`Direct ${e} publication through sdk-gen-api requires ${t}`);if(r.trim()==="OIDC"||r.trim()==="<USE_OIDC>")throw new Error(`Direct ${e} publication through sdk-gen-api does not support OIDC credentials`);if(Buffer.byteLength(r,"utf8")>16384)throw new Error(`Direct ${e} publication through sdk-gen-api ${t} exceeds the 16 KiB field limit`)}function gVu(e){try{let t=new URL(e);if(t.protocol==="https:"&&t.username.length===0&&t.password.length===0)return}catch{}throw new Error("Direct registry URL must use HTTPS and must not contain user information")}function Rlg(e){return`${(e/1024).toFixed(2)} KiB`}function AVu({claimUrl:e,buildId:t}){let r;try{r=new URL(e)}catch{return}return`${r.origin}/sdk/${encodeURIComponent(t)}${r.hash}`}var yVu=Ae(require("path"),1);function bVu(e,t){let r=yVu.default.basename(e);return t==null?r:`${r}-${t}`}Uo();It();tr();var t7u=Ae(Bgi(),1);dy();FE();Dt();cQ();cn();var FXt=require("fs"),QN=require("fs/promises"),mFe=Ae(require("path"),1),kgi=require("stream/promises");o9r();var Dgi=Ae($Wu(),1);function Mge(e,t,{target:r="stdout",...n}={}){return Dgi.default[r]?ZH.link(e,t):n.fallback===!1?e:typeof n.fallback=="function"?n.fallback(e,t):`${e} (\u200B${t}\u200B)`}Mge.isSupported=Dgi.default.stdout;Mge.stderr=(e,t,r={})=>Mge(e,t,{target:"stderr",...r});Mge.stderr.isSupported=Dgi.default.stderr;var Fgi=Ae(x0(),1),r7u=Ae(UKt(),1);function e7u(e){let t=e[0];if(t!=null)return t.coordinate._visit({npm:r=>({registry:"npm",label:"npm",version:r.version,url:`https://www.npmjs.com/package/${r.name}/v/${r.version}`}),maven:r=>({registry:"maven",label:"Maven Central",version:r.version,url:`https://central.sonatype.com/artifact/${r.group}/${r.artifact}/${r.version}`}),pypi:r=>({registry:"pypi",label:"PyPI",version:r.version,url:`https://pypi.org/project/${r.name}/${r.version}/`}),ruby:r=>({registry:"rubygems",label:"RubyGems",version:r.version,url:`https://rubygems.org/gems/${r.name}/versions/${r.version}`}),nuget:r=>({registry:"nuget",label:"NuGet",version:r.version,url:`https://www.nuget.org/packages/${r.name}/${r.version}`}),crates:r=>({registry:"crates",label:"crates.io",version:r.version,url:`https://crates.io/crates/${r.name}/${r.version}`}),_other:()=>{}})}var SAg=/^Pipeline: raw result \(\d+ bytes\): (\{.*\})$/,Rgi=class{context;generatorInvocation;absolutePathToPreview;telemetryContext;lengthOfLastLogs=0;cachedReplayResult;replayEventEmitted=!1;taskStartedAtMs=Date.now();constructor({interactiveTaskContext:t,generatorInvocation:r,absolutePathToPreview:n,telemetryContext:i}){this.context=t,this.generatorInvocation=r,this.absolutePathToPreview=n,this.telemetryContext=i}async processUpdate(t){t==null&&this.context.failAndThrow("Task is missing on job status",void 0,{code:w.Code.InternalError});let r=t.packages.map(i=>i.coordinate._visit({npm:o=>`${o.name}@${o.version}`,maven:o=>`${o.group}:${o.artifact}:${o.version}`,pypi:o=>`${o.name} ${o.version}`,ruby:o=>`${o.name}:${o.version}`,nuget:o=>`${o.name} ${o.version}`,crates:o=>`${o.name} ${o.version}`,_other:()=>"<unknown package>"}));t.packages.length>0&&this.#n==null&&(this.#n=t.packages[0]?.coordinate._visit({npm:i=>i.version,maven:i=>i.version,pypi:i=>i.version,ruby:i=>i.version,nuget:i=>i.version,crates:i=>i.version,_other:()=>{}})),this.#i==null&&(this.#i=e7u(t.packages)),this.absolutePathToPreview==null&&this.context.setSubtitle(r.length>0?r.map(i=>`\u25E6 ${i}`).join(`
|
|
4103
|
-
`):void 0);for(let i of t.logs.slice(this.lengthOfLastLogs))this.context.logger.log(RAg(i.level),i.message),this.#n==null&&(this.#n=TAg(i.message)??this.#n),this.cachedReplayResult==null&&(this.cachedReplayResult=OAg(i.message));this.lengthOfLastLogs=t.logs.length;let n=i=>{this.context.logger.debug(`Generated files. ${Mge("View here",i,{fallback:(o,s)=>`${o}: ${s}`})}`)};return await t.status._visit({notStarted:Ot,running:Ot,failed:({message:i,s3PreSignedReadUrl:o})=>{o!=null&&n(o),this.context.failAndThrow(i,void 0,{code:w.Code.ContainerError})},finished:async i=>{if(i.s3PreSignedReadUrlV2!=null){n(i.s3PreSignedReadUrlV2);let o=this.getAbsolutePathToLocalOutput();o!=null&&await Ngi({s3PreSignedReadUrl:i.s3PreSignedReadUrlV2,absolutePathToLocalOutput:o,context:this.context})}if(this.absolutePathToPreview==null)for(let o of r)this.context.logger.info(`Published ${o}`);this.#e=!0,this.#t=i.createdSnippets!=null?i.createdSnippets:!1,this.#r=i.snippetsS3PreSignedReadUrl,this.#o=i.pullRequestUrl,this.#s=i.noChangesDetected,i.actualVersion!=null&&(this.#n=i.actualVersion),this.emitReplayTelemetryIfReady()},_other:()=>{this.context.logger.warn("Received unknown update type: "+t.status.type)}}),this.#e?{createdSnippets:this.#t,snippetsS3PreSignedReadUrl:this.#r,actualVersion:this.#n,pullRequestUrl:this.#o,noChangesDetected:this.#s,publishTarget:this.#i}:void 0}getAbsolutePathToLocalOutput(){return this.absolutePathToPreview!=null?Re(this.absolutePathToPreview,be.of(mFe.default.basename(this.generatorInvocation.name))):this.generatorInvocation.absolutePathToLocalOutput}emitReplayTelemetryIfReady(){if(!this.replayEventEmitted&&this.cachedReplayResult!=null&&!this.telemetryContext.disableTelemetry)try{let t={success:!0,steps:{replay:this.cachedReplayResult},warnings:[]},n={...(0,t7u.buildReplayTelemetryProps)({pipelineResult:t,generatorName:this.generatorInvocation.name,generatorVersion:this.generatorInvocation.version,cliVersion:this.telemetryContext.cliVersion,repoUri:PAg(this.generatorInvocation),automationMode:this.telemetryContext.automationMode,autoMerge:this.telemetryContext.autoMerge,skipIfNoDiff:this.telemetryContext.skipIfNoDiff,hasBreakingChanges:!1,versionArg:this.telemetryContext.versionArg,versionBump:this.telemetryContext.versionBump,replayConfigEnabled:this.telemetryContext.replayConfigEnabled,noReplayFlag:this.telemetryContext.noReplayFlag,githubMode:BAg(this.generatorInvocation),previewMode:this.absolutePathToPreview!=null,durationMs:Date.now()-this.taskStartedAtMs}),surface:"fiddle",org_id:this.telemetryContext.orgId};this.context.instrumentPostHogEvent({command:"replay",properties:n}),this.context.logger.debug(`[telemetry] replay event sent: ${JSON.stringify(n)}`),this.replayEventEmitted=!0}catch(t){this.context.logger.debug(`[telemetry] failed to send replay event: ${String(t)}`)}}#e=!1;get isFinished(){return this.#e}#t=!1;get createdSnippets(){return this.#t}#r=void 0;get snippetsS3PreSignedReadUrl(){return this.#r}#n=void 0;get actualVersion(){return this.#n}#i=void 0;get publishTarget(){return this.#i}#o=void 0;get pullRequestUrl(){return this.#o}#s=void 0;get noChangesDetected(){return this.#s}},wAg=/Tagging release (v?\d+\.\d+\.\d+(?:-[\w.-]+)?)/;function TAg(e){let t=e.match(wAg);if(t?.[1]!=null)return t[1].replace(/^v/,"")}function OAg(e){let t=e.match(SAg);if(t?.[1]!=null)try{return JSON.parse(t[1])?.steps?.replay}catch{return}}function PAg(e){let t=e.raw?.github;return t==null?"":"uri"in t&&typeof t.uri=="string"?t.uri:"repository"in t&&typeof t.repository=="string"?t.repository:""}function BAg(e){let t=e.raw?.github;if(t!=null&&"mode"in t){if(t.mode==="pull-request")return"pull-request";if(t.mode==="commit-and-release")return"commit-and-release"}return"push"}async function Ngi({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r,skipFernignore:n=!1}){try{let i=await kAg(t),o=await FAg(t);!n&&i&&o?await NAg({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r}):!n&&i&&!o?await jAg({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r}):await DAg({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}),r.logger.info(le.green(`Downloaded to ${t}`))}catch(i){r.failAndThrow("Failed to download files",i,{code:w.Code.NetworkError})}}async function n7u({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r}){try{let n=await Nd.get(e,{responseType:"stream",timeout:6e4,signal:AbortSignal.timeout(uCs)});await(0,QN.mkdir)(mFe.default.dirname(t),{recursive:!0}),await(0,kgi.pipeline)(n.data,(0,FXt.createWriteStream)(t)),r.logger.info(le.green(`Downloaded to ${t}`))}catch(n){r.failAndThrow("Failed to download archive",n,{code:w.Code.NetworkError})}}var uCs=300*1e3;async function DAg({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}){let r=await Nd.get(e,{responseType:"stream",timeout:6e4,signal:AbortSignal.timeout(uCs)}),n=await Fgi.default.dir({prefix:"fern",unsafeCleanup:!0}),i=mFe.default.join(n.path,"output.zip");await(0,kgi.pipeline)(r.data,(0,FXt.createWriteStream)(i)),await lCs(t),await(0,QN.mkdir)(t,{recursive:!0}),await s7u(i,t)}async function lCs(e){await Ut(e)&&(await i7u(e),await(0,QN.rm)(e,{recursive:!0,force:!0}))}async function i7u(e){try{let t=await(0,QN.readdir)(e,{withFileTypes:!0});for(let r of t){let n=Zt.of(mFe.default.join(e,r.name));r.isDirectory()&&await i7u(n);try{await(0,QN.chmod)(n,493)}catch{}}await(0,QN.chmod)(e,493)}catch{}}function RAg(e){switch(e){case"DEBUG":return Vn.Debug;case"INFO":return Vn.Info;case"WARN":return Vn.Warn;case"ERROR":return Vn.Error;default:return Vn.Info}}async function kAg(e){let t=Re(e,be.of(F1));return await Ut(t)}async function FAg(e){let t=Re(e,be.of(".git"));return await Ut(t)}async function MJ(e,t,r){return(await za(r.logger,"git",e,{cwd:t,doNotPipeOutput:!0})).stdout}async function NAg({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r}){let n=Re(t,be.of(F1)),i=await Tee({absolutePathToFernignore:n});await MJ(["rm","-rf","."],t,r),await o7u({s3PreSignedReadUrl:e,outputPath:t}),await MJ(["add","."],t,r),await MJ(["reset","--",...i],t,r),await MJ(["restore","."],t,r)}async function jAg({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r}){let n=Zt.of((await Fgi.default.dir({})).path),i=Re(t,be.of(F1)),o=await Tee({absolutePathToFernignore:i});await(0,QN.cp)(t,n,{recursive:!0}),await MJ(["init"],n,r),await MJ(["add","."],n,r),await MJ(["-c","user.name=fern","-c","user.email=hey@buildwithfern.com","-c","commit.gpgsign=false","commit","--allow-empty","--no-verify","-m","init"],n,r),await MJ(["rm","-rf","."],n,r),await o7u({s3PreSignedReadUrl:e,outputPath:n}),await MJ(["add","."],n,r),await MJ(["reset","--",...o],n,r),await MJ(["restore","."],n,r),await lCs(Re(n,be.of(".git"))),await lCs(t),await(0,QN.cp)(n,t,{recursive:!0})}async function o7u({s3PreSignedReadUrl:e,outputPath:t}){let r=await Nd.get(e,{responseType:"stream",timeout:6e4,signal:AbortSignal.timeout(uCs)}),n=await Fgi.default.dir({prefix:"fern",unsafeCleanup:!0}),i=mFe.default.join(n.path,"output.zip");await(0,kgi.pipeline)(r.data,(0,FXt.createWriteStream)(i)),await s7u(i,t)}async function s7u(e,t){return new Promise((r,n)=>{r7u.default.open(e,{lazyEntries:!0},(i,o)=>{if(i||!o){n(i??new Error("Failed to open zip file"));return}o.on("error",n),o.on("end",r),o.on("entry",s=>{let a=mFe.default.join(t,s.fileName);if(s.fileName.endsWith("/")){(0,QN.mkdir)(a,{recursive:!0}).then(()=>o.readEntry()).catch(n);return}(0,QN.mkdir)(mFe.default.dirname(a),{recursive:!0}).then(()=>{o.openReadStream(s,(c,l)=>{if(c||!l){n(c??new Error("Failed to open read stream"));return}l.pipe((0,FXt.createWriteStream)(a)).on("finish",()=>o.readEntry()).on("error",n)})}).catch(n)}),o.readEntry()})})}function pCs(e){return[...new Set(e.filter(t=>t.length>0))].sort((t,r)=>r.length-t.length)}function X9(e,t){return pCs(t).reduce((r,n)=>r.replaceAll(n,"[REDACTED]"),e)}function fCs(e,t){return X9(e,t)}var zAg=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*))*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;function oSt(e){let t=zAg.exec(e);return t===null||t[1]===void 0||t[2]===void 0||t[3]===void 0?null:{core:[t[1],t[2],t[3]],prerelease:t[4]?.split(".")??null}}function a7u(e,t){for(let r=0;r<e.core.length;r+=1){let n=c7u(e.core[r]??"",t.core[r]??"");if(n!==0)return n}return QAg(e.prerelease,t.prerelease)}function QAg(e,t){if(e===null||t===null)return e===t?0:e===null?1:-1;let r=Math.max(e.length,t.length);for(let n=0;n<r;n+=1){let i=e[n],o=t[n];if(i===void 0||o===void 0)return i===o?0:i===void 0?-1:1;let s=MAg(i,o);if(s!==0)return s}return 0}function MAg(e,t){let r=/^\d+$/.test(e),n=/^\d+$/.test(t);return r&&n?c7u(e,t):r!==n?r?-1:1:e===t?0:e<t?-1:1}function c7u(e,t){return e.length!==t.length?e.length<t.length?-1:1:e===t?0:e<t?-1:1}var dCs=class extends Error{name="GeneratorConfigPolicyInvariantError";code="INVALID_GENERATOR_CUTOVER_POLICY";generatorId;language;cutoverVersion;retryable=!1;recommendedAction="FIX_GENERATOR_CUTOVER_POLICY";constructor(t,r){super(`Generator ${t} has an invalid cutover version: ${r.cutoverVersion}`),this.generatorId=t,this.language=r.language,this.cutoverVersion=r.cutoverVersion}};function LAg(e){return new Map(e.map(([t,r])=>{let n=oSt(r.cutoverVersion);if(n===null)throw new dCs(t,r);return[t,{...r,parsedCutoverVersion:n}]}))}var _Ag=LAg([["fernapi/fern-typescript",{language:"typescript",cutoverVersion:"4.0.0"}],["fernapi/fern-typescript-sdk",{language:"typescript",cutoverVersion:"4.0.0"}],["fernapi/fern-typescript-node-sdk",{language:"typescript",cutoverVersion:"4.0.0"}],["fernapi/fern-typescript-browser-sdk",{language:"typescript",cutoverVersion:"4.0.0"}],["fernapi/fern-python-sdk",{language:"python",cutoverVersion:"6.0.0"}],["fernapi/fern-java-sdk",{language:"java",cutoverVersion:"5.0.0"}],["fernapi/fern-kotlin-sdk",{language:"kotlin",cutoverVersion:"5.0.0"}],["fernapi/fern-go-sdk",{language:"go",cutoverVersion:"2.0.0"}],["fernapi/fern-csharp-sdk",{language:"csharp",cutoverVersion:"3.0.0"}],["fernapi/fern-php-sdk",{language:"php",cutoverVersion:"3.0.0"}],["fernapi/fern-ruby-sdk",{language:"ruby",cutoverVersion:"2.0.0"}],["fernapi/fern-ruby-sdk-v2",{language:"ruby",cutoverVersion:"2.0.0"}],["fernapi/fern-rust-sdk",{language:"rust",cutoverVersion:"1.0.0"}],["fernapi/fern-swift-sdk",{language:"swift",cutoverVersion:"1.0.0"}],["fernapi/fern-cli",{language:"cli",cutoverVersion:"1.0.0"}],["fernapi/fern-cli-generator",{language:"cli",cutoverVersion:"1.0.0"}],["fernapi/fern-mcp-server",{language:"mcp",cutoverVersion:"0.1.0"}]]);function NXt(e){return _Ag.get(e)}var Ose=class extends Error{name="GeneratorConfigCompatibilityError";code;generatorId;language;requestedVersion;cutoverVersion;receivedConfigKind;expectedConfigKind;expectedLanguage;retryable=!1;recommendedAction;constructor(t){super(t.message),this.code=t.code,this.generatorId=t.generatorId,this.language=t.language,this.requestedVersion=t.requestedVersion,this.cutoverVersion=t.cutoverVersion,this.receivedConfigKind=t.receivedConfigKind,this.expectedConfigKind=t.expectedConfigKind,this.expectedLanguage=t.expectedLanguage,this.recommendedAction=t.recommendedAction}};function mCs(e){return NXt(e)?.language}function fGe(e){let t=Lge(e),r=e.configKind;if(!VAg(r))throw pGe(e,{code:"INVALID_CONFIG_KIND",message:"Configuration kind must be legacy-fern or sdk-config-v1",cutoverVersion:t.cutoverVersion,expectedLanguage:t.language,expectedConfigKind:t.configKind,recommendedAction:"USE_SUPPORTED_CONFIG_KIND"},r);if(r!==t.configKind){let n=NXt(e.generatorId);throw n===void 0?new Error(`Missing validated generator policy for ${e.generatorId}`):UAg(e,n,t.configKind,r)}return t}function Lge(e){let t=NXt(e.generatorId);if(t===void 0)throw pGe(e,{code:"UNKNOWN_GENERATOR",message:`Unknown first-party generator: ${e.generatorId}`,cutoverVersion:null,expectedLanguage:null,expectedConfigKind:null,recommendedAction:"USE_KNOWN_GENERATOR_ID"});if(t.language!==e.language)throw pGe(e,{code:"GENERATOR_LANGUAGE_MISMATCH",message:`Generator ${e.generatorId} targets ${t.language}, not ${e.language}`,cutoverVersion:t.cutoverVersion,expectedLanguage:t.language,expectedConfigKind:null,recommendedAction:"USE_GENERATOR_LANGUAGE"});let r=oSt(e.requestedVersion);if(r===null)throw pGe(e,{code:"INVALID_GENERATOR_VERSION",message:`Generator version must be an exact semantic version: ${e.requestedVersion}`,cutoverVersion:t.cutoverVersion,expectedLanguage:t.language,expectedConfigKind:null,recommendedAction:"USE_EXACT_GENERATOR_VERSION"});let n=a7u(r,t.parsedCutoverVersion)<0,i=n?"legacy-fern":"sdk-config-v1";return{generatorId:e.generatorId,language:t.language,requestedVersion:e.requestedVersion,cutoverVersion:t.cutoverVersion,configKind:i,payloadKind:n?"fern-runtime-bundle":"sdk-config-v1"}}function dGe({generatorId:e,language:t,configKind:r,versionSource:n}){let i=NXt(e);if(i===void 0)throw pGe({generatorId:e,language:t,requestedVersion:"unpinned"},{code:"UNKNOWN_GENERATOR",message:`Unknown first-party generator: ${e}`,cutoverVersion:null,expectedLanguage:null,expectedConfigKind:null,recommendedAction:"USE_KNOWN_GENERATOR_ID"});if(i.language!==t)throw pGe({generatorId:e,language:t,requestedVersion:"unpinned"},{code:"GENERATOR_LANGUAGE_MISMATCH",message:`Generator ${e} targets ${i.language}, not ${t}`,cutoverVersion:i.cutoverVersion,expectedLanguage:i.language,expectedConfigKind:null,recommendedAction:"USE_GENERATOR_LANGUAGE"});let o={generatorId:e,language:t,cutoverVersion:i.cutoverVersion};if(r==="legacy-fern"){if(n!=="fern-latest")throw new Error("Legacy Fern unpinned routes must use fern-latest as their version source");return{...o,versionSource:n,configKind:r,payloadKind:"fern-runtime-bundle"}}return{...o,versionSource:n,configKind:r,payloadKind:"sdk-config-v1"}}function hCs(e){return dGe({...e,configKind:"sdk-config-v1",versionSource:"sdk-config-omitted"})}function pGe(e,t,r=e.configKind){return new Ose({generatorId:e.generatorId,language:e.language,requestedVersion:e.requestedVersion,receivedConfigKind:r,...t})}function UAg(e,t,r,n){let i=r==="legacy-fern";return pGe(e,{code:i?"LEGACY_FERN_CONFIG_REQUIRED":"SDK_CONFIG_V1_REQUIRED",message:i?`Generator ${e.generatorId} ${e.requestedVersion} requires legacy Fern configuration`:`Generator ${e.generatorId} ${e.requestedVersion} requires SDK Config v1`,cutoverVersion:t.cutoverVersion,expectedLanguage:t.language,expectedConfigKind:r,recommendedAction:i?"USE_LEGACY_FERN_CONFIG":"USE_SDK_CONFIG_V1"},n)}function VAg(e){return e==="legacy-fern"||e==="sdk-config-v1"}var LJ="latest",gCs="__fern_sdk_config_unpinned__";function jXt(e){return e===gCs}function ACs(e){return e??gCs}function jgi(e,t){return e.requestedVersion!=null?!1:e.versionSource==="fern-latest"?t===LJ:jXt(t)}var qAg=2e3,l7u=1080*1e3,u7u=6e4,aSt=64,WAg=25*1024*1024,HAg=25*1024*1024,p7u=5*1024*1024,f7u=25*1024*1024,KAg=25*1024*1024,v7u=100*1024*1024,JAg=v7u,C7u=50*1024*1024,YAg=1024*1024,x7u=60*1024*1024,yCs=20*1024,XAg="unpinned",ZAg=new Set(["localhost","127.0.0.1","[::1]","::1"]),$Ag=new Intl.Collator("en",{numeric:!0});function S7u(e,t){return t?{type:"download"}:e}var eyg=/^[a-z][a-z0-9_]{0,63}$/,Qgi=class extends Error{status;code;constructor(t,r,n){super(t),this.name="FernSdkGenApiSubmissionError",this.status=r,this.code=n}},QXt="use-sdk-gen-api",cSt="FERN_USE_SDK_GEN_API";function lSt(){let e=process.env[cSt]?.trim().toLowerCase();if(e==="true")return!0;if(e==="false")return!1}function uSt(e){let t=lSt();return t!=null?Promise.resolve(t):a$r().isEnabled(QXt,w7u(e))}function ECs(e){let t=lSt();return t??a$r().getCachedValue(QXt,w7u(e))}async function MXt({organization:e,generatorNames:t}){let r=[...new Set(t)],n=await Promise.all(r.map(async i=>{try{return await uSt({organization:e,generatorName:i})}catch{return!1}}));return new Map(r.map((i,o)=>[i,n[o]===!0]))}function w7u({organization:e,generatorName:t}){let r=fv(t);return{org:e,generator:t,...r!=null?{language:r}:{}}}var tyg=new Set(["fernapi/fern-mcp-server"]);function mGe(e){return tyg.has(e)}function LXt({generatorName:e,version:t}){let r=fv(e);return r==null||oSt(t)==null?!1:Lge({generatorId:e,language:r,requestedVersion:t}).configKind==="sdk-config-v1"}function hFe({generatorName:e,version:t,usesSdkConfig:r}){if(!mGe(e)&&!(!r&&!LXt({generatorName:e,version:t})))return lSt()!==!1}function pSt(e){return mGe(e)}function gFe(){let e=process.env.FERN_SDK_GEN_API_ORIGIN??"https://sdk-gen.postman.co";if(e==null)return;let t;try{t=new URL(e)}catch{throw new Error("FERN_SDK_GEN_API_ORIGIN must be a valid URL")}if(t.username.length>0||t.password.length>0)throw new Error("FERN_SDK_GEN_API_ORIGIN must not contain credentials");let r=t.protocol==="http:"&&ZAg.has(t.hostname);if(t.protocol!=="https:"&&!r)throw new Error("FERN_SDK_GEN_API_ORIGIN must use HTTPS unless it targets localhost");return t.toString().replace(/\/$/,"")}function fv(e){return mCs(e)}function T7u(e,t="legacy-fern"){let r=fv(e.name);if(r!=null)return e.version===LJ&&t==="legacy-fern"?dGe({generatorId:e.name,language:e.language??r,configKind:t,versionSource:"fern-latest"}):fGe({generatorId:e.name,language:e.language??r,requestedVersion:e.version,configKind:t})}function fSt(e,t){let r=e.outputMode;switch(r.type){case"downloadFiles":return{requestedOutput:{type:"download"}};case"github":return d7u({owner:r.owner,repo:r.repo,branch:r.branch,mode:r.makePr===!0?"pull-request":"release",publishInfo:r.publishInfo,githubOptions:t});case"githubV2":{let n=r.githubV2;return d7u({owner:n.owner,repo:n.repo,host:n.host,branch:n.branch,mode:n.type==="pullRequest"?"pull-request":n.type==="push"?"push":"release",reviewers:n.type==="pullRequest"?nyg(n.reviewers):void 0,publishInfo:n.publishInfo,workflows:n.workflows,githubOptions:t})}case"publishV2":{let n=iyg(r.publishV2);return{...n.package!=null?{package:n.package}:{},requestedOutput:{type:"publish",publish:n.publish}}}case"publish":{let n=cyg(e,r.registryOverrides);return{...n.package!=null?{package:n.package}:{},requestedOutput:{type:"publish",publish:n.publish}}}}}function d7u({owner:e,repo:t,host:r,branch:n,mode:i,reviewers:o,publishInfo:s,workflows:a,githubOptions:c}){let l=s!=null?oyg(s):void 0;return{...l?.package!=null?{package:l.package}:{},requestedOutput:{type:"github",repository:`${e}/${t}`,...r!=null?{host:r}:{},...n!=null?{branch:n}:{},mode:i,...o!=null?{reviewers:o}:{},...l!=null?{publish:l.publish}:{},...a===!1?{workflows:!1}:{},...c}}}function ryg(e,t){return e.type==="github"&&t!=null?{...e,...t}:e}function nyg(e){if(e==null)return;let t=e.filter(n=>n.type==="team").map(n=>n.name),r=e.filter(n=>n.type==="user").map(n=>n.name);if(!(t.length===0&&r.length===0))return{...t.length>0?{teams:t}:{},...r.length>0?{users:r}:{}}}function iyg(e){switch(e.type){case"npmOverride":return ICs(e.npmOverride);case"mavenOverride":return vCs(e.mavenOverride);case"pypiOverride":return O7u(e.pypiOverride);case"rubyGemsOverride":return sSt("rubygems",e.rubyGemsOverride);case"nugetOverride":return sSt("nuget",e.nugetOverride);case"cratesOverride":return sSt("crates",e.cratesOverride);case"postman":throw new Error("sdk-gen-api does not support Postman collection publication as an SDK output")}}function oyg(e){switch(e.type){case"npm":return ICs(e);case"maven":return vCs(e);case"pypi":return O7u(e);case"rubygems":return sSt("rubygems",e);case"nuget":return sSt("nuget",e);case"crates":return sSt("crates",e);case"postman":throw new Error("sdk-gen-api does not support Postman collection publication as an SDK output")}}function ICs(e){return{...e?.packageName?{package:{packageName:e.packageName}}:{},publish:{registry:"npm",...e?.registryUrl?{url:e.registryUrl}:{}}}}function O7u(e){let t=e!=null&&"coordinate"in e?e.coordinate:e?.packageName;return{...t?{package:{packageName:t}}:{},publish:{registry:"pypi",...e?.registryUrl?{url:e.registryUrl}:{}}}}function vCs(e){let t=e?.coordinate!=null?ayg(e.coordinate):void 0;return{...t!=null?{package:t}:{},publish:{registry:"maven",...e?.registryUrl?{url:e.registryUrl}:{}}}}var syg=new Set(["OIDC","<USE_OIDC>"]);function sSt(e,t){let r=e==="nuget"||e==="rubygems",n=r&&t?.apiKey!=null&&syg.has(t.apiKey),i=r&&!n?vhi(t?.apiKey):void 0;return{...t?.packageName?{package:{packageName:t.packageName}}:{},publish:{registry:e,...t?.registryUrl?{url:t.registryUrl}:{},...i!=null?{apiKeyEnvironmentVariable:i}:{},...n?{trustedPublishing:!0}:{}}}}function ayg(e){let[t,r]=e.split(":");if(!t||!r)throw new Error(`Invalid Maven coordinate for sdk-gen-api: ${e}`);return{groupId:t,artifactId:r}}function cyg(e,t){let r=fv(e.name);if((r==="typescript"||r==="mcp")&&t.npm!=null)return ICs(t.npm);if((r==="java"||r==="kotlin")&&t.maven!=null)return vCs(t.maven);let n=P7u(r);if(n==null)throw new Error(`sdk-gen-api cannot infer a registry for ${r??e.name}`);return{publish:{registry:n}}}function P7u(e){switch(e){case"typescript":return"npm";case"python":return"pypi";case"java":case"kotlin":return"maven";case"go":return"go";case"csharp":return"nuget";case"php":return"composer";case"ruby":return"rubygems";case"rust":return"crates";case"mcp":return"npm";case"swift":case"cli":case void 0:return}}function B7u(e,t){let r=t.outputMode;if(r.type!=="publish"&&r.type!=="publishV2")return;let n=fSt(t).requestedOutput;if(n.type==="publish"&&n.publish.url!=null&&hVu(n.publish.url),r.type==="publish"){let o=fv(t.name);if((o==="typescript"||o==="mcp")&&r.registryOverrides.npm!=null)return m7u(e,r.registryOverrides.npm.token);if((o==="java"||o==="kotlin")&&r.registryOverrides.maven!=null)return h7u(e,r.registryOverrides.maven);let s=P7u(o);throw s==null||!uyg(s)?new Error(`sdk-gen-api does not support direct ${s??"unknown"} registry publication`):new Error(`Direct ${s} publication through sdk-gen-api requires publish credentials`)}let i=r.publishV2;switch(i.type){case"npmOverride":{let o=zgi("npm",i.npmOverride);return m7u(e,o.token)}case"mavenOverride":{let o=zgi("maven",i.mavenOverride);return h7u(e,o)}case"pypiOverride":{let o=zgi("pypi",i.pypiOverride);return lyg(e,o.username,o.password)}case"cratesOverride":{let o=zgi("crates",i.cratesOverride);return D7u(e,"crates",o.token)}case"rubyGemsOverride":throw new Error("sdk-gen-api does not support direct rubygems registry publication");case"nugetOverride":throw new Error("sdk-gen-api does not support direct nuget registry publication");case"postman":throw new Error("sdk-gen-api does not support Postman collection publication as an SDK output")}}function Ugi(e,t,r,n){return{targetId:e,...N0s(t,r,n)}}function zgi(e,t){if(t==null)throw new Error(`Direct ${e} publication through sdk-gen-api is missing its registry configuration`);return t}function m7u(e,t){return D7u(e,"npm",t)}function D7u(e,t,r){return Ugi(e,{registry:t,token:r})}function lyg(e,t,r){return Ugi(e,{registry:"pypi",username:t,password:r})}function h7u(e,t){return Ugi(e,{registry:"maven",username:t.username,password:t.password,...t.signature==null?{}:{signature:t.signature}})}function uyg(e){return e==="npm"||e==="maven"||e==="pypi"||e==="crates"}function pyg(e,t,r){let n=e.targets.flatMap((i,o)=>{if(i.requestedOutput.type!=="publish")return[];let s=t[o];if(s==null)throw new Error(`Cannot pair sdk-gen-api target ${i.targetId} with publish credentials`);let a=r?.[o],{publishUrl:c,publishRegistry:l}=k7u(i.requestedOutput),u=a!=null?Ugi(i.targetId,a,c,l):B7u(i.targetId,s);return u!=null?[u]:[]});if(n.length!==0){if(n.length>aSt)throw new Error(`sdk-gen-api supports at most ${aSt} direct publish credential targets`);if(e.credentialSetId==null)throw new Error("sdk-gen-api direct registry targets require a credentialSetId");return{schemaVersion:"fern-publish-credentials/v1",credentialSetId:e.credentialSetId,targets:n}}}function R7u(e){B7u("preflight",e)}function Vgi(e){Chi(e.map(t=>({publicationRequested:t.requestedOutput?.type==="publish"||t.requestedOutput?.type==="github"&&t.requestedOutput.publish!=null,credentialsRequired:t.requestedOutput?.type==="publish",...k7u(t.requestedOutput),...t.publishCredential==null?{}:{publishCredential:t.publishCredential}})))}function k7u(e){let t=e?.type==="publish"||e?.type==="github"?e.publish:void 0;return t==null?{}:{publishRegistry:t.registry,...t.url==null?{}:{publishUrl:t.url}}}function F7u(e){let{generatorInvocation:t,sdkVersion:r,specsTarGzBuffer:n,whitelabel:i}=e,o=fv(t.name),s=r==null||r.trim().length>0&&(!(0,zXt.isAutoVersion)(r)||N7u(e.requestedOutput));return o!=null&&s&&n!=null&&i==null}function N7u(e){return e?.type==="github"}function j7u({candidate:e,isSdkConfigTarget:t,isPreview:r}){let{generatorInvocation:n,sdkVersion:i,specsTarGzBuffer:o,whitelabel:s}=e;return s!=null?"whitelabel generation has not yet moved from Fiddle to the shared pipeline":i!=null&&(0,zXt.isAutoVersion)(i)&&!N7u(e.requestedOutput)?t?r?"preview generation only downloads files, so it cannot use --version AUTO":"automatic SDK versioning (--version AUTO) through sdk-gen-api requires GitHub output":"automatic SDK versioning (--version AUTO) through sdk-gen-api requires GitHub output in generators.yml":o==null?"the source archive is unavailable":`generator language ${n.language??"unknown"} does not match ${fv(n.name)}`}var Mgi=class{expectedTargets;participants=[];removedTargetIds=new Set;terminalError;dispatched=!1;constructor(t){if(t<1)throw new Error("A Fern sdk-gen-api batch must expect at least one target");this.expectedTargets=t}run(t){return this.terminalError!=null?Promise.reject(this.terminalError):t.targetIdSeed!=null&&this.removedTargetIds.has(t.targetIdSeed)?Promise.reject(new Error(`Fern sdk-gen-api target ${t.targetIdSeed} was removed`)):this.dispatched?Promise.reject(new Error("The Fern sdk-gen-api batch was already dispatched")):new Promise((r,n)=>{this.participants.push({...t,resolve:r,reject:n}),this.dispatchIfReady()})}skip(){this.dispatched||this.terminalError!=null||(this.expectedTargets-=1,this.dispatchIfReady())}remove(t,r){if(this.dispatched||this.terminalError!=null||this.removedTargetIds.has(t))return!1;this.removedTargetIds.add(t);let n=this.participants.findIndex(o=>o.targetIdSeed===t),[i]=n>=0?this.participants.splice(n,1):[];return i?.reject(r),this.expectedTargets-=1,this.dispatchIfReady(),!0}cancel(t){if(!(this.dispatched||this.terminalError!=null)){this.terminalError=t;for(let r of this.participants)r.reject(t)}}dispatchIfReady(){this.dispatched||this.terminalError!=null||this.expectedTargets===0||this.participants.length!==this.expectedTargets||(this.dispatched=!0,this.dispatch())}async dispatch(){let t=[...this.participants].sort(Cyg);try{(await L7u(t)).forEach((n,i)=>{let o=t[i];n.status==="fulfilled"?o?.resolve(n.value):o?.reject(n.reason)})}catch(r){this.terminalError=r;for(let n of this.participants)n.reject(r)}}},Lgi=class{expectedTargetIds;settledTargetIds=new Set;waiters=[];preflightParticipants=[];terminalError;didRunPreflight=!1;constructor(t){if(this.expectedTargetIds=new Set(t),this.expectedTargetIds.size!==t.length)throw new Error("Fern sdk-gen-api preparation target IDs must be unique")}ready(t,r){if(this.assertExpected(t),this.settledTargetIds.has(t))throw new Error(`Fern sdk-gen-api target ${t} prepared more than once`);return this.settledTargetIds.add(t),r!=null&&this.preflightParticipants.push(r),new Promise((n,i)=>{this.waiters.push({resolve:n,reject:i}),this.finishIfSettled()})}fail(t,r,n){return this.assertExpected(t),this.settledTargetIds.has(t)?!1:(this.settledTargetIds.add(t),n||(this.terminalError=r),this.finishIfSettled(),!0)}assertExpected(t){if(!this.expectedTargetIds.has(t))throw new Error(`Unexpected Fern sdk-gen-api preparation target ${t}`)}finishIfSettled(){if(this.settledTargetIds.size===this.expectedTargetIds.size){if(!this.didRunPreflight&&this.terminalError==null&&this.preflightParticipants.length>0){this.didRunPreflight=!0;try{M7u(this.preflightParticipants)}catch(t){this.terminalError=t}}for(let t of this.waiters)this.terminalError!=null?t.reject(this.terminalError):t.resolve()}}};async function z7u(e){let[t]=await L7u([e]);if(t?.status==="fulfilled")return t.value;throw t?.reason??new Error("sdk-gen-api did not return the requested target")}function Q7u(e){if(e>aSt)throw new Error(`sdk-gen-api supports at most ${aSt} target payloads per build; received ${e}`)}function M7u(e){let t=e[0];if(t==null)throw new Error("Cannot submit an empty Fern sdk-gen-api build");Iyg(e);let r;try{r=gFe()}catch(p){return t.context.failAndThrow(p instanceof Error?p.message:"Invalid sdk-gen-api origin",p,{code:w.Code.ConfigError})}if(!r)return t.context.failAndThrow("FERN_SDK_GEN_API_ORIGIN is required when sdk-gen-api generation is enabled",void 0,{code:w.Code.ConfigError});jyg(e),xyg(e,t);let n=zyg({apiName:t.apiName,organization:t.organization,cliVersion:t.cliVersion,specsTarGzBuffer:t.specsTarGzBuffer,targets:e.map(p=>({generatorInvocation:p.generatorInvocation,resolvedGeneratorVersion:p.resolvedGeneratorVersion,sdkGenApiRoute:p.sdkGenApiRoute,sdkName:p.sdkName,sdkVersion:p.sdkVersion,apiVersion:p.apiVersion,targetIdSeed:p.targetIdSeed,sourceSpecIndexes:p.sourceSpecIndexes,audiences:p.audiences,payload:p.payload,requestedOutput:p.requestedOutput,autoVersionPreviewOutput:p.autoVersionPreviewOutput,publishCredential:p.publishCredential,githubOptions:p.githubOptions}))}),i=pyg(n,e.map(p=>p.generatorInvocation),e.map(p=>p.publishCredential)),o=i!=null?Buffer.from(JSON.stringify(i)):void 0;if(o!=null&&o.length>65536)return t.context.failAndThrow(`sdk-gen-api publish credentials file is ${wyg(o.length)}, exceeding the 64 KiB limit`,void 0,{code:w.Code.ConfigError});let s=t.specsTarGzBuffer.length+e.reduce((p,d)=>p+d.payload.body.length,0)+(o?.length??0);if(s>C7u)return t.context.failAndThrow(`sdk-gen-api source archive, target payloads, and publish credentials total ${Z9(s)}, exceeding the 50 MiB in-memory upload limit`,void 0,{code:w.Code.ConfigError});let a=JSON.stringify(n),c=Buffer.byteLength(a,"utf8");if(c>YAg)return t.context.failAndThrow(`sdk-gen-api serialized request field is ${Z9(c)}, exceeding the 1 MiB UTF-8 field limit; reduce generator customConfig, readme, settings, or API override metadata`,void 0,{code:w.Code.ConfigError});let l=new E7u.default;l.append("request",a),l.append("sources",t.specsTarGzBuffer,{filename:"specs.tar.gz",contentType:"application/gzip"}),e.forEach((p,d)=>{let f=n.targets[d];if(f==null)throw new Error(`Cannot pair sdk-gen-api payload at index ${d} with a target`);let m=p.payload.payloadKind==="fern-runtime-bundle";l.append("payloads",p.payload.body,{filename:`${f.targetId}.json${m?".gz":""}`,contentType:m?"application/gzip":"application/json"})}),o!=null&&l.append("credentials",o,{filename:"publish-credentials.v1.json",contentType:"application/json"});let u=l.getLengthSync();return u>x7u?t.context.failAndThrow(`sdk-gen-api multipart request is ${Z9(u)}, exceeding the 60 MiB limit; reduce source or target payload size`,void 0,{code:w.Code.ConfigError}):{first:t,origin:r,request:n,form:l,sensitiveValues:pCs([t.token.value,...Ayg(i)])}}async function L7u(e){let{first:t,origin:r,request:n,form:i,sensitiveValues:o}=M7u(e);dyg({first:t,origin:r,request:n,participants:e,sensitiveValues:o});let s;try{s=(await Nd.post(`${r}/v1/fern/build`,i,{headers:{...i.getHeaders(),Authorization:`Bearer ${t.token.value}`,"X-Fern-Organization-Id":t.organization},maxBodyLength:x7u,timeout:u7u})).data.buildId}catch(l){myg(t.context,l,o);let u=A7u(l,o);return t.context.failAndThrow(`Failed to submit sdk-gen-api build: ${u.message}`,u,{code:w.Code.NetworkError})}for(let l of e)l.context.logger.debug(`sdk-gen-api build ID: ${s}`);fyg({participants:e,request:n,origin:r,buildId:s});let a=new Map,c=Date.now()+l7u;for(;;){let l=Date.now()>=c,u;try{let f=await Nd.get(`${r}/v1/fern/build/${s}`,{headers:{Authorization:`Bearer ${t.token.value}`,"X-Fern-Organization-Id":t.organization},timeout:u7u});u=yyg(f.data,o)}catch(f){let m=A7u(f,o);return t.context.failAndThrow("Failed to poll sdk-gen-api build",m,{code:w.Code.NetworkError})}let p=n.targets.find(f=>!u.targets.some(m=>m.targetId===f.targetId));if(p!=null)return t.context.failAndThrow(`sdk-gen-api response did not contain target ${p.targetId}`,void 0,{code:w.Code.InternalError});for(let[f,m]of n.targets.entries()){let g=u.targets.find(I=>I.targetId===m.targetId),A=e[f]?.context;if(g==null||A==null)continue;let y=a.get(g.targetId)??0;for(let I of g.logs.slice(y))hyg(A,I);a.set(g.targetId,g.logs.length)}if(n.targets.every(f=>Tyg(u,f.targetId))||u.status==="failed"||u.status==="succeeded"){let f=await Promise.allSettled(e.map((m,g)=>Pyg(m,n.targets[g]?.targetId,u,n.targets[g]?.requestedOutput)));return Oyg({participant:t,status:u,buildId:s}),f}if(l)return t.context.failAndThrow(`Timed out waiting for sdk-gen-api build ${s} after ${l7u/6e4} minutes`,void 0,{code:w.Code.InternalError});await Xp(qAg)}}function fyg({participants:e,request:t,origin:r,buildId:n}){for(let[i,o]of e.entries()){let s=t.targets[i];if(s!=null)try{o.context.instrumentPostHogEvent({orgId:o.organization,command:"sdk-gen-api build submitted",properties:{sdkGenApiBuildId:n,sdkGenApiTargetId:s.targetId,sdkGenApiTargetCount:t.targets.length,sdkGenApiHost:new URL(r).host,apiName:t.apiName,generatorName:s.fernGenerator.id,generatorVersion:s.fernGenerator.version??o.generatorInvocation.version,language:s.language,payloadKind:s.payloadKind,outputMode:s.requestedOutput.type,sdkName:s.sdk.name,sdkVersion:s.sdk.version}})}catch(a){o.context.logger.debug(`[telemetry] failed to send sdk-gen-api build event: ${String(a)}`)}}}function dyg({first:e,origin:t,request:r,participants:n,sensitiveValues:i}){let o=new Map(r.targets.map((s,a)=>{let c=n[a];return[s.targetId,{uploadBytes:c?.payload.body.length??0,targetIdSeed:c?.targetIdSeed,sourceSpecIndexes:c?.sourceSpecIndexes}]}));e.context.logger.debug(`Submitting sdk-gen-api build: ${_gi({origin:t,sourceArchiveBytes:e.specsTarGzBuffer.length,request:{protocolVersion:r.protocolVersion,apiName:r.apiName,cliVersion:r.cliVersion,idempotencyKey:g7u(r.idempotencyKey),credentialSetId:r.credentialSetId==null?void 0:g7u(r.credentialSetId),apiInputs:r.apiInputs,targets:r.targets.map(s=>({targetId:s.targetId,apiInputId:s.apiInputId,language:s.language,sdk:s.sdk,fernGenerator:s.fernGenerator,payloadKind:s.payloadKind,package:s.package,requestedOutput:s.requestedOutput,invocation:{customConfigKeys:Object.keys(s.invocation.customConfig).sort(),keywords:s.invocation.keywords,smartCasing:s.invocation.smartCasing,smartCasingDigitWordBoundary:s.invocation.smartCasingDigitWordBoundary,disableExamples:s.invocation.disableExamples,audiences:s.invocation.audiences,hasReadme:s.invocation.readme!=null,hasSettings:s.invocation.settings!=null,hasApiOverride:s.invocation.apiOverride!=null},payload:o.get(s.targetId)}))}},i)}`)}function myg(e,t,r){if(!(t instanceof FVt)){e.logger.debug(`sdk-gen-api submission failed before receiving an HTTP response: ${_gi(t instanceof Error?{name:t.name,message:t.message}:{error:String(t)},r)}`);return}e.logger.debug(`sdk-gen-api submission HTTP failure: ${_gi({status:t.response?.status??t.status,statusText:t.response?.statusText,code:t.code,responseBody:t.response?.data},r)}`)}function g7u(e){return e.length<=12?e:`${e.slice(0,12)}...`}function _gi(e,t){let r;try{r=typeof e=="string"?e:JSON.stringify(e)}catch(i){r=i instanceof Error?`Failed to serialize debug value: ${i.message}`:String(e)}let n=X9(r,t);return n.length>yCs?`${n.slice(0,yCs)}... [truncated ${n.length-yCs} bytes]`:n}function hyg(e,t){switch(t.level.toLowerCase()){case"error":e.logger.error(t.message);return;case"warn":case"warning":e.logger.warn(t.message);return;case"debug":case"trace":e.logger.debug(t.message);return;default:e.logger.info(t.message)}}function A7u(e,t){if(!(e instanceof FVt))return new Qgi(X9(e instanceof Error?e.message:"Unknown submission error",t),void 0,void 0);let r=gyg(e,t);return new Qgi(r??X9(e.message,t),e.response?.status??e.status,e.code)}function gyg(e,t){let r=e.response?.data;if(typeof r=="object"&&r!=null&&"message"in r&&typeof r.message=="string")return X9(r.message,t);if(r!=null)return`sdk-gen-api response body: ${_gi(r,t)}`}function Ayg(e){return(e?.targets??[]).flatMap(t=>t.registry==="npm"||t.registry==="crates"?[t.token]:t.registry==="pypi"?[t.username,t.password]:[t.username,t.password,...t.signature!=null?[t.signature.keyId,t.signature.password,t.signature.secretKey]:[]])}function yyg(e,t){return{...e,targets:e.targets.map(r=>({...r,logs:r.logs.map(n=>({...n,message:X9(n.message,t)})),...r.error==null?{}:{error:{...typeof r.error.code=="string"?{code:X9(r.error.code,t)}:{},message:X9(r.error.message,t)}},...r.publication==null?{}:r.publication.status==="success"?{publication:{...r.publication,publishTarget:{...r.publication.publishTarget,identifier:fCs(r.publication.publishTarget.identifier,t)}}}:{publication:{...r.publication,publishTarget:{...r.publication.publishTarget,identifier:fCs(r.publication.publishTarget.identifier,t)},error:byg(r.publication.error,t)}}}))}}function byg(e,t){let{reason:r,detail:n,...i}=e,o=typeof n=="string"?X9(n,t).trim():void 0,s=typeof r=="string"&&eyg.test(r)&&X9(r,t)===r?r:void 0;return{...i,message:X9(e.message,t),...s!=null?{reason:s}:{},...o!=null&&o.length>0?{detail:o}:{}}}function Eyg(e){let t=`sdk-gen-api publication failed (${e.code}): ${e.message}`;return e.detail==null||e.detail===e.message?t:e.reason!=null?`${t}: ${e.detail} [${e.reason}]`:`${t}: ${e.detail}`}function Iyg(e){for(let t of e){let{generatorInvocation:r}=t,n=r.language??fv(r.name);n==null&&t.context.failAndThrow(`Cannot submit SDK generation to sdk-gen-api: generator language is unknown for ${r.name}`,void 0,{code:w.Code.ConfigError});let i;try{i=vyg(t,n)}catch(o){if(!(o instanceof Ose))throw o;t.context.failAndThrow(_Xt(o),void 0,{code:w.Code.ConfigError})}i.payloadKind!==t.payload.payloadKind&&t.context.failAndThrow(`Cannot submit SDK generation to sdk-gen-api: selected route payload ${i.payloadKind} does not match participant payload ${t.payload.payloadKind}`,void 0,{code:w.Code.ConfigError})}}function vyg(e,t){let{generatorInvocation:r,sdkGenApiRoute:n}=e;if(n?.requestedVersion==null){if(n!=null){if(!jgi(n,r.version))throw U7u(n,r.version);return dGe({generatorId:r.name,language:t,configKind:n.configKind,versionSource:n.versionSource})}return fGe({generatorId:r.name,language:t,requestedVersion:r.version,configKind:e.payload.payloadKind==="fern-runtime-bundle"?"legacy-fern":"sdk-config-v1"})}return fGe({generatorId:r.name,language:t,requestedVersion:n.requestedVersion,configKind:n.configKind})}function _Xt(e){let t=[e.code,`generator=${e.generatorId}`,`language=${e.language}`,`requestedVersion=${e.requestedVersion}`,`cutoverVersion=${e.cutoverVersion??"n/a"}`,`receivedConfigKind=${String(e.receivedConfigKind)}`,`expectedConfigKind=${e.expectedConfigKind??"n/a"}`,`expectedLanguage=${e.expectedLanguage??"n/a"}`,`retryable=${e.retryable}`,`recommendedAction=${e.recommendedAction}`].join("; "),r=e.recommendedAction==="USE_SDK_CONFIG_V1"?" Run `fern sdk migrate`, then pass the generated document with `fern generate --sdk-config <path>` before using this generator version.":"";return`Cannot submit SDK generation to sdk-gen-api: ${e.message} [${t}].${r}`}function _7u(e,t,r){if(e==null)return t.version;if(e.requestedVersion!=null)return e.requestedVersion;if(!jgi(e,t.version))throw U7u(e,t.version);return r}function U7u(e,t){return new Error(`An unpinned sdk-gen-api route does not match its generator version representation: invocationVersion=${JSON.stringify(t)}; configKind=${e.configKind}; versionSource=${e.requestedVersion==null?e.versionSource:"pinned"}`)}function bCs(e,t,r){return _7u(e,t,r)??XAg}function Cyg(e,t){let r=$Ag.compare(e.targetIdSeed??"",t.targetIdSeed??"");if(r!==0)return r;let n=e.generatorInvocation.name.localeCompare(t.generatorInvocation.name);if(n!==0)return n;let i=bCs(e.sdkGenApiRoute,e.generatorInvocation).localeCompare(bCs(t.sdkGenApiRoute,t.generatorInvocation));return i!==0?i:(e.sdkVersion??"").localeCompare(t.sdkVersion??"")}function xyg(e,t){e.length>aSt&&t.context.failAndThrow(`sdk-gen-api supports at most ${aSt} target payloads per build; received ${e.length}`,void 0,{code:w.Code.ConfigError}),t.specsTarGzBuffer.length>WAg&&t.context.failAndThrow(`sdk-gen-api source archive is ${Z9(t.specsTarGzBuffer.length)}, exceeding the 25 MiB compressed limit`,void 0,{code:w.Code.ConfigError});let r=e.findIndex(s=>s.payload.body.length>(s.payload.payloadKind==="fern-runtime-bundle"?p7u:f7u));if(r>=0){let s=e[r],a=s?.payload.payloadKind==="fern-runtime-bundle"?p7u:f7u;t.context.failAndThrow(`sdk-gen-api ${y7u(s,r)} is ${Z9(s?.payload.body.length??0)}, exceeding the ${Z9(a)} upload limit`,void 0,{code:w.Code.ConfigError})}let n=e.reduce((s,a)=>s+a.payload.body.length,t.specsTarGzBuffer.length);n>C7u&&t.context.failAndThrow(`sdk-gen-api source archive and target payloads total ${Z9(n)}, exceeding the 50 MiB in-memory upload limit; reduce the source archive size, target payload size, or number of targets`,void 0,{code:w.Code.ConfigError});let i=e.reduce((s,a)=>a.payload.payloadKind==="fern-runtime-bundle"?s+a.payload.body.length:s,0);i>KAg&&t.context.failAndThrow(`sdk-gen-api runtime bundles total ${Z9(i)}, exceeding the 25 MiB compressed limit; reduce the number or size of targets`,void 0,{code:w.Code.ConfigError}),b7u({buffer:t.specsTarGzBuffer,maxBytes:HAg,label:"source archive",context:t.context});let o=0;for(let[s,a]of e.entries())o+=a.payload.payloadKind==="fern-runtime-bundle"?b7u({buffer:a.payload.body,maxBytes:JAg,label:y7u(a,s),context:t.context}):a.payload.body.length,o>v7u&&t.context.failAndThrow(`sdk-gen-api target payloads total ${Z9(o)}, exceeding the 100 MiB decoded limit; reduce the number or size of targets`,void 0,{code:w.Code.ConfigError})}function y7u(e,t){return`${e?.payload.payloadKind??"target payload"} ${e?.targetIdSeed??t.toString()}`}function b7u({buffer:e,maxBytes:t,label:r,context:n}){let i;try{i=(0,I7u.gunzipSync)(e,{maxOutputLength:t+1})}catch(o){return Syg(o)?n.failAndThrow(`sdk-gen-api ${r} exceeds the ${Z9(t)} decompressed limit`,void 0,{code:w.Code.ConfigError}):n.failAndThrow(`sdk-gen-api ${r} is malformed gzip; regenerate it and retry`,o,{code:w.Code.ConfigError})}return i.length>t?n.failAndThrow(`sdk-gen-api ${r} is ${Z9(i.length)} decompressed, exceeding the ${Z9(t)} decompressed limit`,void 0,{code:w.Code.ConfigError}):i.length}function Syg(e){return e instanceof Error&&"code"in e&&e.code==="ERR_BUFFER_TOO_LARGE"}function Z9(e){return`${(e/(1024*1024)).toFixed(2)} MiB`}function wyg(e){return`${(e/1024).toFixed(2)} KiB`}function Tyg(e,t){let r=e.targets.find(n=>n.targetId===t);return r?.status==="failed"||r?.status==="succeeded"}function Oyg({participant:e,status:t,buildId:r}){if(e.token.type!=="guest"||!t.targets.some(i=>i.status==="succeeded"&&i.result?.artifactUrl!=null))return;let n=AVu({claimUrl:e.token.claimUrl,buildId:r});e.context.logger.info(n!=null?`Build ${r} is kept for 7 days: ${n} (claiming the session moves it into your organization)`:`Build ${r} is kept for 7 days (claiming the session moves it into your organization)`)}async function Pyg(e,t,r,n){let i=r.targets.find(u=>u.targetId===t);if(i==null)return e.context.failAndThrow("sdk-gen-api response did not contain the requested target",void 0,{code:w.Code.InternalError});if(i.status==="failed")return i.publication?.status==="failure"?e.context.failAndThrow(Eyg(i.publication.error),void 0,{code:w.Code.ContainerError}):e.context.failAndThrow(Byg(i.error),void 0,{code:w.Code.ContainerError});if(i.status!=="succeeded")return e.context.failAndThrow(`sdk-gen-api build ended with status ${r.status} while target ${i.targetId} remained ${i.status}`,void 0,{code:w.Code.InternalError});let o=e.sdkVersion!=null&&(0,zXt.isAutoVersion)(e.sdkVersion),s=o&&i.publication?.status==="success"&&i.publication.output.noChangesDetected===!0&&i.result?.actualVersion==null,a=i.result?.artifactUrl;if(a==null&&!s)return e.context.failAndThrow("sdk-gen-api target completed without an artifact URL",void 0,{code:w.Code.InternalError});a==null?e.context.logger.info("No changes detected; there is no SDK preview to download."):e.absolutePathToPreview!=null?await Ngi({s3PreSignedReadUrl:a,absolutePathToLocalOutput:Re(e.absolutePathToPreview,be.of(bVu(e.generatorInvocation.name,Fyg(e.generatorInvocation)))),context:e.context,skipFernignore:e.skipFernignore}):e.absolutePathToLocalOutputArchive!=null?await n7u({s3PreSignedReadUrl:a,absolutePathToLocalOutput:e.absolutePathToLocalOutputArchive,context:e.context}):e.generatorInvocation.absolutePathToLocalOutput!=null&&await Ngi({s3PreSignedReadUrl:a,absolutePathToLocalOutput:e.generatorInvocation.absolutePathToLocalOutput,context:e.context,skipFernignore:e.skipFernignore});let c=i.result?.actualVersion??(o?void 0:e.sdkVersion),l=e.autoVersionPreviewOutput!=null?{pullRequestUrl:void 0,noChangesDetected:i.publication?.status==="success"&&i.publication.output.noChangesDetected===!0?!0:void 0}:Dyg(e,i,n);return o&&c!=null&&e.context.logger.info(`AUTO versioning picked new version: ${c}`),{createdSnippets:!1,snippetsS3PreSignedReadUrl:void 0,actualVersion:c,...l,publishTarget:c==null||e.autoVersionPreviewOutput!=null?void 0:Nyg(i,c)}}function Byg(e){let t=e?.message||"sdk-gen-api generation failed";return e?.code!=null&&e.code!==""?`${e.code}: ${t}`:t}function Dyg(e,t,r){if(r?.type!=="github")return{pullRequestUrl:void 0,noChangesDetected:void 0};let{publication:n}=t;if(n?.status!=="success"||n.publishTarget.type!=="github")return e.context.failAndThrow(`sdk-gen-api reported the build as succeeded but did not confirm the GitHub delivery to ${r.repository}`,void 0,{code:w.Code.InternalError});let i=Ryg(n.output.pullRequestUrl),o=n.output.noChangesDetected===!0,s={pullRequestUrl:o?void 0:i,noChangesDetected:o?!0:void 0},a=n.output.pullRequestUrl!=null&&i==null;return kyg(e.context.logger,r,s,a),s}function Ryg(e){let t=e==null?void 0:V7u(e);if(t==null)return;let{origin:r,pathname:n}=new URL(t);return`${r}${n}`}function kyg(e,{repository:t,mode:r},{pullRequestUrl:n,noChangesDetected:i},o){if(i){e.info(`No changes detected for ${t}; nothing was delivered to GitHub.`);return}if(n!=null){e.info(`Pull request: ${n}`);return}if(o){e.warn(`sdk-gen-api returned a pull request link for ${t} that was not a safe HTTPS URL.`);return}r==="pull-request"&&e.warn(`sdk-gen-api did not return a pull request link for ${t}.`)}function Fyg(e){return e.sdkConfigTargetIndex}function Nyg(e,t){if(e.publication?.status!=="success")return;let r=e.publication.publishTarget.type,n=e.publication.publishTarget.identifier,i=V7u(n);switch(r){case"npm":return{registry:r,label:"npm",version:t,identifier:n,...i!=null?{url:i}:{}};case"pypi":return{registry:r,label:"PyPI",version:t,identifier:n,...i!=null?{url:i}:{}};case"crates":return{registry:r,label:"crates.io",version:t,identifier:n,...i!=null?{url:i}:{}};case"maven":return{registry:r,label:"Maven Central",version:t,identifier:n,...i!=null?{url:i}:{}};case"github":case"unsupported":return}}function V7u(e){try{let t=new URL(e);return t.protocol==="https:"&&t.username.length===0&&t.password.length===0?e:void 0}catch{return}}function jyg(e){let t=e[0];if(t==null)return;let r=(0,Pse.createHash)("sha256").update(t.specsTarGzBuffer).digest("hex");for(let n of e.slice(1)){let i=(0,Pse.createHash)("sha256").update(n.specsTarGzBuffer).digest("hex");if(n.apiName!==t.apiName||n.organization!==t.organization||n.token.value!==t.token.value||i!==r)throw new Error("Fern sdk-gen-api batch targets must share API, organization, token, and sources")}}function zyg({apiName:e,organization:t,cliVersion:r,specsTarGzBuffer:n,targets:i}){if(i.length===0)throw new Error("Cannot create an empty Fern sdk-gen-api request");let o=[],s=i.map(({targetIdSeed:f,sourceSpecIndexes:m},g)=>{if(m==null)return o.some(y=>y.id==="default")||o.push({id:"default",specIndexes:"all"}),"default";let A=`target-${f??g.toString()}`;return o.push({id:A,specIndexes:m}),A}),a=i.map(({generatorInvocation:f,resolvedGeneratorVersion:m,sdkGenApiRoute:g,sdkName:A,sdkVersion:y,apiVersion:I,targetIdSeed:C,audiences:x,payload:S,requestedOutput:B,autoVersionPreviewOutput:D,githubOptions:R},O)=>{let z=fv(f.name);if(z==null)throw new Error(`Unsupported Fern SDK generator: ${f.name}`);let Y=fSt(f,R),$=ryg(B??Y.requestedOutput,R),ee=S.payloadKind==="fern-runtime-bundle"?Y.package:S.package,se=_7u(g,f,m),ue=bCs(g,f,m);return{targetId:(0,Pse.createHash)("sha256").update(`${e}:${f.name}:${ue}:${C??O.toString()}`).digest("hex").slice(0,20),apiInputId:s[O]??"default",language:z,sdk:{name:A??e,...y!=null?{version:y}:{},...I!=null?{apiVersion:I}:{}},fernGenerator:{id:f.name,...se!=null?{version:se}:{}},payloadKind:S.payloadKind,...ee!=null?{package:ee}:{},invocation:{customConfig:Dee(f.config)??{},keywords:f.keywords??[],smartCasing:f.smartCasing,smartCasingDigitWordBoundary:f.smartCasingDigitWordBoundary,disableExamples:f.disableExamples,...x!=null?{audiences:x}:{},...f.readme!=null?{readme:f.readme}:{},...f.settings!=null?{settings:f.settings}:{},...f.apiOverride!=null?{apiOverride:f.apiOverride}:{}},requestedOutput:$,...D!=null?{autoVersionPreview:{github:D}}:{}}}),c=i.map(f=>(0,Pse.createHash)("sha256").update(f.payload.body).digest("hex")),l=JSON.stringify({protocolVersion:2,organization:t,apiName:e,apiInputs:o,targets:a,payloadHashes:c,sourceHash:(0,Pse.createHash)("sha256").update(n).digest("hex")}),u=a.some(f=>f.requestedOutput.type==="publish")?Qyg(l):void 0,p=a.some(f=>f.sdk.version==null||(0,zXt.isAutoVersion)(f.sdk.version))?(0,Pse.randomUUID)():void 0,d=(0,Pse.createHash)("sha256").update(n).update(JSON.stringify({protocolVersion:2,organization:t,apiName:e,credentialSetId:u,apiInputs:o,targets:a,payloadHashes:c,...p!=null?{dynamicVersionRunId:p}:{}})).digest("hex");return{protocolVersion:2,apiName:e,...r?{cliVersion:r}:{},idempotencyKey:d,...u!=null?{credentialSetId:u}:{},apiInputs:o,targets:a}}function Qyg(e){let t=(0,Pse.createHash)("sha256").update(e).digest().subarray(0,16);t[6]=(t[6]??0)&15|128,t[8]=(t[8]??0)&63|128;let r=t.toString("hex");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}yc();Uo();It();jn();function hGe({apiName:e,organization:t,generatorInvocation:r}){let n=Myg(r);return{apiName:e,organization:t,customConfig:Dee(r.config),outputConfig:n??ar.GeneratorOutputConfig.local()}}function Myg(e){let t=e.outputMode;switch(t.type){case"downloadFiles":return ar.GeneratorOutputConfig.local();case"publishV2":return Lyg({publish:t.publishV2,version:e.version});case"githubV2":return _yg({github:t.githubV2,language:e.language,version:e.version});case"publish":case"github":return;default:rt(t)}}function Lyg({publish:e,version:t}){switch(e.type){case"npmOverride":{let r=e.npmOverride;return r==null?void 0:ar.GeneratorOutputConfig.publish(ar.PublishInfo.npm({version:t,packageName:r.packageName,repoUrl:void 0}))}case"mavenOverride":{let r=e.mavenOverride;return r==null?void 0:ar.GeneratorOutputConfig.publish(ar.PublishInfo.maven({version:t,coordinate:r.coordinate,repoUrl:void 0}))}case"pypiOverride":{let r=e.pypiOverride;return r==null?void 0:ar.GeneratorOutputConfig.publish(ar.PublishInfo.pypi({version:t,packageName:r.coordinate,repoUrl:void 0}))}case"rubyGemsOverride":{let r=e.rubyGemsOverride;return r==null?void 0:ar.GeneratorOutputConfig.publish(ar.PublishInfo.rubygems({version:t,packageName:r.packageName,repoUrl:void 0}))}case"nugetOverride":{let r=e.nugetOverride;return r==null?void 0:ar.GeneratorOutputConfig.publish(ar.PublishInfo.nuget({version:t,packageName:r.packageName,repoUrl:void 0}))}case"cratesOverride":{let r=e.cratesOverride;return r==null?void 0:ar.GeneratorOutputConfig.publish(ar.PublishInfo.crates({version:t,packageName:r.packageName,repoUrl:void 0}))}case"postman":return;default:rt(e)}}function _yg({github:e,version:t,language:r}){let n=Uyg({owner:e.owner,repo:e.repo});if(r===zr.GenerationLanguage.GO)return ar.GeneratorOutputConfig.publish(ar.PublishInfo.go({version:t,repoUrl:n}));if(r===zr.GenerationLanguage.SWIFT)return ar.GeneratorOutputConfig.publish(ar.PublishInfo.swift({version:t,repoUrl:n}));let i=e.publishInfo;if(i!=null)switch(i.type){case"maven":return ar.GeneratorOutputConfig.publish(ar.PublishInfo.maven({version:t,coordinate:i.coordinate,repoUrl:n}));case"npm":return ar.GeneratorOutputConfig.publish(ar.PublishInfo.npm({version:t,packageName:i.packageName,repoUrl:n}));case"pypi":return ar.GeneratorOutputConfig.publish(ar.PublishInfo.pypi({version:t,packageName:i.packageName,repoUrl:n}));case"rubygems":return ar.GeneratorOutputConfig.publish(ar.PublishInfo.rubygems({version:t,packageName:i.packageName,repoUrl:n}));case"nuget":return ar.GeneratorOutputConfig.publish(ar.PublishInfo.nuget({version:t,packageName:i.packageName,repoUrl:n}));case"crates":return ar.GeneratorOutputConfig.publish(ar.PublishInfo.crates({version:t,packageName:i.packageName,repoUrl:n}));case"postman":return;default:rt(i)}}function Uyg({owner:e,repo:t}){return`https://github.com/${e}/${t}`}Zn();$6();Dt();NU();var XA=Ae(A$u(),1),dL=Ae(Jg(),1),E$u=Ae(require("path"),1),hwg="0.0.1";function uZt(e){if(e.raw?.github!=null&&typeof e.raw.github=="object"&&"license"in e.raw.github){let t=e.raw.github;if(t.license!=null){if(typeof t.license=="string")return{type:"basic",value:t.license};if(typeof t.license=="object"&&"custom"in t.license)return{type:"custom",value:t.license.custom}}}if(e.raw?.metadata?.license!=null){let t=e.raw.metadata.license;if(typeof t=="string")return{type:"basic",value:t};if(typeof t=="object"&&"custom"in t)return{type:"custom",value:t.custom}}}function gwg(e,t){let r=uZt(e);if(r!=null){if(r.type==="basic"){if(r.value==="MIT"||r.value==="Apache-2.0")return XA.FernGeneratorExec.LicenseConfig.basic({id:r.value==="MIT"?XA.FernGeneratorExec.LicenseId.Mit:XA.FernGeneratorExec.LicenseId.Apache2})}else if(r.type==="custom")return XA.FernGeneratorExec.LicenseConfig.custom({filename:E$u.basename(r.value)})}}function uyi(e,t={}){let r=t.omitPublishCredentials??!1;return e!=null?Gr.GithubPublishInfo._visit(e,{npm:n=>{let i=(n.token??"").trim(),o=qxs(i),s=i!=="";return XA.FernGeneratorExec.GithubPublishInfo.npm({registryUrl:n.registryUrl,packageName:n.packageName,tokenEnvironmentVariable:(0,dL.EnvironmentVariable)(r?o!=null?"<USE_OIDC>":"":o!=null?"<USE_OIDC>":i.startsWith("${")&&i.endsWith("}")?i.slice(2,-1).trim():""),shouldGeneratePublishWorkflow:o!=null||s})},maven:n=>XA.FernGeneratorExec.GithubPublishInfo.maven({registryUrl:n.registryUrl,coordinate:n.coordinate,usernameEnvironmentVariable:(0,dL.EnvironmentVariable)(r?"":n.credentials?.username??""),passwordEnvironmentVariable:(0,dL.EnvironmentVariable)(r?"":n.credentials?.password??""),signature:n.signature!=null&&!r?{keyIdEnvironmentVariable:(0,dL.EnvironmentVariable)(n.signature.keyId??""),passwordEnvironmentVariable:(0,dL.EnvironmentVariable)(n.signature.password??""),secretKeyEnvironmentVariable:(0,dL.EnvironmentVariable)(n.signature.secretKey??"")}:void 0}),pypi:n=>{let i=(n.credentials?.password??"").trim(),o=qxs(i),s=n.credentials!=null;return XA.FernGeneratorExec.GithubPublishInfo.pypi({registryUrl:n.registryUrl,packageName:n.packageName,usernameEnvironmentVariable:(0,dL.EnvironmentVariable)(r?"":"PYPI_USERNAME"),passwordEnvironmentVariable:(0,dL.EnvironmentVariable)(r?o!=null?"OIDC":"":o!=null?"OIDC":"PYPI_PASSWORD"),shouldGeneratePublishWorkflow:o!=null||s,pypiMetadata:n.pypiMetadata})},rubygems:n=>XA.FernGeneratorExec.GithubPublishInfo.rubygems({registryUrl:n.registryUrl,packageName:n.packageName,apiKeyEnvironmentVariable:(0,dL.EnvironmentVariable)(r?"":n.apiKey??"")}),postman:n=>XA.FernGeneratorExec.GithubPublishInfo.postman({apiKeyEnvironmentVariable:(0,dL.EnvironmentVariable)(r?"":n.apiKey??""),workspaceIdEnvironmentVariable:(0,dL.EnvironmentVariable)(r?"":n.workspaceId??"")}),nuget:n=>{let i=(n.apiKey??"").trim(),o=qxs(i);return XA.FernGeneratorExec.GithubPublishInfo.nuget({registryUrl:n.registryUrl,packageName:n.packageName,apiKeyEnvironmentVariable:(0,dL.EnvironmentVariable)(r?o!=null?"<USE_OIDC>":"":o!=null?"<USE_OIDC>":i.startsWith("${")&&i.endsWith("}")?i.slice(2,-1).trim():""),shouldGeneratePublishWorkflow:o!=null?!0:void 0})},crates:n=>XA.FernGeneratorExec.GithubPublishInfo.crates({registryUrl:n.registryUrl,packageName:n.packageName,tokenEnvironmentVariable:(0,dL.EnvironmentVariable)(r?"":n.token??"")}),_other:()=>{}}):void 0}function qxs(e){if(e==="OIDC"||e==="<USE_OIDC>")return e}function MSt({generatorInvocation:e,customConfig:t,workspaceName:r,organization:n,outputVersion:i=hwg,absolutePathToSnippet:o,absolutePathToSnippetTemplates:s,absolutePathToFernConfig:a,writeUnitTests:c,generateOauthClients:l,generatePaginatedClients:u,whiteLabel:p,publishToRegistry:d,omitPublishCredentials:f,paths:m}){let g=gwg(e,a),{snippetPath:A,snippetTemplatePath:y,irPath:I,outputDirectory:C}=m,x=e.outputMode._visit({publish:B=>{if(d===!0){let D=ywg(B,f===!0);return{...b$u(i,D,m),snippetFilepath:A,publishingMetadata:e.publishMetadata}}return{...y$u(i,B,e,m),snippetFilepath:A,publishingMetadata:e.publishMetadata}},publishV2:B=>{if(d===!0){let D=bwg(B,f===!0);return{...b$u(i,D,m),snippetFilepath:A,publishingMetadata:e.publishMetadata}}return{...y$u(i,B,e,m),snippetFilepath:A,publishingMetadata:e.publishMetadata}},downloadFiles:()=>({mode:XA.FernGeneratorExec.OutputMode.downloadFiles(),path:C,snippetFilepath:A,publishingMetadata:e.publishMetadata}),github:B=>{let D={mode:XA.FernGeneratorExec.OutputMode.github({repoUrl:`https://github.com/${B.owner}/${B.repo}`,version:i,publishInfo:uyi(B.publishInfo,{omitPublishCredentials:f}),installationToken:void 0}),path:C,publishingMetadata:e.publishMetadata};return o!==void 0&&(D.snippetFilepath=A),s!==void 0&&(D.snippetTemplateFilepath=y),D},githubV2:B=>{let D=B._visit({commitAndRelease:O=>`https://github.com/${O.owner}/${O.repo}`,push:O=>`https://github.com/${O.owner}/${O.repo}`,pullRequest:O=>`https://github.com/${O.owner}/${O.repo}`,_other:()=>{throw new w({message:"Encountered unknown github mode",code:w.Code.InternalError})}}),R={mode:XA.FernGeneratorExec.OutputMode.github({repoUrl:D,version:i,publishInfo:uyi(B.publishInfo,{omitPublishCredentials:f})}),path:C,publishingMetadata:e.publishMetadata};return o!==void 0&&(R.snippetFilepath=A),s!==void 0&&(R.snippetTemplateFilepath=y),R},_other:()=>{throw new w({message:"Output type did not match any of the types supported by Fern",code:w.Code.InternalError})}}),S=Ewg(e,i);return{irFilepath:I,output:x,publish:S,customConfig:t,workspaceName:r,organization:n,environment:XA.FernGeneratorExec.GeneratorEnvironment.local(),dryRun:!1,whitelabel:p??!1,writeUnitTests:c,generateOauthClients:l,generatePaginatedClients:u,license:g}}function y$u(e,t,r,n){let{outputDirectory:i}=n,o;"registryOverrides"in t?o=t.registryOverrides.maven??t.registryOverrides.npm:o!=null&&(o=t._visit({mavenOverride:a=>a,npmOverride:a=>a,pypiOverride:a=>a,rubyGemsOverride:a=>a,postman:a=>a,nugetOverride:a=>a,cratesOverride:a=>a,_other:()=>{}}));let s="";return r.raw?.github!=null&&(QCe(r.raw.github)?s=Cx(r.raw.github.uri).repoUrl:s=r.raw?.github.repository),{mode:XA.FernGeneratorExec.OutputMode.github({repoUrl:s,version:e}),path:i}}function b$u(e,t,r){let{outputDirectory:n}=r,{registries:i,registriesV2:o}=Awg(t);return{mode:XA.FernGeneratorExec.OutputMode.publish({registries:i,registriesV2:o,publishTarget:t,version:e}),path:n}}function Awg(e){let t=structuredClone(I$u),r=structuredClone(v$u);if(e==null)return{registries:t,registriesV2:r};switch(e.type){case"npm":t.npm={registryUrl:e.registryUrl,token:e.token,scope:""},r.npm={registryUrl:e.registryUrl,token:e.token,packageName:e.packageName};break;case"maven":t.maven={registryUrl:e.registryUrl,username:e.username,password:e.password,group:"",signature:e.signature},r.maven={registryUrl:e.registryUrl,username:e.username,password:e.password,coordinate:e.coordinate,signature:e.signature};break;case"pypi":r.pypi={registryUrl:e.registryUrl,username:e.username,password:e.password,packageName:e.packageName,pypiMetadata:e.pypiMetadata};break;case"rubygems":r.rubygems={registryUrl:e.registryUrl,apiKey:e.apiKey,packageName:e.packageName};break;case"nuget":r.nuget={registryUrl:e.registryUrl,apiKey:e.apiKey,packageName:e.packageName};break;case"crates":r.crates={registryUrl:e.registryUrl,token:e.token,packageName:e.packageName};break;default:break}return{registries:t,registriesV2:r}}function ywg(e,t){if("registryOverrides"in e){let r=e.registryOverrides;if(r.npm!=null)return XA.FernGeneratorExec.GeneratorPublishTarget.npm({registryUrl:r.npm.registryUrl,token:t?"":r.npm.token,packageName:r.npm.packageName});if(r.maven!=null)return XA.FernGeneratorExec.GeneratorPublishTarget.maven({registryUrl:r.maven.registryUrl,username:t?"":r.maven.username??"",password:t?"":r.maven.password??"",coordinate:r.maven.coordinate??"",signature:void 0})}}function bwg(e,t){return e._visit({npmOverride:r=>r!=null?XA.FernGeneratorExec.GeneratorPublishTarget.npm({registryUrl:r.registryUrl,token:t?"":r.token,packageName:r.packageName}):void 0,mavenOverride:r=>r!=null?XA.FernGeneratorExec.GeneratorPublishTarget.maven({registryUrl:r.registryUrl,username:t?"":r.username,password:t?"":r.password,coordinate:r.coordinate,signature:t?void 0:r.signature??void 0}):void 0,pypiOverride:r=>r!=null?XA.FernGeneratorExec.GeneratorPublishTarget.pypi({registryUrl:r.registryUrl,username:t?"":r.username,password:t?"":r.password,packageName:r.coordinate,pypiMetadata:r.pypiMetadata??void 0}):void 0,rubyGemsOverride:r=>r!=null?XA.FernGeneratorExec.GeneratorPublishTarget.rubygems({registryUrl:r.registryUrl,apiKey:t?"":r.apiKey,packageName:r.packageName}):void 0,nugetOverride:r=>r!=null?XA.FernGeneratorExec.GeneratorPublishTarget.nuget({registryUrl:r.registryUrl,apiKey:t?"":r.apiKey,packageName:r.packageName}):void 0,cratesOverride:r=>r!=null?XA.FernGeneratorExec.GeneratorPublishTarget.crates({registryUrl:r.registryUrl,token:t?"":r.token,packageName:r.packageName}):void 0,postman:r=>XA.FernGeneratorExec.GeneratorPublishTarget.postman({apiKey:t?"":r.apiKey,workspaceId:t?"":r.workspaceId}),_other:()=>{}})}function Ewg(e,t){let r=e.outputMode._visit({publish:()=>{},publishV2:()=>{},downloadFiles:()=>{},github:o=>o.publishInfo,githubV2:o=>o._visit({push:s=>s.publishInfo,commitAndRelease:s=>s.publishInfo,pullRequest:s=>s.publishInfo,_other:()=>{}}),_other:()=>{}});if(r==null||r.type!=="pypi")return;let n=(r.credentials?.password??"").trim();if(n!=="OIDC"&&n!=="<USE_OIDC>")return;let i=structuredClone(v$u);return i.pypi={registryUrl:r.registryUrl,username:"__token__",password:"OIDC",packageName:r.packageName,pypiMetadata:r.pypiMetadata},{registries:structuredClone(I$u),registriesV2:i,publishTarget:void 0,version:t}}var I$u={maven:{registryUrl:"",username:"",password:"",group:"",signature:void 0},npm:{registryUrl:"",token:"",scope:""}},v$u={maven:{registryUrl:"",username:"",password:"",coordinate:"",signature:void 0},npm:{registryUrl:"",token:"",packageName:""},pypi:{registryUrl:"",username:"",password:"",packageName:"",pypiMetadata:void 0},rubygems:{registryUrl:"",apiKey:"",packageName:""},nuget:{registryUrl:"",apiKey:"",packageName:""},crates:{registryUrl:"",token:"",packageName:""}};It();var cep=Ae(aep(),1);Io();var lep=require("util"),aTg=(0,lep.promisify)(cep.default);async function dZt(e,t,r){let n=kDt(e,t),i=[];for(let o of n){let s=await Promise.all(o.map(async a=>{try{let c=await aTg(a);return c==null||c.height==null||c.width==null?void 0:{filePath:a,width:c.width,height:c.height,blurDataUrl:void 0}}catch(c){r.logger.error(`Failed to measure image size for ${a}. ${c?.message}`);return}}));i.push(...s.filter(ea))}return new Map(i.map(o=>[o.filePath,o]))}It();function mZt(e,t){if(Uh(e))return e;switch(t){case"github":return`https://github.com/${e}`;case"gitlab":return`https://gitlab.com/${e}`;case"bitbucket":return`https://bitbucket.org/${e}`;default:rt(t)}}function hZt(e){return e.language==="mcp"&&e.output?.delivery==="hosted"?{...e,output:{delivery:"zip"}}:e}function fSs(e){let t=e.sdkConfigPath==null?"":`; SDK Config: ${e.sdkConfigPath.join(".")}`;return`[${e.severity}] [${e.code}] ${e.path.join(".")}: ${e.reason}${t}; ${e.suggestedAction}`}function uep({workspace:e,generatorInvocation:t,audiences:r,replay:n,sourceArchive:i,mapFernGroupToSdkConfig:o}){let s=o({fernWorkspace:e,replay:n,group:{groupName:"sdk-gen-api",audiences:r,generators:[t],reviewers:void 0},source:cTg(i)}),a={...s.sdkConfig,targets:s.sdkConfig.targets.map(hZt)};return{payloadKind:"sdk-config-v1",body:Buffer.from(JSON.stringify(a),"utf8"),diagnostics:s.diagnostics}}function cTg(e){return{specs:e.specIndexes.map((r,n)=>{let i=e.manifest.specs[r];if(i==null)throw new Error(`Fern source manifest does not contain selected index ${r}`);if(!lTg(i))throw new Error(`SDK Config generation does not support Fern source type ${i.type} (${i.specPath})`);return{id:`source-${n}`,type:i.type,path:i.specPath.replace(/^\/+/,""),...i.namespace==null?{}:{namespace:i.namespace},...i.apiImportSettings==null?{}:{apiImportSettings:i.apiImportSettings},...i.overridePaths==null||i.overridePaths.length===0?{}:{overrides:i.overridePaths}}})}}function lTg(e){return e.type==="openapi"||e.type==="asyncapi"||e.type==="graphql"}yc();Uo();ef();It();lI();Mm();Ode();It();dy();cn();Io();function Jge({context:e,violations:t,logWarnings:r,logSummary:n=!0,logBreadcrumbs:i=!0,elapsedMillis:o=0}){let s=[],a={};for(let u of t){let p=JSON.stringify(u.nodePath),d=a[p]??[];d.some(m=>m.message===u.message&&m.nodePath.length===u.nodePath.length&&m.nodePath.every((g,A)=>ZL(g,u.nodePath[A]))&&m.relativeFilepath===u.relativeFilepath&&m.severity===u.severity)||(s.push(u),a[p]=[...d,u])}t=s;let c=gTg(t),l=uTg(t);for(let u of Array.from(l.keys()).sort()){let p=l.get(u);if(p){let d=p.violations[0]?.relativeFilepath??"";pTg({logWarnings:r,logBreadcrumbs:i,configRelativeFilepath:d,nodePath:p.nodePath,violations:p.violations,context:e})}}return n&&hTg({context:e,stats:c,logWarnings:r,elapsedMillis:o}),{hasErrors:c.numFatal>0}}function uTg(e){let t={};for(let r of e){let i=r.nodePath.length===0?`file:${r.relativeFilepath}`:`node:${JSON.stringify(r.nodePath)}`;t[i]||(t[i]={nodePath:r.nodePath,violations:[]}),t[i].violations.push(r)}return new Map(Object.entries(t))}function pTg({logWarnings:e,logBreadcrumbs:t,configRelativeFilepath:r,nodePath:n,violations:i,context:o}){let s=fTg(i);if(s==="warning"&&!e)return;let a="",c=i.map(l=>l.severity==="warning"&&!e?null:(a===""&&(a=l.relativeFilepath),`${mTg(l.severity)} ${l.message}`)).filter(l=>l!=null).join(`
|
|
4104
|
+
`):void 0);for(let i of t.logs.slice(this.lengthOfLastLogs))this.context.logger.log(RAg(i.level),i.message),this.#n==null&&(this.#n=TAg(i.message)??this.#n),this.cachedReplayResult==null&&(this.cachedReplayResult=OAg(i.message));this.lengthOfLastLogs=t.logs.length;let n=i=>{this.context.logger.debug(`Generated files. ${Mge("View here",i,{fallback:(o,s)=>`${o}: ${s}`})}`)};return await t.status._visit({notStarted:Ot,running:Ot,failed:({message:i,s3PreSignedReadUrl:o})=>{o!=null&&n(o),this.context.failAndThrow(i,void 0,{code:w.Code.ContainerError})},finished:async i=>{if(i.s3PreSignedReadUrlV2!=null){n(i.s3PreSignedReadUrlV2);let o=this.getAbsolutePathToLocalOutput();o!=null&&await Ngi({s3PreSignedReadUrl:i.s3PreSignedReadUrlV2,absolutePathToLocalOutput:o,context:this.context})}if(this.absolutePathToPreview==null)for(let o of r)this.context.logger.info(`Published ${o}`);this.#e=!0,this.#t=i.createdSnippets!=null?i.createdSnippets:!1,this.#r=i.snippetsS3PreSignedReadUrl,this.#o=i.pullRequestUrl,this.#s=i.noChangesDetected,i.actualVersion!=null&&(this.#n=i.actualVersion),this.emitReplayTelemetryIfReady()},_other:()=>{this.context.logger.warn("Received unknown update type: "+t.status.type)}}),this.#e?{createdSnippets:this.#t,snippetsS3PreSignedReadUrl:this.#r,actualVersion:this.#n,pullRequestUrl:this.#o,noChangesDetected:this.#s,publishTarget:this.#i}:void 0}getAbsolutePathToLocalOutput(){return this.absolutePathToPreview!=null?Re(this.absolutePathToPreview,be.of(mFe.default.basename(this.generatorInvocation.name))):this.generatorInvocation.absolutePathToLocalOutput}emitReplayTelemetryIfReady(){if(!this.replayEventEmitted&&this.cachedReplayResult!=null&&!this.telemetryContext.disableTelemetry)try{let t={success:!0,steps:{replay:this.cachedReplayResult},warnings:[]},n={...(0,t7u.buildReplayTelemetryProps)({pipelineResult:t,generatorName:this.generatorInvocation.name,generatorVersion:this.generatorInvocation.version,cliVersion:this.telemetryContext.cliVersion,repoUri:PAg(this.generatorInvocation),automationMode:this.telemetryContext.automationMode,autoMerge:this.telemetryContext.autoMerge,skipIfNoDiff:this.telemetryContext.skipIfNoDiff,hasBreakingChanges:!1,versionArg:this.telemetryContext.versionArg,versionBump:this.telemetryContext.versionBump,replayConfigEnabled:this.telemetryContext.replayConfigEnabled,noReplayFlag:this.telemetryContext.noReplayFlag,githubMode:BAg(this.generatorInvocation),previewMode:this.absolutePathToPreview!=null,durationMs:Date.now()-this.taskStartedAtMs}),surface:"fiddle",org_id:this.telemetryContext.orgId};this.context.instrumentPostHogEvent({command:"replay",properties:n}),this.context.logger.debug(`[telemetry] replay event sent: ${JSON.stringify(n)}`),this.replayEventEmitted=!0}catch(t){this.context.logger.debug(`[telemetry] failed to send replay event: ${String(t)}`)}}#e=!1;get isFinished(){return this.#e}#t=!1;get createdSnippets(){return this.#t}#r=void 0;get snippetsS3PreSignedReadUrl(){return this.#r}#n=void 0;get actualVersion(){return this.#n}#i=void 0;get publishTarget(){return this.#i}#o=void 0;get pullRequestUrl(){return this.#o}#s=void 0;get noChangesDetected(){return this.#s}},wAg=/Tagging release (v?\d+\.\d+\.\d+(?:-[\w.-]+)?)/;function TAg(e){let t=e.match(wAg);if(t?.[1]!=null)return t[1].replace(/^v/,"")}function OAg(e){let t=e.match(SAg);if(t?.[1]!=null)try{return JSON.parse(t[1])?.steps?.replay}catch{return}}function PAg(e){let t=e.raw?.github;return t==null?"":"uri"in t&&typeof t.uri=="string"?t.uri:"repository"in t&&typeof t.repository=="string"?t.repository:""}function BAg(e){let t=e.raw?.github;if(t!=null&&"mode"in t){if(t.mode==="pull-request")return"pull-request";if(t.mode==="commit-and-release")return"commit-and-release"}return"push"}async function Ngi({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r,skipFernignore:n=!1}){try{let i=await kAg(t),o=await FAg(t);!n&&i&&o?await NAg({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r}):!n&&i&&!o?await jAg({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r}):await DAg({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}),r.logger.info(le.green(`Downloaded to ${t}`))}catch(i){r.failAndThrow("Failed to download files",i,{code:w.Code.NetworkError})}}async function n7u({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r}){try{let n=await Nd.get(e,{responseType:"stream",timeout:6e4,signal:AbortSignal.timeout(uCs)});await(0,QN.mkdir)(mFe.default.dirname(t),{recursive:!0}),await(0,kgi.pipeline)(n.data,(0,FXt.createWriteStream)(t)),r.logger.info(le.green(`Downloaded to ${t}`))}catch(n){r.failAndThrow("Failed to download archive",n,{code:w.Code.NetworkError})}}var uCs=300*1e3;async function DAg({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}){let r=await Nd.get(e,{responseType:"stream",timeout:6e4,signal:AbortSignal.timeout(uCs)}),n=await Fgi.default.dir({prefix:"fern",unsafeCleanup:!0}),i=mFe.default.join(n.path,"output.zip");await(0,kgi.pipeline)(r.data,(0,FXt.createWriteStream)(i)),await lCs(t),await(0,QN.mkdir)(t,{recursive:!0}),await s7u(i,t)}async function lCs(e){await Ut(e)&&(await i7u(e),await(0,QN.rm)(e,{recursive:!0,force:!0}))}async function i7u(e){try{let t=await(0,QN.readdir)(e,{withFileTypes:!0});for(let r of t){let n=Zt.of(mFe.default.join(e,r.name));r.isDirectory()&&await i7u(n);try{await(0,QN.chmod)(n,493)}catch{}}await(0,QN.chmod)(e,493)}catch{}}function RAg(e){switch(e){case"DEBUG":return Vn.Debug;case"INFO":return Vn.Info;case"WARN":return Vn.Warn;case"ERROR":return Vn.Error;default:return Vn.Info}}async function kAg(e){let t=Re(e,be.of(F1));return await Ut(t)}async function FAg(e){let t=Re(e,be.of(".git"));return await Ut(t)}async function MJ(e,t,r){return(await za(r.logger,"git",e,{cwd:t,doNotPipeOutput:!0})).stdout}async function NAg({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r}){let n=Re(t,be.of(F1)),i=await Tee({absolutePathToFernignore:n});await MJ(["rm","-rf","."],t,r),await o7u({s3PreSignedReadUrl:e,outputPath:t}),await MJ(["add","."],t,r),await MJ(["reset","--",...i],t,r),await MJ(["restore","."],t,r)}async function jAg({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t,context:r}){let n=Zt.of((await Fgi.default.dir({})).path),i=Re(t,be.of(F1)),o=await Tee({absolutePathToFernignore:i});await(0,QN.cp)(t,n,{recursive:!0}),await MJ(["init"],n,r),await MJ(["add","."],n,r),await MJ(["-c","user.name=fern","-c","user.email=hey@buildwithfern.com","-c","commit.gpgsign=false","commit","--allow-empty","--no-verify","-m","init"],n,r),await MJ(["rm","-rf","."],n,r),await o7u({s3PreSignedReadUrl:e,outputPath:n}),await MJ(["add","."],n,r),await MJ(["reset","--",...o],n,r),await MJ(["restore","."],n,r),await lCs(Re(n,be.of(".git"))),await lCs(t),await(0,QN.cp)(n,t,{recursive:!0})}async function o7u({s3PreSignedReadUrl:e,outputPath:t}){let r=await Nd.get(e,{responseType:"stream",timeout:6e4,signal:AbortSignal.timeout(uCs)}),n=await Fgi.default.dir({prefix:"fern",unsafeCleanup:!0}),i=mFe.default.join(n.path,"output.zip");await(0,kgi.pipeline)(r.data,(0,FXt.createWriteStream)(i)),await s7u(i,t)}async function s7u(e,t){return new Promise((r,n)=>{r7u.default.open(e,{lazyEntries:!0},(i,o)=>{if(i||!o){n(i??new Error("Failed to open zip file"));return}o.on("error",n),o.on("end",r),o.on("entry",s=>{let a=mFe.default.join(t,s.fileName);if(s.fileName.endsWith("/")){(0,QN.mkdir)(a,{recursive:!0}).then(()=>o.readEntry()).catch(n);return}(0,QN.mkdir)(mFe.default.dirname(a),{recursive:!0}).then(()=>{o.openReadStream(s,(c,l)=>{if(c||!l){n(c??new Error("Failed to open read stream"));return}l.pipe((0,FXt.createWriteStream)(a)).on("finish",()=>o.readEntry()).on("error",n)})}).catch(n)}),o.readEntry()})})}function pCs(e){return[...new Set(e.filter(t=>t.length>0))].sort((t,r)=>r.length-t.length)}function X9(e,t){return pCs(t).reduce((r,n)=>r.replaceAll(n,"[REDACTED]"),e)}function fCs(e,t){return X9(e,t)}var zAg=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*))*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;function oSt(e){let t=zAg.exec(e);return t===null||t[1]===void 0||t[2]===void 0||t[3]===void 0?null:{core:[t[1],t[2],t[3]],prerelease:t[4]?.split(".")??null}}function a7u(e,t){for(let r=0;r<e.core.length;r+=1){let n=c7u(e.core[r]??"",t.core[r]??"");if(n!==0)return n}return QAg(e.prerelease,t.prerelease)}function QAg(e,t){if(e===null||t===null)return e===t?0:e===null?1:-1;let r=Math.max(e.length,t.length);for(let n=0;n<r;n+=1){let i=e[n],o=t[n];if(i===void 0||o===void 0)return i===o?0:i===void 0?-1:1;let s=MAg(i,o);if(s!==0)return s}return 0}function MAg(e,t){let r=/^\d+$/.test(e),n=/^\d+$/.test(t);return r&&n?c7u(e,t):r!==n?r?-1:1:e===t?0:e<t?-1:1}function c7u(e,t){return e.length!==t.length?e.length<t.length?-1:1:e===t?0:e<t?-1:1}var dCs=class extends Error{name="GeneratorConfigPolicyInvariantError";code="INVALID_GENERATOR_CUTOVER_POLICY";generatorId;language;cutoverVersion;retryable=!1;recommendedAction="FIX_GENERATOR_CUTOVER_POLICY";constructor(t,r){super(`Generator ${t} has an invalid cutover version: ${r.cutoverVersion}`),this.generatorId=t,this.language=r.language,this.cutoverVersion=r.cutoverVersion}};function LAg(e){return new Map(e.map(([t,r])=>{let n=oSt(r.cutoverVersion);if(n===null)throw new dCs(t,r);return[t,{...r,parsedCutoverVersion:n}]}))}var _Ag=LAg([["fernapi/fern-typescript",{language:"typescript",cutoverVersion:"4.0.0"}],["fernapi/fern-typescript-sdk",{language:"typescript",cutoverVersion:"4.0.0"}],["fernapi/fern-typescript-node-sdk",{language:"typescript",cutoverVersion:"4.0.0"}],["fernapi/fern-typescript-browser-sdk",{language:"typescript",cutoverVersion:"4.0.0"}],["fernapi/fern-python-sdk",{language:"python",cutoverVersion:"6.0.0"}],["fernapi/fern-java-sdk",{language:"java",cutoverVersion:"5.0.0"}],["fernapi/fern-kotlin-sdk",{language:"kotlin",cutoverVersion:"5.0.0"}],["fernapi/fern-go-sdk",{language:"go",cutoverVersion:"2.0.0"}],["fernapi/fern-csharp-sdk",{language:"csharp",cutoverVersion:"3.0.0"}],["fernapi/fern-php-sdk",{language:"php",cutoverVersion:"3.0.0"}],["fernapi/fern-ruby-sdk",{language:"ruby",cutoverVersion:"2.0.0"}],["fernapi/fern-ruby-sdk-v2",{language:"ruby",cutoverVersion:"2.0.0"}],["fernapi/fern-rust-sdk",{language:"rust",cutoverVersion:"1.0.0"}],["fernapi/fern-swift-sdk",{language:"swift",cutoverVersion:"1.0.0"}],["fernapi/fern-cli",{language:"cli",cutoverVersion:"1.0.0"}],["fernapi/fern-cli-generator",{language:"cli",cutoverVersion:"1.0.0"}],["fernapi/fern-mcp-server",{language:"mcp",cutoverVersion:"0.1.0"}]]);function NXt(e){return _Ag.get(e)}var Ose=class extends Error{name="GeneratorConfigCompatibilityError";code;generatorId;language;requestedVersion;cutoverVersion;receivedConfigKind;expectedConfigKind;expectedLanguage;retryable=!1;recommendedAction;constructor(t){super(t.message),this.code=t.code,this.generatorId=t.generatorId,this.language=t.language,this.requestedVersion=t.requestedVersion,this.cutoverVersion=t.cutoverVersion,this.receivedConfigKind=t.receivedConfigKind,this.expectedConfigKind=t.expectedConfigKind,this.expectedLanguage=t.expectedLanguage,this.recommendedAction=t.recommendedAction}};function mCs(e){return NXt(e)?.language}function fGe(e){let t=Lge(e),r=e.configKind;if(!VAg(r))throw pGe(e,{code:"INVALID_CONFIG_KIND",message:"Configuration kind must be legacy-fern or sdk-config-v1",cutoverVersion:t.cutoverVersion,expectedLanguage:t.language,expectedConfigKind:t.configKind,recommendedAction:"USE_SUPPORTED_CONFIG_KIND"},r);if(r!==t.configKind){let n=NXt(e.generatorId);throw n===void 0?new Error(`Missing validated generator policy for ${e.generatorId}`):UAg(e,n,t.configKind,r)}return t}function Lge(e){let t=NXt(e.generatorId);if(t===void 0)throw pGe(e,{code:"UNKNOWN_GENERATOR",message:`Unknown first-party generator: ${e.generatorId}`,cutoverVersion:null,expectedLanguage:null,expectedConfigKind:null,recommendedAction:"USE_KNOWN_GENERATOR_ID"});if(t.language!==e.language)throw pGe(e,{code:"GENERATOR_LANGUAGE_MISMATCH",message:`Generator ${e.generatorId} targets ${t.language}, not ${e.language}`,cutoverVersion:t.cutoverVersion,expectedLanguage:t.language,expectedConfigKind:null,recommendedAction:"USE_GENERATOR_LANGUAGE"});let r=oSt(e.requestedVersion);if(r===null)throw pGe(e,{code:"INVALID_GENERATOR_VERSION",message:`Generator version must be an exact semantic version: ${e.requestedVersion}`,cutoverVersion:t.cutoverVersion,expectedLanguage:t.language,expectedConfigKind:null,recommendedAction:"USE_EXACT_GENERATOR_VERSION"});let n=a7u(r,t.parsedCutoverVersion)<0,i=n?"legacy-fern":"sdk-config-v1";return{generatorId:e.generatorId,language:t.language,requestedVersion:e.requestedVersion,cutoverVersion:t.cutoverVersion,configKind:i,payloadKind:n?"fern-runtime-bundle":"sdk-config-v1"}}function dGe({generatorId:e,language:t,configKind:r,versionSource:n}){let i=NXt(e);if(i===void 0)throw pGe({generatorId:e,language:t,requestedVersion:"unpinned"},{code:"UNKNOWN_GENERATOR",message:`Unknown first-party generator: ${e}`,cutoverVersion:null,expectedLanguage:null,expectedConfigKind:null,recommendedAction:"USE_KNOWN_GENERATOR_ID"});if(i.language!==t)throw pGe({generatorId:e,language:t,requestedVersion:"unpinned"},{code:"GENERATOR_LANGUAGE_MISMATCH",message:`Generator ${e} targets ${i.language}, not ${t}`,cutoverVersion:i.cutoverVersion,expectedLanguage:i.language,expectedConfigKind:null,recommendedAction:"USE_GENERATOR_LANGUAGE"});let o={generatorId:e,language:t,cutoverVersion:i.cutoverVersion};if(r==="legacy-fern"){if(n!=="fern-latest")throw new Error("Legacy Fern unpinned routes must use fern-latest as their version source");return{...o,versionSource:n,configKind:r,payloadKind:"fern-runtime-bundle"}}return{...o,versionSource:n,configKind:r,payloadKind:"sdk-config-v1"}}function hCs(e){return dGe({...e,configKind:"sdk-config-v1",versionSource:"sdk-config-omitted"})}function pGe(e,t,r=e.configKind){return new Ose({generatorId:e.generatorId,language:e.language,requestedVersion:e.requestedVersion,receivedConfigKind:r,...t})}function UAg(e,t,r,n){let i=r==="legacy-fern";return pGe(e,{code:i?"LEGACY_FERN_CONFIG_REQUIRED":"SDK_CONFIG_V1_REQUIRED",message:i?`Generator ${e.generatorId} ${e.requestedVersion} requires legacy Fern configuration`:`Generator ${e.generatorId} ${e.requestedVersion} requires SDK Config v1`,cutoverVersion:t.cutoverVersion,expectedLanguage:t.language,expectedConfigKind:r,recommendedAction:i?"USE_LEGACY_FERN_CONFIG":"USE_SDK_CONFIG_V1"},n)}function VAg(e){return e==="legacy-fern"||e==="sdk-config-v1"}var LJ="latest",gCs="__fern_sdk_config_unpinned__";function jXt(e){return e===gCs}function ACs(e){return e??gCs}function jgi(e,t){return e.requestedVersion!=null?!1:e.versionSource==="fern-latest"?t===LJ:jXt(t)}var qAg=2e3,l7u=1080*1e3,u7u=6e4,aSt=64,WAg=25*1024*1024,HAg=25*1024*1024,p7u=5*1024*1024,f7u=25*1024*1024,KAg=25*1024*1024,v7u=100*1024*1024,JAg=v7u,C7u=50*1024*1024,YAg=1024*1024,x7u=60*1024*1024,yCs=20*1024,XAg="unpinned",ZAg=new Set(["localhost","127.0.0.1","[::1]","::1"]),$Ag=new Intl.Collator("en",{numeric:!0});function S7u(e,t){return t?{type:"download"}:e}var eyg=/^[a-z][a-z0-9_]{0,63}$/,Qgi=class extends Error{status;code;constructor(t,r,n){super(t),this.name="FernSdkGenApiSubmissionError",this.status=r,this.code=n}},QXt="use-sdk-gen-api",cSt="FERN_USE_SDK_GEN_API";function lSt(){let e=process.env[cSt]?.trim().toLowerCase();if(e==="true")return!0;if(e==="false")return!1}function uSt(e){let t=lSt();return t!=null?Promise.resolve(t):a$r().isEnabled(QXt,w7u(e))}function ECs(e){let t=lSt();return t??a$r().getCachedValue(QXt,w7u(e))}async function MXt({organization:e,generatorNames:t}){let r=[...new Set(t)],n=await Promise.all(r.map(async i=>{try{return await uSt({organization:e,generatorName:i})}catch{return!1}}));return new Map(r.map((i,o)=>[i,n[o]===!0]))}function w7u({organization:e,generatorName:t}){let r=fv(t);return{org:e,generator:t,...r!=null?{language:r}:{}}}var tyg=new Set(["fernapi/fern-mcp-server"]);function mGe(e){return tyg.has(e)}function LXt({generatorName:e,version:t}){let r=fv(e);return r==null||oSt(t)==null?!1:Lge({generatorId:e,language:r,requestedVersion:t}).configKind==="sdk-config-v1"}function hFe({generatorName:e,version:t,usesSdkConfig:r}){if(!mGe(e)&&!(!r&&!LXt({generatorName:e,version:t})))return lSt()!==!1}function pSt(e){return mGe(e)}function gFe(){let e=process.env.FERN_SDK_GEN_API_ORIGIN??"https://sdk-gen.postman.co";if(e==null)return;let t;try{t=new URL(e)}catch{throw new Error("FERN_SDK_GEN_API_ORIGIN must be a valid URL")}if(t.username.length>0||t.password.length>0)throw new Error("FERN_SDK_GEN_API_ORIGIN must not contain credentials");let r=t.protocol==="http:"&&ZAg.has(t.hostname);if(t.protocol!=="https:"&&!r)throw new Error("FERN_SDK_GEN_API_ORIGIN must use HTTPS unless it targets localhost");return t.toString().replace(/\/$/,"")}function fv(e){return mCs(e)}function T7u(e,t="legacy-fern"){let r=fv(e.name);if(r!=null)return e.version===LJ&&t==="legacy-fern"?dGe({generatorId:e.name,language:e.language??r,configKind:t,versionSource:"fern-latest"}):fGe({generatorId:e.name,language:e.language??r,requestedVersion:e.version,configKind:t})}function fSt(e,t){let r=e.outputMode;switch(r.type){case"downloadFiles":return{requestedOutput:{type:"download"}};case"github":return d7u({owner:r.owner,repo:r.repo,branch:r.branch,mode:r.makePr===!0?"pull-request":"release",license:r.license,publishInfo:r.publishInfo,githubOptions:t});case"githubV2":{let n=r.githubV2;return d7u({owner:n.owner,repo:n.repo,host:n.host,branch:n.branch,mode:n.type==="pullRequest"?"pull-request":n.type==="push"?"push":"release",reviewers:n.type==="pullRequest"?nyg(n.reviewers):void 0,license:n.license,publishInfo:n.publishInfo,workflows:n.workflows,githubOptions:t})}case"publishV2":{let n=iyg(r.publishV2);return{...n.package!=null?{package:n.package}:{},requestedOutput:{type:"publish",publish:n.publish}}}case"publish":{let n=cyg(e,r.registryOverrides);return{...n.package!=null?{package:n.package}:{},requestedOutput:{type:"publish",publish:n.publish}}}}}function d7u({owner:e,repo:t,host:r,branch:n,mode:i,reviewers:o,license:s,publishInfo:a,workflows:c,githubOptions:l}){let u=a!=null?oyg(a):void 0;return{...u?.package!=null?{package:u.package}:{},requestedOutput:{type:"github",repository:`${e}/${t}`,...r!=null?{host:r}:{},...n!=null?{branch:n}:{},mode:i,...o!=null?{reviewers:o}:{},...s!=null?{license:s}:{},...u!=null?{publish:u.publish}:{},...c===!1?{workflows:!1}:{},...l}}}function ryg(e,t){return e.type==="github"&&t!=null?{...e,...t}:e}function nyg(e){if(e==null)return;let t=e.filter(n=>n.type==="team").map(n=>n.name),r=e.filter(n=>n.type==="user").map(n=>n.name);if(!(t.length===0&&r.length===0))return{...t.length>0?{teams:t}:{},...r.length>0?{users:r}:{}}}function iyg(e){switch(e.type){case"npmOverride":return ICs(e.npmOverride);case"mavenOverride":return vCs(e.mavenOverride);case"pypiOverride":return O7u(e.pypiOverride);case"rubyGemsOverride":return sSt("rubygems",e.rubyGemsOverride);case"nugetOverride":return sSt("nuget",e.nugetOverride);case"cratesOverride":return sSt("crates",e.cratesOverride);case"postman":throw new Error("sdk-gen-api does not support Postman collection publication as an SDK output")}}function oyg(e){switch(e.type){case"npm":return ICs(e);case"maven":return vCs(e);case"pypi":return O7u(e);case"rubygems":return sSt("rubygems",e);case"nuget":return sSt("nuget",e);case"crates":return sSt("crates",e);case"postman":throw new Error("sdk-gen-api does not support Postman collection publication as an SDK output")}}function ICs(e){return{...e?.packageName?{package:{packageName:e.packageName}}:{},publish:{registry:"npm",...e?.registryUrl?{url:e.registryUrl}:{}}}}function O7u(e){let t=e!=null&&"coordinate"in e?e.coordinate:e?.packageName;return{...t?{package:{packageName:t}}:{},publish:{registry:"pypi",...e?.registryUrl?{url:e.registryUrl}:{}}}}function vCs(e){let t=e?.coordinate!=null?ayg(e.coordinate):void 0;return{...t!=null?{package:t}:{},publish:{registry:"maven",...e?.registryUrl?{url:e.registryUrl}:{}}}}var syg=new Set(["OIDC","<USE_OIDC>"]);function sSt(e,t){let r=e==="nuget"||e==="rubygems",n=r&&t?.apiKey!=null&&syg.has(t.apiKey),i=r&&!n?vhi(t?.apiKey):void 0;return{...t?.packageName?{package:{packageName:t.packageName}}:{},publish:{registry:e,...t?.registryUrl?{url:t.registryUrl}:{},...i!=null?{apiKeyEnvironmentVariable:i}:{},...n?{trustedPublishing:!0}:{}}}}function ayg(e){let[t,r]=e.split(":");if(!t||!r)throw new Error(`Invalid Maven coordinate for sdk-gen-api: ${e}`);return{groupId:t,artifactId:r}}function cyg(e,t){let r=fv(e.name);if((r==="typescript"||r==="mcp")&&t.npm!=null)return ICs(t.npm);if((r==="java"||r==="kotlin")&&t.maven!=null)return vCs(t.maven);let n=P7u(r);if(n==null)throw new Error(`sdk-gen-api cannot infer a registry for ${r??e.name}`);return{publish:{registry:n}}}function P7u(e){switch(e){case"typescript":return"npm";case"python":return"pypi";case"java":case"kotlin":return"maven";case"go":return"go";case"csharp":return"nuget";case"php":return"composer";case"ruby":return"rubygems";case"rust":return"crates";case"mcp":return"npm";case"swift":case"cli":case void 0:return}}function B7u(e,t){let r=t.outputMode;if(r.type!=="publish"&&r.type!=="publishV2")return;let n=fSt(t).requestedOutput;if(n.type==="publish"&&n.publish.url!=null&&hVu(n.publish.url),r.type==="publish"){let o=fv(t.name);if((o==="typescript"||o==="mcp")&&r.registryOverrides.npm!=null)return m7u(e,r.registryOverrides.npm.token);if((o==="java"||o==="kotlin")&&r.registryOverrides.maven!=null)return h7u(e,r.registryOverrides.maven);let s=P7u(o);throw s==null||!uyg(s)?new Error(`sdk-gen-api does not support direct ${s??"unknown"} registry publication`):new Error(`Direct ${s} publication through sdk-gen-api requires publish credentials`)}let i=r.publishV2;switch(i.type){case"npmOverride":{let o=zgi("npm",i.npmOverride);return m7u(e,o.token)}case"mavenOverride":{let o=zgi("maven",i.mavenOverride);return h7u(e,o)}case"pypiOverride":{let o=zgi("pypi",i.pypiOverride);return lyg(e,o.username,o.password)}case"cratesOverride":{let o=zgi("crates",i.cratesOverride);return D7u(e,"crates",o.token)}case"rubyGemsOverride":throw new Error("sdk-gen-api does not support direct rubygems registry publication");case"nugetOverride":throw new Error("sdk-gen-api does not support direct nuget registry publication");case"postman":throw new Error("sdk-gen-api does not support Postman collection publication as an SDK output")}}function Ugi(e,t,r,n){return{targetId:e,...N0s(t,r,n)}}function zgi(e,t){if(t==null)throw new Error(`Direct ${e} publication through sdk-gen-api is missing its registry configuration`);return t}function m7u(e,t){return D7u(e,"npm",t)}function D7u(e,t,r){return Ugi(e,{registry:t,token:r})}function lyg(e,t,r){return Ugi(e,{registry:"pypi",username:t,password:r})}function h7u(e,t){return Ugi(e,{registry:"maven",username:t.username,password:t.password,...t.signature==null?{}:{signature:t.signature}})}function uyg(e){return e==="npm"||e==="maven"||e==="pypi"||e==="crates"}function pyg(e,t,r){let n=e.targets.flatMap((i,o)=>{if(i.requestedOutput.type!=="publish")return[];let s=t[o];if(s==null)throw new Error(`Cannot pair sdk-gen-api target ${i.targetId} with publish credentials`);let a=r?.[o],{publishUrl:c,publishRegistry:l}=k7u(i.requestedOutput),u=a!=null?Ugi(i.targetId,a,c,l):B7u(i.targetId,s);return u!=null?[u]:[]});if(n.length!==0){if(n.length>aSt)throw new Error(`sdk-gen-api supports at most ${aSt} direct publish credential targets`);if(e.credentialSetId==null)throw new Error("sdk-gen-api direct registry targets require a credentialSetId");return{schemaVersion:"fern-publish-credentials/v1",credentialSetId:e.credentialSetId,targets:n}}}function R7u(e){B7u("preflight",e)}function Vgi(e){Chi(e.map(t=>({publicationRequested:t.requestedOutput?.type==="publish"||t.requestedOutput?.type==="github"&&t.requestedOutput.publish!=null,credentialsRequired:t.requestedOutput?.type==="publish",...k7u(t.requestedOutput),...t.publishCredential==null?{}:{publishCredential:t.publishCredential}})))}function k7u(e){let t=e?.type==="publish"||e?.type==="github"?e.publish:void 0;return t==null?{}:{publishRegistry:t.registry,...t.url==null?{}:{publishUrl:t.url}}}function F7u(e){let{generatorInvocation:t,sdkVersion:r,specsTarGzBuffer:n,whitelabel:i}=e,o=fv(t.name),s=r==null||r.trim().length>0&&(!(0,zXt.isAutoVersion)(r)||N7u(e.requestedOutput));return o!=null&&s&&n!=null&&i==null}function N7u(e){return e?.type==="github"}function j7u({candidate:e,isSdkConfigTarget:t,isPreview:r}){let{generatorInvocation:n,sdkVersion:i,specsTarGzBuffer:o,whitelabel:s}=e;return s!=null?"whitelabel generation has not yet moved from Fiddle to the shared pipeline":i!=null&&(0,zXt.isAutoVersion)(i)&&!N7u(e.requestedOutput)?t?r?"preview generation only downloads files, so it cannot use --version AUTO":"automatic SDK versioning (--version AUTO) through sdk-gen-api requires GitHub output":"automatic SDK versioning (--version AUTO) through sdk-gen-api requires GitHub output in generators.yml":o==null?"the source archive is unavailable":`generator language ${n.language??"unknown"} does not match ${fv(n.name)}`}var Mgi=class{expectedTargets;participants=[];removedTargetIds=new Set;terminalError;dispatched=!1;constructor(t){if(t<1)throw new Error("A Fern sdk-gen-api batch must expect at least one target");this.expectedTargets=t}run(t){return this.terminalError!=null?Promise.reject(this.terminalError):t.targetIdSeed!=null&&this.removedTargetIds.has(t.targetIdSeed)?Promise.reject(new Error(`Fern sdk-gen-api target ${t.targetIdSeed} was removed`)):this.dispatched?Promise.reject(new Error("The Fern sdk-gen-api batch was already dispatched")):new Promise((r,n)=>{this.participants.push({...t,resolve:r,reject:n}),this.dispatchIfReady()})}skip(){this.dispatched||this.terminalError!=null||(this.expectedTargets-=1,this.dispatchIfReady())}remove(t,r){if(this.dispatched||this.terminalError!=null||this.removedTargetIds.has(t))return!1;this.removedTargetIds.add(t);let n=this.participants.findIndex(o=>o.targetIdSeed===t),[i]=n>=0?this.participants.splice(n,1):[];return i?.reject(r),this.expectedTargets-=1,this.dispatchIfReady(),!0}cancel(t){if(!(this.dispatched||this.terminalError!=null)){this.terminalError=t;for(let r of this.participants)r.reject(t)}}dispatchIfReady(){this.dispatched||this.terminalError!=null||this.expectedTargets===0||this.participants.length!==this.expectedTargets||(this.dispatched=!0,this.dispatch())}async dispatch(){let t=[...this.participants].sort(Cyg);try{(await L7u(t)).forEach((n,i)=>{let o=t[i];n.status==="fulfilled"?o?.resolve(n.value):o?.reject(n.reason)})}catch(r){this.terminalError=r;for(let n of this.participants)n.reject(r)}}},Lgi=class{expectedTargetIds;settledTargetIds=new Set;waiters=[];preflightParticipants=[];terminalError;didRunPreflight=!1;constructor(t){if(this.expectedTargetIds=new Set(t),this.expectedTargetIds.size!==t.length)throw new Error("Fern sdk-gen-api preparation target IDs must be unique")}ready(t,r){if(this.assertExpected(t),this.settledTargetIds.has(t))throw new Error(`Fern sdk-gen-api target ${t} prepared more than once`);return this.settledTargetIds.add(t),r!=null&&this.preflightParticipants.push(r),new Promise((n,i)=>{this.waiters.push({resolve:n,reject:i}),this.finishIfSettled()})}fail(t,r,n){return this.assertExpected(t),this.settledTargetIds.has(t)?!1:(this.settledTargetIds.add(t),n||(this.terminalError=r),this.finishIfSettled(),!0)}assertExpected(t){if(!this.expectedTargetIds.has(t))throw new Error(`Unexpected Fern sdk-gen-api preparation target ${t}`)}finishIfSettled(){if(this.settledTargetIds.size===this.expectedTargetIds.size){if(!this.didRunPreflight&&this.terminalError==null&&this.preflightParticipants.length>0){this.didRunPreflight=!0;try{M7u(this.preflightParticipants)}catch(t){this.terminalError=t}}for(let t of this.waiters)this.terminalError!=null?t.reject(this.terminalError):t.resolve()}}};async function z7u(e){let[t]=await L7u([e]);if(t?.status==="fulfilled")return t.value;throw t?.reason??new Error("sdk-gen-api did not return the requested target")}function Q7u(e){if(e>aSt)throw new Error(`sdk-gen-api supports at most ${aSt} target payloads per build; received ${e}`)}function M7u(e){let t=e[0];if(t==null)throw new Error("Cannot submit an empty Fern sdk-gen-api build");Iyg(e);let r;try{r=gFe()}catch(p){return t.context.failAndThrow(p instanceof Error?p.message:"Invalid sdk-gen-api origin",p,{code:w.Code.ConfigError})}if(!r)return t.context.failAndThrow("FERN_SDK_GEN_API_ORIGIN is required when sdk-gen-api generation is enabled",void 0,{code:w.Code.ConfigError});jyg(e),xyg(e,t);let n=zyg({apiName:t.apiName,organization:t.organization,cliVersion:t.cliVersion,specsTarGzBuffer:t.specsTarGzBuffer,targets:e.map(p=>({generatorInvocation:p.generatorInvocation,resolvedGeneratorVersion:p.resolvedGeneratorVersion,sdkGenApiRoute:p.sdkGenApiRoute,sdkName:p.sdkName,sdkVersion:p.sdkVersion,apiVersion:p.apiVersion,targetIdSeed:p.targetIdSeed,sourceSpecIndexes:p.sourceSpecIndexes,audiences:p.audiences,payload:p.payload,requestedOutput:p.requestedOutput,autoVersionPreviewOutput:p.autoVersionPreviewOutput,publishCredential:p.publishCredential,githubOptions:p.githubOptions}))}),i=pyg(n,e.map(p=>p.generatorInvocation),e.map(p=>p.publishCredential)),o=i!=null?Buffer.from(JSON.stringify(i)):void 0;if(o!=null&&o.length>65536)return t.context.failAndThrow(`sdk-gen-api publish credentials file is ${wyg(o.length)}, exceeding the 64 KiB limit`,void 0,{code:w.Code.ConfigError});let s=t.specsTarGzBuffer.length+e.reduce((p,d)=>p+d.payload.body.length,0)+(o?.length??0);if(s>C7u)return t.context.failAndThrow(`sdk-gen-api source archive, target payloads, and publish credentials total ${Z9(s)}, exceeding the 50 MiB in-memory upload limit`,void 0,{code:w.Code.ConfigError});let a=JSON.stringify(n),c=Buffer.byteLength(a,"utf8");if(c>YAg)return t.context.failAndThrow(`sdk-gen-api serialized request field is ${Z9(c)}, exceeding the 1 MiB UTF-8 field limit; reduce generator customConfig, readme, settings, or API override metadata`,void 0,{code:w.Code.ConfigError});let l=new E7u.default;l.append("request",a),l.append("sources",t.specsTarGzBuffer,{filename:"specs.tar.gz",contentType:"application/gzip"}),e.forEach((p,d)=>{let f=n.targets[d];if(f==null)throw new Error(`Cannot pair sdk-gen-api payload at index ${d} with a target`);let m=p.payload.payloadKind==="fern-runtime-bundle";l.append("payloads",p.payload.body,{filename:`${f.targetId}.json${m?".gz":""}`,contentType:m?"application/gzip":"application/json"})}),o!=null&&l.append("credentials",o,{filename:"publish-credentials.v1.json",contentType:"application/json"});let u=l.getLengthSync();return u>x7u?t.context.failAndThrow(`sdk-gen-api multipart request is ${Z9(u)}, exceeding the 60 MiB limit; reduce source or target payload size`,void 0,{code:w.Code.ConfigError}):{first:t,origin:r,request:n,form:l,sensitiveValues:pCs([t.token.value,...Ayg(i)])}}async function L7u(e){let{first:t,origin:r,request:n,form:i,sensitiveValues:o}=M7u(e);dyg({first:t,origin:r,request:n,participants:e,sensitiveValues:o});let s;try{s=(await Nd.post(`${r}/v1/fern/build`,i,{headers:{...i.getHeaders(),Authorization:`Bearer ${t.token.value}`,"X-Fern-Organization-Id":t.organization},maxBodyLength:x7u,timeout:u7u})).data.buildId}catch(l){myg(t.context,l,o);let u=A7u(l,o);return t.context.failAndThrow(`Failed to submit sdk-gen-api build: ${u.message}`,u,{code:w.Code.NetworkError})}for(let l of e)l.context.logger.debug(`sdk-gen-api build ID: ${s}`);fyg({participants:e,request:n,origin:r,buildId:s});let a=new Map,c=Date.now()+l7u;for(;;){let l=Date.now()>=c,u;try{let f=await Nd.get(`${r}/v1/fern/build/${s}`,{headers:{Authorization:`Bearer ${t.token.value}`,"X-Fern-Organization-Id":t.organization},timeout:u7u});u=yyg(f.data,o)}catch(f){let m=A7u(f,o);return t.context.failAndThrow("Failed to poll sdk-gen-api build",m,{code:w.Code.NetworkError})}let p=n.targets.find(f=>!u.targets.some(m=>m.targetId===f.targetId));if(p!=null)return t.context.failAndThrow(`sdk-gen-api response did not contain target ${p.targetId}`,void 0,{code:w.Code.InternalError});for(let[f,m]of n.targets.entries()){let g=u.targets.find(I=>I.targetId===m.targetId),A=e[f]?.context;if(g==null||A==null)continue;let y=a.get(g.targetId)??0;for(let I of g.logs.slice(y))hyg(A,I);a.set(g.targetId,g.logs.length)}if(n.targets.every(f=>Tyg(u,f.targetId))||u.status==="failed"||u.status==="succeeded"){let f=await Promise.allSettled(e.map((m,g)=>Pyg(m,n.targets[g]?.targetId,u,n.targets[g]?.requestedOutput)));return Oyg({participant:t,status:u,buildId:s}),f}if(l)return t.context.failAndThrow(`Timed out waiting for sdk-gen-api build ${s} after ${l7u/6e4} minutes`,void 0,{code:w.Code.InternalError});await Xp(qAg)}}function fyg({participants:e,request:t,origin:r,buildId:n}){for(let[i,o]of e.entries()){let s=t.targets[i];if(s!=null)try{o.context.instrumentPostHogEvent({orgId:o.organization,command:"sdk-gen-api build submitted",properties:{sdkGenApiBuildId:n,sdkGenApiTargetId:s.targetId,sdkGenApiTargetCount:t.targets.length,sdkGenApiHost:new URL(r).host,apiName:t.apiName,generatorName:s.fernGenerator.id,generatorVersion:s.fernGenerator.version??o.generatorInvocation.version,language:s.language,payloadKind:s.payloadKind,outputMode:s.requestedOutput.type,sdkName:s.sdk.name,sdkVersion:s.sdk.version}})}catch(a){o.context.logger.debug(`[telemetry] failed to send sdk-gen-api build event: ${String(a)}`)}}}function dyg({first:e,origin:t,request:r,participants:n,sensitiveValues:i}){let o=new Map(r.targets.map((s,a)=>{let c=n[a];return[s.targetId,{uploadBytes:c?.payload.body.length??0,targetIdSeed:c?.targetIdSeed,sourceSpecIndexes:c?.sourceSpecIndexes}]}));e.context.logger.debug(`Submitting sdk-gen-api build: ${_gi({origin:t,sourceArchiveBytes:e.specsTarGzBuffer.length,request:{protocolVersion:r.protocolVersion,apiName:r.apiName,cliVersion:r.cliVersion,idempotencyKey:g7u(r.idempotencyKey),credentialSetId:r.credentialSetId==null?void 0:g7u(r.credentialSetId),apiInputs:r.apiInputs,targets:r.targets.map(s=>({targetId:s.targetId,apiInputId:s.apiInputId,language:s.language,sdk:s.sdk,fernGenerator:s.fernGenerator,payloadKind:s.payloadKind,package:s.package,requestedOutput:s.requestedOutput,invocation:{customConfigKeys:Object.keys(s.invocation.customConfig).sort(),keywords:s.invocation.keywords,smartCasing:s.invocation.smartCasing,smartCasingDigitWordBoundary:s.invocation.smartCasingDigitWordBoundary,disableExamples:s.invocation.disableExamples,audiences:s.invocation.audiences,hasReadme:s.invocation.readme!=null,hasSettings:s.invocation.settings!=null,hasApiOverride:s.invocation.apiOverride!=null},payload:o.get(s.targetId)}))}},i)}`)}function myg(e,t,r){if(!(t instanceof FVt)){e.logger.debug(`sdk-gen-api submission failed before receiving an HTTP response: ${_gi(t instanceof Error?{name:t.name,message:t.message}:{error:String(t)},r)}`);return}e.logger.debug(`sdk-gen-api submission HTTP failure: ${_gi({status:t.response?.status??t.status,statusText:t.response?.statusText,code:t.code,responseBody:t.response?.data},r)}`)}function g7u(e){return e.length<=12?e:`${e.slice(0,12)}...`}function _gi(e,t){let r;try{r=typeof e=="string"?e:JSON.stringify(e)}catch(i){r=i instanceof Error?`Failed to serialize debug value: ${i.message}`:String(e)}let n=X9(r,t);return n.length>yCs?`${n.slice(0,yCs)}... [truncated ${n.length-yCs} bytes]`:n}function hyg(e,t){switch(t.level.toLowerCase()){case"error":e.logger.error(t.message);return;case"warn":case"warning":e.logger.warn(t.message);return;case"debug":case"trace":e.logger.debug(t.message);return;default:e.logger.info(t.message)}}function A7u(e,t){if(!(e instanceof FVt))return new Qgi(X9(e instanceof Error?e.message:"Unknown submission error",t),void 0,void 0);let r=gyg(e,t);return new Qgi(r??X9(e.message,t),e.response?.status??e.status,e.code)}function gyg(e,t){let r=e.response?.data;if(typeof r=="object"&&r!=null&&"message"in r&&typeof r.message=="string")return X9(r.message,t);if(r!=null)return`sdk-gen-api response body: ${_gi(r,t)}`}function Ayg(e){return(e?.targets??[]).flatMap(t=>t.registry==="npm"||t.registry==="crates"?[t.token]:t.registry==="pypi"?[t.username,t.password]:[t.username,t.password,...t.signature!=null?[t.signature.keyId,t.signature.password,t.signature.secretKey]:[]])}function yyg(e,t){return{...e,targets:e.targets.map(r=>({...r,logs:r.logs.map(n=>({...n,message:X9(n.message,t)})),...r.error==null?{}:{error:{...typeof r.error.code=="string"?{code:X9(r.error.code,t)}:{},message:X9(r.error.message,t)}},...r.publication==null?{}:r.publication.status==="success"?{publication:{...r.publication,publishTarget:{...r.publication.publishTarget,identifier:fCs(r.publication.publishTarget.identifier,t)}}}:{publication:{...r.publication,publishTarget:{...r.publication.publishTarget,identifier:fCs(r.publication.publishTarget.identifier,t)},error:byg(r.publication.error,t)}}}))}}function byg(e,t){let{reason:r,detail:n,...i}=e,o=typeof n=="string"?X9(n,t).trim():void 0,s=typeof r=="string"&&eyg.test(r)&&X9(r,t)===r?r:void 0;return{...i,message:X9(e.message,t),...s!=null?{reason:s}:{},...o!=null&&o.length>0?{detail:o}:{}}}function Eyg(e){let t=`sdk-gen-api publication failed (${e.code}): ${e.message}`;return e.detail==null||e.detail===e.message?t:e.reason!=null?`${t}: ${e.detail} [${e.reason}]`:`${t}: ${e.detail}`}function Iyg(e){for(let t of e){let{generatorInvocation:r}=t,n=r.language??fv(r.name);n==null&&t.context.failAndThrow(`Cannot submit SDK generation to sdk-gen-api: generator language is unknown for ${r.name}`,void 0,{code:w.Code.ConfigError});let i;try{i=vyg(t,n)}catch(o){if(!(o instanceof Ose))throw o;t.context.failAndThrow(_Xt(o),void 0,{code:w.Code.ConfigError})}i.payloadKind!==t.payload.payloadKind&&t.context.failAndThrow(`Cannot submit SDK generation to sdk-gen-api: selected route payload ${i.payloadKind} does not match participant payload ${t.payload.payloadKind}`,void 0,{code:w.Code.ConfigError})}}function vyg(e,t){let{generatorInvocation:r,sdkGenApiRoute:n}=e;if(n?.requestedVersion==null){if(n!=null){if(!jgi(n,r.version))throw U7u(n,r.version);return dGe({generatorId:r.name,language:t,configKind:n.configKind,versionSource:n.versionSource})}return fGe({generatorId:r.name,language:t,requestedVersion:r.version,configKind:e.payload.payloadKind==="fern-runtime-bundle"?"legacy-fern":"sdk-config-v1"})}return fGe({generatorId:r.name,language:t,requestedVersion:n.requestedVersion,configKind:n.configKind})}function _Xt(e){let t=[e.code,`generator=${e.generatorId}`,`language=${e.language}`,`requestedVersion=${e.requestedVersion}`,`cutoverVersion=${e.cutoverVersion??"n/a"}`,`receivedConfigKind=${String(e.receivedConfigKind)}`,`expectedConfigKind=${e.expectedConfigKind??"n/a"}`,`expectedLanguage=${e.expectedLanguage??"n/a"}`,`retryable=${e.retryable}`,`recommendedAction=${e.recommendedAction}`].join("; "),r=e.recommendedAction==="USE_SDK_CONFIG_V1"?" Run `fern sdk migrate`, then pass the generated document with `fern generate --sdk-config <path>` before using this generator version.":"";return`Cannot submit SDK generation to sdk-gen-api: ${e.message} [${t}].${r}`}function _7u(e,t,r){if(e==null)return t.version;if(e.requestedVersion!=null)return e.requestedVersion;if(!jgi(e,t.version))throw U7u(e,t.version);return r}function U7u(e,t){return new Error(`An unpinned sdk-gen-api route does not match its generator version representation: invocationVersion=${JSON.stringify(t)}; configKind=${e.configKind}; versionSource=${e.requestedVersion==null?e.versionSource:"pinned"}`)}function bCs(e,t,r){return _7u(e,t,r)??XAg}function Cyg(e,t){let r=$Ag.compare(e.targetIdSeed??"",t.targetIdSeed??"");if(r!==0)return r;let n=e.generatorInvocation.name.localeCompare(t.generatorInvocation.name);if(n!==0)return n;let i=bCs(e.sdkGenApiRoute,e.generatorInvocation).localeCompare(bCs(t.sdkGenApiRoute,t.generatorInvocation));return i!==0?i:(e.sdkVersion??"").localeCompare(t.sdkVersion??"")}function xyg(e,t){e.length>aSt&&t.context.failAndThrow(`sdk-gen-api supports at most ${aSt} target payloads per build; received ${e.length}`,void 0,{code:w.Code.ConfigError}),t.specsTarGzBuffer.length>WAg&&t.context.failAndThrow(`sdk-gen-api source archive is ${Z9(t.specsTarGzBuffer.length)}, exceeding the 25 MiB compressed limit`,void 0,{code:w.Code.ConfigError});let r=e.findIndex(s=>s.payload.body.length>(s.payload.payloadKind==="fern-runtime-bundle"?p7u:f7u));if(r>=0){let s=e[r],a=s?.payload.payloadKind==="fern-runtime-bundle"?p7u:f7u;t.context.failAndThrow(`sdk-gen-api ${y7u(s,r)} is ${Z9(s?.payload.body.length??0)}, exceeding the ${Z9(a)} upload limit`,void 0,{code:w.Code.ConfigError})}let n=e.reduce((s,a)=>s+a.payload.body.length,t.specsTarGzBuffer.length);n>C7u&&t.context.failAndThrow(`sdk-gen-api source archive and target payloads total ${Z9(n)}, exceeding the 50 MiB in-memory upload limit; reduce the source archive size, target payload size, or number of targets`,void 0,{code:w.Code.ConfigError});let i=e.reduce((s,a)=>a.payload.payloadKind==="fern-runtime-bundle"?s+a.payload.body.length:s,0);i>KAg&&t.context.failAndThrow(`sdk-gen-api runtime bundles total ${Z9(i)}, exceeding the 25 MiB compressed limit; reduce the number or size of targets`,void 0,{code:w.Code.ConfigError}),b7u({buffer:t.specsTarGzBuffer,maxBytes:HAg,label:"source archive",context:t.context});let o=0;for(let[s,a]of e.entries())o+=a.payload.payloadKind==="fern-runtime-bundle"?b7u({buffer:a.payload.body,maxBytes:JAg,label:y7u(a,s),context:t.context}):a.payload.body.length,o>v7u&&t.context.failAndThrow(`sdk-gen-api target payloads total ${Z9(o)}, exceeding the 100 MiB decoded limit; reduce the number or size of targets`,void 0,{code:w.Code.ConfigError})}function y7u(e,t){return`${e?.payload.payloadKind??"target payload"} ${e?.targetIdSeed??t.toString()}`}function b7u({buffer:e,maxBytes:t,label:r,context:n}){let i;try{i=(0,I7u.gunzipSync)(e,{maxOutputLength:t+1})}catch(o){return Syg(o)?n.failAndThrow(`sdk-gen-api ${r} exceeds the ${Z9(t)} decompressed limit`,void 0,{code:w.Code.ConfigError}):n.failAndThrow(`sdk-gen-api ${r} is malformed gzip; regenerate it and retry`,o,{code:w.Code.ConfigError})}return i.length>t?n.failAndThrow(`sdk-gen-api ${r} is ${Z9(i.length)} decompressed, exceeding the ${Z9(t)} decompressed limit`,void 0,{code:w.Code.ConfigError}):i.length}function Syg(e){return e instanceof Error&&"code"in e&&e.code==="ERR_BUFFER_TOO_LARGE"}function Z9(e){return`${(e/(1024*1024)).toFixed(2)} MiB`}function wyg(e){return`${(e/1024).toFixed(2)} KiB`}function Tyg(e,t){let r=e.targets.find(n=>n.targetId===t);return r?.status==="failed"||r?.status==="succeeded"}function Oyg({participant:e,status:t,buildId:r}){if(e.token.type!=="guest"||!t.targets.some(i=>i.status==="succeeded"&&i.result?.artifactUrl!=null))return;let n=AVu({claimUrl:e.token.claimUrl,buildId:r});e.context.logger.info(n!=null?`Build ${r} is kept for 7 days: ${n} (claiming the session moves it into your organization)`:`Build ${r} is kept for 7 days (claiming the session moves it into your organization)`)}async function Pyg(e,t,r,n){let i=r.targets.find(u=>u.targetId===t);if(i==null)return e.context.failAndThrow("sdk-gen-api response did not contain the requested target",void 0,{code:w.Code.InternalError});if(i.status==="failed")return i.publication?.status==="failure"?e.context.failAndThrow(Eyg(i.publication.error),void 0,{code:w.Code.ContainerError}):e.context.failAndThrow(Byg(i.error),void 0,{code:w.Code.ContainerError});if(i.status!=="succeeded")return e.context.failAndThrow(`sdk-gen-api build ended with status ${r.status} while target ${i.targetId} remained ${i.status}`,void 0,{code:w.Code.InternalError});let o=e.sdkVersion!=null&&(0,zXt.isAutoVersion)(e.sdkVersion),s=o&&i.publication?.status==="success"&&i.publication.output.noChangesDetected===!0&&i.result?.actualVersion==null,a=i.result?.artifactUrl;if(a==null&&!s)return e.context.failAndThrow("sdk-gen-api target completed without an artifact URL",void 0,{code:w.Code.InternalError});a==null?e.context.logger.info("No changes detected; there is no SDK preview to download."):e.absolutePathToPreview!=null?await Ngi({s3PreSignedReadUrl:a,absolutePathToLocalOutput:Re(e.absolutePathToPreview,be.of(bVu(e.generatorInvocation.name,Fyg(e.generatorInvocation)))),context:e.context,skipFernignore:e.skipFernignore}):e.absolutePathToLocalOutputArchive!=null?await n7u({s3PreSignedReadUrl:a,absolutePathToLocalOutput:e.absolutePathToLocalOutputArchive,context:e.context}):e.generatorInvocation.absolutePathToLocalOutput!=null&&await Ngi({s3PreSignedReadUrl:a,absolutePathToLocalOutput:e.generatorInvocation.absolutePathToLocalOutput,context:e.context,skipFernignore:e.skipFernignore});let c=i.result?.actualVersion??(o?void 0:e.sdkVersion),l=e.autoVersionPreviewOutput!=null?{pullRequestUrl:void 0,noChangesDetected:i.publication?.status==="success"&&i.publication.output.noChangesDetected===!0?!0:void 0}:Dyg(e,i,n);return o&&c!=null&&e.context.logger.info(`AUTO versioning picked new version: ${c}`),{createdSnippets:!1,snippetsS3PreSignedReadUrl:void 0,actualVersion:c,...l,publishTarget:c==null||e.autoVersionPreviewOutput!=null?void 0:Nyg(i,c)}}function Byg(e){let t=e?.message||"sdk-gen-api generation failed";return e?.code!=null&&e.code!==""?`${e.code}: ${t}`:t}function Dyg(e,t,r){if(r?.type!=="github")return{pullRequestUrl:void 0,noChangesDetected:void 0};let{publication:n}=t;if(n?.status!=="success"||n.publishTarget.type!=="github")return e.context.failAndThrow(`sdk-gen-api reported the build as succeeded but did not confirm the GitHub delivery to ${r.repository}`,void 0,{code:w.Code.InternalError});let i=Ryg(n.output.pullRequestUrl),o=n.output.noChangesDetected===!0,s={pullRequestUrl:o?void 0:i,noChangesDetected:o?!0:void 0},a=n.output.pullRequestUrl!=null&&i==null;return kyg(e.context.logger,r,s,a),s}function Ryg(e){let t=e==null?void 0:V7u(e);if(t==null)return;let{origin:r,pathname:n}=new URL(t);return`${r}${n}`}function kyg(e,{repository:t,mode:r},{pullRequestUrl:n,noChangesDetected:i},o){if(i){e.info(`No changes detected for ${t}; nothing was delivered to GitHub.`);return}if(n!=null){e.info(`Pull request: ${n}`);return}if(o){e.warn(`sdk-gen-api returned a pull request link for ${t} that was not a safe HTTPS URL.`);return}r==="pull-request"&&e.warn(`sdk-gen-api did not return a pull request link for ${t}.`)}function Fyg(e){return e.sdkConfigTargetIndex}function Nyg(e,t){if(e.publication?.status!=="success")return;let r=e.publication.publishTarget.type,n=e.publication.publishTarget.identifier,i=V7u(n);switch(r){case"npm":return{registry:r,label:"npm",version:t,identifier:n,...i!=null?{url:i}:{}};case"pypi":return{registry:r,label:"PyPI",version:t,identifier:n,...i!=null?{url:i}:{}};case"crates":return{registry:r,label:"crates.io",version:t,identifier:n,...i!=null?{url:i}:{}};case"maven":return{registry:r,label:"Maven Central",version:t,identifier:n,...i!=null?{url:i}:{}};case"github":case"unsupported":return}}function V7u(e){try{let t=new URL(e);return t.protocol==="https:"&&t.username.length===0&&t.password.length===0?e:void 0}catch{return}}function jyg(e){let t=e[0];if(t==null)return;let r=(0,Pse.createHash)("sha256").update(t.specsTarGzBuffer).digest("hex");for(let n of e.slice(1)){let i=(0,Pse.createHash)("sha256").update(n.specsTarGzBuffer).digest("hex");if(n.apiName!==t.apiName||n.organization!==t.organization||n.token.value!==t.token.value||i!==r)throw new Error("Fern sdk-gen-api batch targets must share API, organization, token, and sources")}}function zyg({apiName:e,organization:t,cliVersion:r,specsTarGzBuffer:n,targets:i}){if(i.length===0)throw new Error("Cannot create an empty Fern sdk-gen-api request");let o=[],s=i.map(({targetIdSeed:f,sourceSpecIndexes:m},g)=>{if(m==null)return o.some(y=>y.id==="default")||o.push({id:"default",specIndexes:"all"}),"default";let A=`target-${f??g.toString()}`;return o.push({id:A,specIndexes:m}),A}),a=i.map(({generatorInvocation:f,resolvedGeneratorVersion:m,sdkGenApiRoute:g,sdkName:A,sdkVersion:y,apiVersion:I,targetIdSeed:C,audiences:x,payload:S,requestedOutput:B,autoVersionPreviewOutput:D,githubOptions:R},O)=>{let z=fv(f.name);if(z==null)throw new Error(`Unsupported Fern SDK generator: ${f.name}`);let Y=fSt(f,R),$=ryg(B??Y.requestedOutput,R),ee=S.payloadKind==="fern-runtime-bundle"?Y.package:S.package,se=_7u(g,f,m),ue=bCs(g,f,m);return{targetId:(0,Pse.createHash)("sha256").update(`${e}:${f.name}:${ue}:${C??O.toString()}`).digest("hex").slice(0,20),apiInputId:s[O]??"default",language:z,sdk:{name:A??e,...y!=null?{version:y}:{},...I!=null?{apiVersion:I}:{}},fernGenerator:{id:f.name,...se!=null?{version:se}:{}},payloadKind:S.payloadKind,...ee!=null?{package:ee}:{},invocation:{customConfig:Dee(f.config)??{},keywords:f.keywords??[],smartCasing:f.smartCasing,smartCasingDigitWordBoundary:f.smartCasingDigitWordBoundary,disableExamples:f.disableExamples,...x!=null?{audiences:x}:{},...f.readme!=null?{readme:f.readme}:{},...f.settings!=null?{settings:f.settings}:{},...f.apiOverride!=null?{apiOverride:f.apiOverride}:{}},requestedOutput:$,...D!=null?{autoVersionPreview:{github:D}}:{}}}),c=i.map(f=>(0,Pse.createHash)("sha256").update(f.payload.body).digest("hex")),l=JSON.stringify({protocolVersion:2,organization:t,apiName:e,apiInputs:o,targets:a,payloadHashes:c,sourceHash:(0,Pse.createHash)("sha256").update(n).digest("hex")}),u=a.some(f=>f.requestedOutput.type==="publish")?Qyg(l):void 0,p=a.some(f=>f.sdk.version==null||(0,zXt.isAutoVersion)(f.sdk.version))?(0,Pse.randomUUID)():void 0,d=(0,Pse.createHash)("sha256").update(n).update(JSON.stringify({protocolVersion:2,organization:t,apiName:e,credentialSetId:u,apiInputs:o,targets:a,payloadHashes:c,...p!=null?{dynamicVersionRunId:p}:{}})).digest("hex");return{protocolVersion:2,apiName:e,...r?{cliVersion:r}:{},idempotencyKey:d,...u!=null?{credentialSetId:u}:{},apiInputs:o,targets:a}}function Qyg(e){let t=(0,Pse.createHash)("sha256").update(e).digest().subarray(0,16);t[6]=(t[6]??0)&15|128,t[8]=(t[8]??0)&63|128;let r=t.toString("hex");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}yc();Uo();It();jn();function hGe({apiName:e,organization:t,generatorInvocation:r}){let n=Myg(r);return{apiName:e,organization:t,customConfig:Dee(r.config),outputConfig:n??ar.GeneratorOutputConfig.local()}}function Myg(e){let t=e.outputMode;switch(t.type){case"downloadFiles":return ar.GeneratorOutputConfig.local();case"publishV2":return Lyg({publish:t.publishV2,version:e.version});case"githubV2":return _yg({github:t.githubV2,language:e.language,version:e.version});case"publish":case"github":return;default:rt(t)}}function Lyg({publish:e,version:t}){switch(e.type){case"npmOverride":{let r=e.npmOverride;return r==null?void 0:ar.GeneratorOutputConfig.publish(ar.PublishInfo.npm({version:t,packageName:r.packageName,repoUrl:void 0}))}case"mavenOverride":{let r=e.mavenOverride;return r==null?void 0:ar.GeneratorOutputConfig.publish(ar.PublishInfo.maven({version:t,coordinate:r.coordinate,repoUrl:void 0}))}case"pypiOverride":{let r=e.pypiOverride;return r==null?void 0:ar.GeneratorOutputConfig.publish(ar.PublishInfo.pypi({version:t,packageName:r.coordinate,repoUrl:void 0}))}case"rubyGemsOverride":{let r=e.rubyGemsOverride;return r==null?void 0:ar.GeneratorOutputConfig.publish(ar.PublishInfo.rubygems({version:t,packageName:r.packageName,repoUrl:void 0}))}case"nugetOverride":{let r=e.nugetOverride;return r==null?void 0:ar.GeneratorOutputConfig.publish(ar.PublishInfo.nuget({version:t,packageName:r.packageName,repoUrl:void 0}))}case"cratesOverride":{let r=e.cratesOverride;return r==null?void 0:ar.GeneratorOutputConfig.publish(ar.PublishInfo.crates({version:t,packageName:r.packageName,repoUrl:void 0}))}case"postman":return;default:rt(e)}}function _yg({github:e,version:t,language:r}){let n=Uyg({owner:e.owner,repo:e.repo});if(r===zr.GenerationLanguage.GO)return ar.GeneratorOutputConfig.publish(ar.PublishInfo.go({version:t,repoUrl:n}));if(r===zr.GenerationLanguage.SWIFT)return ar.GeneratorOutputConfig.publish(ar.PublishInfo.swift({version:t,repoUrl:n}));let i=e.publishInfo;if(i!=null)switch(i.type){case"maven":return ar.GeneratorOutputConfig.publish(ar.PublishInfo.maven({version:t,coordinate:i.coordinate,repoUrl:n}));case"npm":return ar.GeneratorOutputConfig.publish(ar.PublishInfo.npm({version:t,packageName:i.packageName,repoUrl:n}));case"pypi":return ar.GeneratorOutputConfig.publish(ar.PublishInfo.pypi({version:t,packageName:i.packageName,repoUrl:n}));case"rubygems":return ar.GeneratorOutputConfig.publish(ar.PublishInfo.rubygems({version:t,packageName:i.packageName,repoUrl:n}));case"nuget":return ar.GeneratorOutputConfig.publish(ar.PublishInfo.nuget({version:t,packageName:i.packageName,repoUrl:n}));case"crates":return ar.GeneratorOutputConfig.publish(ar.PublishInfo.crates({version:t,packageName:i.packageName,repoUrl:n}));case"postman":return;default:rt(i)}}function Uyg({owner:e,repo:t}){return`https://github.com/${e}/${t}`}Zn();$6();Dt();NU();var XA=Ae(A$u(),1),dL=Ae(Jg(),1),E$u=Ae(require("path"),1),hwg="0.0.1";function uZt(e){if(e.raw?.github!=null&&typeof e.raw.github=="object"&&"license"in e.raw.github){let t=e.raw.github;if(t.license!=null){if(typeof t.license=="string")return{type:"basic",value:t.license};if(typeof t.license=="object"&&"custom"in t.license)return{type:"custom",value:t.license.custom}}}if(e.raw?.metadata?.license!=null){let t=e.raw.metadata.license;if(typeof t=="string")return{type:"basic",value:t};if(typeof t=="object"&&"custom"in t)return{type:"custom",value:t.custom}}}function gwg(e,t){let r=uZt(e);if(r!=null){if(r.type==="basic"){if(r.value==="MIT"||r.value==="Apache-2.0")return XA.FernGeneratorExec.LicenseConfig.basic({id:r.value==="MIT"?XA.FernGeneratorExec.LicenseId.Mit:XA.FernGeneratorExec.LicenseId.Apache2})}else if(r.type==="custom")return XA.FernGeneratorExec.LicenseConfig.custom({filename:E$u.basename(r.value)})}}function uyi(e,t={}){let r=t.omitPublishCredentials??!1;return e!=null?Gr.GithubPublishInfo._visit(e,{npm:n=>{let i=(n.token??"").trim(),o=qxs(i),s=i!=="";return XA.FernGeneratorExec.GithubPublishInfo.npm({registryUrl:n.registryUrl,packageName:n.packageName,tokenEnvironmentVariable:(0,dL.EnvironmentVariable)(r?o!=null?"<USE_OIDC>":"":o!=null?"<USE_OIDC>":i.startsWith("${")&&i.endsWith("}")?i.slice(2,-1).trim():""),shouldGeneratePublishWorkflow:o!=null||s})},maven:n=>XA.FernGeneratorExec.GithubPublishInfo.maven({registryUrl:n.registryUrl,coordinate:n.coordinate,usernameEnvironmentVariable:(0,dL.EnvironmentVariable)(r?"":n.credentials?.username??""),passwordEnvironmentVariable:(0,dL.EnvironmentVariable)(r?"":n.credentials?.password??""),signature:n.signature!=null&&!r?{keyIdEnvironmentVariable:(0,dL.EnvironmentVariable)(n.signature.keyId??""),passwordEnvironmentVariable:(0,dL.EnvironmentVariable)(n.signature.password??""),secretKeyEnvironmentVariable:(0,dL.EnvironmentVariable)(n.signature.secretKey??"")}:void 0}),pypi:n=>{let i=(n.credentials?.password??"").trim(),o=qxs(i),s=n.credentials!=null;return XA.FernGeneratorExec.GithubPublishInfo.pypi({registryUrl:n.registryUrl,packageName:n.packageName,usernameEnvironmentVariable:(0,dL.EnvironmentVariable)(r?"":"PYPI_USERNAME"),passwordEnvironmentVariable:(0,dL.EnvironmentVariable)(r?o!=null?"OIDC":"":o!=null?"OIDC":"PYPI_PASSWORD"),shouldGeneratePublishWorkflow:o!=null||s,pypiMetadata:n.pypiMetadata})},rubygems:n=>XA.FernGeneratorExec.GithubPublishInfo.rubygems({registryUrl:n.registryUrl,packageName:n.packageName,apiKeyEnvironmentVariable:(0,dL.EnvironmentVariable)(r?"":n.apiKey??"")}),postman:n=>XA.FernGeneratorExec.GithubPublishInfo.postman({apiKeyEnvironmentVariable:(0,dL.EnvironmentVariable)(r?"":n.apiKey??""),workspaceIdEnvironmentVariable:(0,dL.EnvironmentVariable)(r?"":n.workspaceId??"")}),nuget:n=>{let i=(n.apiKey??"").trim(),o=qxs(i);return XA.FernGeneratorExec.GithubPublishInfo.nuget({registryUrl:n.registryUrl,packageName:n.packageName,apiKeyEnvironmentVariable:(0,dL.EnvironmentVariable)(r?o!=null?"<USE_OIDC>":"":o!=null?"<USE_OIDC>":i.startsWith("${")&&i.endsWith("}")?i.slice(2,-1).trim():""),shouldGeneratePublishWorkflow:o!=null?!0:void 0})},crates:n=>XA.FernGeneratorExec.GithubPublishInfo.crates({registryUrl:n.registryUrl,packageName:n.packageName,tokenEnvironmentVariable:(0,dL.EnvironmentVariable)(r?"":n.token??"")}),_other:()=>{}}):void 0}function qxs(e){if(e==="OIDC"||e==="<USE_OIDC>")return e}function MSt({generatorInvocation:e,customConfig:t,workspaceName:r,organization:n,outputVersion:i=hwg,absolutePathToSnippet:o,absolutePathToSnippetTemplates:s,absolutePathToFernConfig:a,writeUnitTests:c,generateOauthClients:l,generatePaginatedClients:u,whiteLabel:p,publishToRegistry:d,omitPublishCredentials:f,paths:m}){let g=gwg(e,a),{snippetPath:A,snippetTemplatePath:y,irPath:I,outputDirectory:C}=m,x=e.outputMode._visit({publish:B=>{if(d===!0){let D=ywg(B,f===!0);return{...b$u(i,D,m),snippetFilepath:A,publishingMetadata:e.publishMetadata}}return{...y$u(i,B,e,m),snippetFilepath:A,publishingMetadata:e.publishMetadata}},publishV2:B=>{if(d===!0){let D=bwg(B,f===!0);return{...b$u(i,D,m),snippetFilepath:A,publishingMetadata:e.publishMetadata}}return{...y$u(i,B,e,m),snippetFilepath:A,publishingMetadata:e.publishMetadata}},downloadFiles:()=>({mode:XA.FernGeneratorExec.OutputMode.downloadFiles(),path:C,snippetFilepath:A,publishingMetadata:e.publishMetadata}),github:B=>{let D={mode:XA.FernGeneratorExec.OutputMode.github({repoUrl:`https://github.com/${B.owner}/${B.repo}`,version:i,publishInfo:uyi(B.publishInfo,{omitPublishCredentials:f}),installationToken:void 0}),path:C,publishingMetadata:e.publishMetadata};return o!==void 0&&(D.snippetFilepath=A),s!==void 0&&(D.snippetTemplateFilepath=y),D},githubV2:B=>{let D=B._visit({commitAndRelease:O=>`https://github.com/${O.owner}/${O.repo}`,push:O=>`https://github.com/${O.owner}/${O.repo}`,pullRequest:O=>`https://github.com/${O.owner}/${O.repo}`,_other:()=>{throw new w({message:"Encountered unknown github mode",code:w.Code.InternalError})}}),R={mode:XA.FernGeneratorExec.OutputMode.github({repoUrl:D,version:i,publishInfo:uyi(B.publishInfo,{omitPublishCredentials:f})}),path:C,publishingMetadata:e.publishMetadata};return o!==void 0&&(R.snippetFilepath=A),s!==void 0&&(R.snippetTemplateFilepath=y),R},_other:()=>{throw new w({message:"Output type did not match any of the types supported by Fern",code:w.Code.InternalError})}}),S=Ewg(e,i);return{irFilepath:I,output:x,publish:S,customConfig:t,workspaceName:r,organization:n,environment:XA.FernGeneratorExec.GeneratorEnvironment.local(),dryRun:!1,whitelabel:p??!1,writeUnitTests:c,generateOauthClients:l,generatePaginatedClients:u,license:g}}function y$u(e,t,r,n){let{outputDirectory:i}=n,o;"registryOverrides"in t?o=t.registryOverrides.maven??t.registryOverrides.npm:o!=null&&(o=t._visit({mavenOverride:a=>a,npmOverride:a=>a,pypiOverride:a=>a,rubyGemsOverride:a=>a,postman:a=>a,nugetOverride:a=>a,cratesOverride:a=>a,_other:()=>{}}));let s="";return r.raw?.github!=null&&(QCe(r.raw.github)?s=Cx(r.raw.github.uri).repoUrl:s=r.raw?.github.repository),{mode:XA.FernGeneratorExec.OutputMode.github({repoUrl:s,version:e}),path:i}}function b$u(e,t,r){let{outputDirectory:n}=r,{registries:i,registriesV2:o}=Awg(t);return{mode:XA.FernGeneratorExec.OutputMode.publish({registries:i,registriesV2:o,publishTarget:t,version:e}),path:n}}function Awg(e){let t=structuredClone(I$u),r=structuredClone(v$u);if(e==null)return{registries:t,registriesV2:r};switch(e.type){case"npm":t.npm={registryUrl:e.registryUrl,token:e.token,scope:""},r.npm={registryUrl:e.registryUrl,token:e.token,packageName:e.packageName};break;case"maven":t.maven={registryUrl:e.registryUrl,username:e.username,password:e.password,group:"",signature:e.signature},r.maven={registryUrl:e.registryUrl,username:e.username,password:e.password,coordinate:e.coordinate,signature:e.signature};break;case"pypi":r.pypi={registryUrl:e.registryUrl,username:e.username,password:e.password,packageName:e.packageName,pypiMetadata:e.pypiMetadata};break;case"rubygems":r.rubygems={registryUrl:e.registryUrl,apiKey:e.apiKey,packageName:e.packageName};break;case"nuget":r.nuget={registryUrl:e.registryUrl,apiKey:e.apiKey,packageName:e.packageName};break;case"crates":r.crates={registryUrl:e.registryUrl,token:e.token,packageName:e.packageName};break;default:break}return{registries:t,registriesV2:r}}function ywg(e,t){if("registryOverrides"in e){let r=e.registryOverrides;if(r.npm!=null)return XA.FernGeneratorExec.GeneratorPublishTarget.npm({registryUrl:r.npm.registryUrl,token:t?"":r.npm.token,packageName:r.npm.packageName});if(r.maven!=null)return XA.FernGeneratorExec.GeneratorPublishTarget.maven({registryUrl:r.maven.registryUrl,username:t?"":r.maven.username??"",password:t?"":r.maven.password??"",coordinate:r.maven.coordinate??"",signature:void 0})}}function bwg(e,t){return e._visit({npmOverride:r=>r!=null?XA.FernGeneratorExec.GeneratorPublishTarget.npm({registryUrl:r.registryUrl,token:t?"":r.token,packageName:r.packageName}):void 0,mavenOverride:r=>r!=null?XA.FernGeneratorExec.GeneratorPublishTarget.maven({registryUrl:r.registryUrl,username:t?"":r.username,password:t?"":r.password,coordinate:r.coordinate,signature:t?void 0:r.signature??void 0}):void 0,pypiOverride:r=>r!=null?XA.FernGeneratorExec.GeneratorPublishTarget.pypi({registryUrl:r.registryUrl,username:t?"":r.username,password:t?"":r.password,packageName:r.coordinate,pypiMetadata:r.pypiMetadata??void 0}):void 0,rubyGemsOverride:r=>r!=null?XA.FernGeneratorExec.GeneratorPublishTarget.rubygems({registryUrl:r.registryUrl,apiKey:t?"":r.apiKey,packageName:r.packageName}):void 0,nugetOverride:r=>r!=null?XA.FernGeneratorExec.GeneratorPublishTarget.nuget({registryUrl:r.registryUrl,apiKey:t?"":r.apiKey,packageName:r.packageName}):void 0,cratesOverride:r=>r!=null?XA.FernGeneratorExec.GeneratorPublishTarget.crates({registryUrl:r.registryUrl,token:t?"":r.token,packageName:r.packageName}):void 0,postman:r=>XA.FernGeneratorExec.GeneratorPublishTarget.postman({apiKey:t?"":r.apiKey,workspaceId:t?"":r.workspaceId}),_other:()=>{}})}function Ewg(e,t){let r=e.outputMode._visit({publish:()=>{},publishV2:()=>{},downloadFiles:()=>{},github:o=>o.publishInfo,githubV2:o=>o._visit({push:s=>s.publishInfo,commitAndRelease:s=>s.publishInfo,pullRequest:s=>s.publishInfo,_other:()=>{}}),_other:()=>{}});if(r==null||r.type!=="pypi")return;let n=(r.credentials?.password??"").trim();if(n!=="OIDC"&&n!=="<USE_OIDC>")return;let i=structuredClone(v$u);return i.pypi={registryUrl:r.registryUrl,username:"__token__",password:"OIDC",packageName:r.packageName,pypiMetadata:r.pypiMetadata},{registries:structuredClone(I$u),registriesV2:i,publishTarget:void 0,version:t}}var I$u={maven:{registryUrl:"",username:"",password:"",group:"",signature:void 0},npm:{registryUrl:"",token:"",scope:""}},v$u={maven:{registryUrl:"",username:"",password:"",coordinate:"",signature:void 0},npm:{registryUrl:"",token:"",packageName:""},pypi:{registryUrl:"",username:"",password:"",packageName:"",pypiMetadata:void 0},rubygems:{registryUrl:"",apiKey:"",packageName:""},nuget:{registryUrl:"",apiKey:"",packageName:""},crates:{registryUrl:"",token:"",packageName:""}};It();var cep=Ae(aep(),1);Io();var lep=require("util"),aTg=(0,lep.promisify)(cep.default);async function dZt(e,t,r){let n=kDt(e,t),i=[];for(let o of n){let s=await Promise.all(o.map(async a=>{try{let c=await aTg(a);return c==null||c.height==null||c.width==null?void 0:{filePath:a,width:c.width,height:c.height,blurDataUrl:void 0}}catch(c){r.logger.error(`Failed to measure image size for ${a}. ${c?.message}`);return}}));i.push(...s.filter(ea))}return new Map(i.map(o=>[o.filePath,o]))}It();function mZt(e,t){if(Uh(e))return e;switch(t){case"github":return`https://github.com/${e}`;case"gitlab":return`https://gitlab.com/${e}`;case"bitbucket":return`https://bitbucket.org/${e}`;default:rt(t)}}function hZt(e){return e.language==="mcp"&&e.output?.delivery==="hosted"?{...e,output:{delivery:"zip"}}:e}function fSs(e){let t=e.sdkConfigPath==null?"":`; SDK Config: ${e.sdkConfigPath.join(".")}`;return`[${e.severity}] [${e.code}] ${e.path.join(".")}: ${e.reason}${t}; ${e.suggestedAction}`}function uep({workspace:e,generatorInvocation:t,audiences:r,replay:n,sourceArchive:i,mapFernGroupToSdkConfig:o}){let s=o({fernWorkspace:e,replay:n,group:{groupName:"sdk-gen-api",audiences:r,generators:[t],reviewers:void 0},source:cTg(i)}),a={...s.sdkConfig,targets:s.sdkConfig.targets.map(hZt)};return{payloadKind:"sdk-config-v1",body:Buffer.from(JSON.stringify(a),"utf8"),diagnostics:s.diagnostics}}function cTg(e){return{specs:e.specIndexes.map((r,n)=>{let i=e.manifest.specs[r];if(i==null)throw new Error(`Fern source manifest does not contain selected index ${r}`);if(!lTg(i))throw new Error(`SDK Config generation does not support Fern source type ${i.type} (${i.specPath})`);return{id:`source-${n}`,type:i.type,path:i.specPath.replace(/^\/+/,""),...i.namespace==null?{}:{namespace:i.namespace},...i.apiImportSettings==null?{}:{apiImportSettings:i.apiImportSettings},...i.overridePaths==null||i.overridePaths.length===0?{}:{overrides:i.overridePaths}}})}}function lTg(e){return e.type==="openapi"||e.type==="asyncapi"||e.type==="graphql"}yc();Uo();ef();It();lI();Mm();Ode();It();dy();cn();Io();function Jge({context:e,violations:t,logWarnings:r,logSummary:n=!0,logBreadcrumbs:i=!0,elapsedMillis:o=0}){let s=[],a={};for(let u of t){let p=JSON.stringify(u.nodePath),d=a[p]??[];d.some(m=>m.message===u.message&&m.nodePath.length===u.nodePath.length&&m.nodePath.every((g,A)=>ZL(g,u.nodePath[A]))&&m.relativeFilepath===u.relativeFilepath&&m.severity===u.severity)||(s.push(u),a[p]=[...d,u])}t=s;let c=gTg(t),l=uTg(t);for(let u of Array.from(l.keys()).sort()){let p=l.get(u);if(p){let d=p.violations[0]?.relativeFilepath??"";pTg({logWarnings:r,logBreadcrumbs:i,configRelativeFilepath:d,nodePath:p.nodePath,violations:p.violations,context:e})}}return n&&hTg({context:e,stats:c,logWarnings:r,elapsedMillis:o}),{hasErrors:c.numFatal>0}}function uTg(e){let t={};for(let r of e){let i=r.nodePath.length===0?`file:${r.relativeFilepath}`:`node:${JSON.stringify(r.nodePath)}`;t[i]||(t[i]={nodePath:r.nodePath,violations:[]}),t[i].violations.push(r)}return new Map(Object.entries(t))}function pTg({logWarnings:e,logBreadcrumbs:t,configRelativeFilepath:r,nodePath:n,violations:i,context:o}){let s=fTg(i);if(s==="warning"&&!e)return;let a="",c=i.map(l=>l.severity==="warning"&&!e?null:(a===""&&(a=l.relativeFilepath),`${mTg(l.severity)} ${l.message}`)).filter(l=>l!=null).join(`
|
|
4104
4105
|
`);o.logger.log(dTg(s),g5({breadcrumbs:t?[r,...n.map(l=>{let u=typeof l=="string"?l:l.key;return typeof l!="string"&&l.arrayIndex!=null&&(u+=`[${l.arrayIndex}]`),u})]:[],title:a,subtitle:c})+`
|
|
4105
4106
|
`)}function fTg(e){return e.some(t=>t.severity==="fatal")?"fatal":e.some(t=>t.severity==="error")?"error":"warning"}function dTg(e){switch(e){case"fatal":return Vn.Error;case"error":return Vn.Error;case"warning":return Vn.Warn;default:rt(e)}}function mTg(e){switch(e){case"fatal":return le.red("[error]");case"error":return le.red("[error]");case"warning":return le.yellow("[warning]");default:rt(e)}}function hTg({stats:e,context:t,logWarnings:r,elapsedMillis:n=0}){let{numFatal:i,numErrors:o,numWarnings:s}=e,a=n>0?` in ${(n/1e3).toFixed(3)} seconds.`:".",c=`Found ${i+o} errors and ${s} warnings`+a;!r&&s>0&&(c+=" Run fern check --warnings to print out the warnings not shown."),i+o>0?t.logger.error(c):s>0?t.logger.warn(c):t.logger.info(le.green("\u2713 All checks passed"))}function gTg(e){let t=0,r=0,n=0;for(let i of e)switch(i.severity){case"fatal":t+=1;continue;case"error":r+=1;continue;case"warning":n+=1;continue;default:rt(i.severity)}return{numFatal:t,numErrors:r,numWarnings:n}}Zn();tr();It();async function pep({groups:e,visitor:t,nodePath:r,cliVersion:n}){if(e!=null)for(let[i,o]of Object.entries(e))await ATg({group:o,visitor:t,nodePath:[...r,i],cliVersion:n})}async function ATg({group:e,visitor:t,nodePath:r,cliVersion:n}){await Promise.all(e.generators.map(async(i,o)=>await t.generatorInvocation?.({invocation:i,cliVersion:n},[...r,"generators",o.toString(),"image"in i?i.image.name:i.name])))}async function fep(e,t,r){await r.file?.(e,[]),await V_(e,{"auth-schemes":Ot,api:Ot,whitelabel:Ot,metadata:Ot,readme:Ot,"default-group":Ot,aliases:Ot,reviewers:Ot,openapi:Ot,"openapi-overrides":Ot,"spec-origin":Ot,"async-api":Ot,"api-settings":Ot,ai:Ot,autorelease:Ot,replay:Ot,automation:Ot,groups:async n=>{await pep({groups:n,visitor:r,nodePath:["groups"],cliVersion:t})}})}function dep({relativeFilepath:e,contents:t,allRuleVisitors:r,addViolations:n}){function i(o){let s=async(a,c)=>{for(let{name:l,visitors:u}of r){let p=u.generatorsYml?.[o];if(p!=null){let d=await p(a,{relativeFilepath:e,contents:t});n(d.map(f=>({name:l,severity:f.severity,relativeFilepath:e,nodePath:c,message:f.message})))}}};return{[o]:s}}return{...i("file"),...i("generatorInvocation")}}Zn();ef();It();Pde();Dt();function yTg(e,t,r){let n;try{n=cw(r,t)}catch(i){throw new w({message:`Failed to compare versions: ${oi(i)}`,code:w.Code.VersionError})}if(!n)return[{severity:"fatal",message:`The generator ${e} requires CLI version ${t} or later (current version: ${r}). Please run \`fern upgrade\` to upgrade your CLI version and use this generator.`}]}function bTg(e){return Number(e.replace("v",""))}var dSs={name:"compatible-ir-version",create:async()=>({generatorsYml:{generatorInvocation:async({invocation:e,cliVersion:t})=>{if(t==null||t==="0.0.0")return[];let r=Emr({token:void 0}),n=await r.generators.cli.getCliRelease(t);if(!n.ok)return[];let i=n.body.irVersion,o="image"in e?e.image.name:e.name,s;if(e["ir-version"]!=null)s=bTg(e["ir-version"]);else{let c={...e,name:Ym(o)},l=await LQe(c);if(l==null)return[];s=l}if(s<=i)return[];let a=await r.generators.cli.getMinCliForIr(s);return a.ok?yTg(o,a.body.version,t)??[]:[]}}})};Zn();var mSs={name:"no-direct-rubygems-publishing",checkOnly:!0,create:async()=>({generatorsYml:{generatorInvocation:async({invocation:e})=>zr.isDirectRubyGemsPublishing(e)?[{severity:"error",message:zr.DIRECT_RUBYGEMS_PUBLISHING_UNSUPPORTED_MESSAGE}]:[]}})};Zn();var hSs={name:"unsigned-maven-publishing",create:async()=>({generatorsYml:{generatorInvocation:async({invocation:e})=>{if(!zr.isUnsignedMavenPublishingWithoutUrl(e))return[];let t="image"in e?e.image.name:e.name;return[{severity:"warning",message:zr.getUnsignedMavenPublishingWithoutUrlMessage(t)}]}}})};var gSs={name:"valid-alias-group-references",create:async()=>({generatorsYml:{file:async e=>{let t=[],r=e.aliases,n=e.groups??{};if(r==null)return t;let i=new Set(Object.keys(n));for(let[o,s]of Object.entries(r))if(Array.isArray(s))for(let a of s)i.has(a)||t.push({severity:"error",message:`Alias "${o}" references unknown group "${a}". Available groups: ${[...i].join(", ")||"none"}`});return t}}})};function mep(){return[dSs,mSs,hSs,gSs]}async function _yi(e,t,{includeCheckOnlyRules:r=!1}={}){let n=mep().filter(i=>r||i.checkOnly!==!0);return ETg({workspace:e,rules:n,logger:t})}async function ETg({workspace:e,rules:t,logger:r}){let n=[],i=await Promise.all(t.map(async o=>({name:o.name,visitors:await o.create({workspace:e,logger:r})})));if(e.generatorsConfiguration?.rawConfiguration){let o=await ITg({contents:e.generatorsConfiguration.rawConfiguration,allRuleVisitors:i,cliVersion:e.cliVersion});n.push(...o)}return n}async function ITg({contents:e,allRuleVisitors:t,cliVersion:r}){let n=[],i=dep({relativeFilepath:be.of(pl),contents:e,allRuleVisitors:t,addViolations:o=>{n.push(...o)}});return await fep(e,r,i),n}Dt();var ASs=Ae(gep(),1);async function ySs({workspace:e,context:t,ossWorkspace:r}){(0,ASs.default)(e.definition.rootApiFile.contents.name).validForNewPackages||t.failAndThrow("API name is not valid.",void 0,{code:w.Code.ValidationError});let n=performance.now(),i=b4e(e,t.logger),o=await _yi(e,t.logger,{includeCheckOnlyRules:!0}),s=[...i,...o];r&&s.push(...await _xe(r,t));let a=performance.now()-n,c=s.some(l=>l.severity==="fatal"||l.severity==="error");return{apiName:e.definition.rootApiFile.contents.name,violations:s,elapsedMillis:a,hasErrors:c}}async function Aep({workspace:e,context:t,logWarnings:r,logSummary:n=!0,ossWorkspace:i}){let o=performance.now(),s=b4e(e,t.logger),a=await _yi(e,t.logger),c=[...s,...a];i&&c.push(...await _xe(i,t));let l=performance.now()-o,{hasErrors:u}=Jge({violations:c,context:t,logWarnings:r,logSummary:n,elapsedMillis:l});return{hasErrors:u}}async function GJ({workspace:e,context:t,logWarnings:r,ossWorkspace:n}){(0,ASs.default)(e.definition.rootApiFile.contents.name).validForNewPackages||t.failAndThrow("API name is not valid.",void 0,{code:w.Code.ValidationError});let{hasErrors:i}=await Aep({workspace:e,context:t,logWarnings:r,ossWorkspace:n});i&&t.failAndThrow(void 0,void 0,{code:w.Code.ValidationError})}lI();tr();tc();fd();Nhe();Dt();cQ();cn();var kpp=require("crypto"),KZt=require("fs/promises");Io();var HZt=Ae(rpe(),1),zTs=require("path");It();is();var Pep=Ae(ly(),1),$t=T.string().min(1),Sae=$t.refine(e=>!/^(?:[\\/]|[A-Za-z]:)/.test(e)&&!e.split(/[\\/]/).some(t=>t===".."),{message:"must be a relative path without parent directory segments"}),vSs=$t.refine(e=>!/^(?:[\\/]|[A-Za-z]:)/.test(e),{message:"must be a relative path"}),Bep=T.string().refine(e=>e.trim()!==e||!/^\d/.test(e)?!1:Pep.default.parse(e,{loose:!1})?.raw===e,{message:"must be an exact semantic version"}),AZt=T.lazy(()=>T.union([T.null(),T.boolean(),T.number(),T.string(),T.array(AZt),T.record(T.string(),AZt)])),_St=T.record(T.string(),AZt),Dep=T.enum(["sha1","sha256","sha384","sha512"]),Rep=T.enum(["base64","hex"]),wTg=T.enum(["body","timestamp","notification-url","message-id"]),TTg=T.strictObject({components:T.array(wTg).min(1).describe("Payload components concatenated in declaration order before signing."),delimiter:T.string().optional().describe("The delimiter inserted between payload components."),bodySort:T.literal("alphabetical").optional().describe("Canonicalizes form body keys and values alphabetically before signing.")}),OTg=T.strictObject({header:$t.describe("The request header containing the signing timestamp."),format:T.enum(["unix-seconds","unix-millis","iso8601"]).optional().describe("The timestamp format used in the signature payload."),tolerance:T.number().positive().optional().describe("The maximum accepted timestamp age, in seconds.")}),PTg=T.discriminatedUnion("type",[T.strictObject({type:T.literal("query-parameter").describe("Reads the body hash from a query parameter."),name:$t.describe("The query parameter containing the body hash.")})]),BTg=T.strictObject({algorithm:Dep.describe("The hash algorithm applied to the raw request body."),encoding:Rep.optional().describe("The encoding used for the body hash."),location:PTg.describe("Where the expected body hash is read from.")}),DTg=T.strictObject({portVariants:T.boolean().optional().describe("Whether verification tries URLs with and without an explicit default port."),legacyQueryEncoding:T.boolean().optional().describe("Whether verification also tries legacy form-style query encoding.")}).refine(({portVariants:e,legacyQueryEncoding:t})=>e===!0||t===!0,{message:"url normalization must enable at least one variant"}),RTg=T.discriminatedUnion("type",[T.strictObject({type:T.literal("hmac").describe("Identifies HMAC webhook signature verification."),header:$t.describe("The request header containing the signature."),algorithm:Dep.optional().describe("The HMAC hash algorithm."),encoding:Rep.optional().describe("The encoding used for the HMAC signature."),signaturePrefix:T.string().optional().describe("A prefix removed from the signature header before comparison."),payloadFormat:TTg.optional().describe("How the payload signed by the provider is assembled."),timestamp:OTg.optional().describe("Timestamp validation included in signature verification."),bodyHashBinding:BTg.optional().describe("A separately transmitted hash that binds the raw body to the signed payload."),urlNormalization:DTg.optional().describe("Alternate notification URL forms accepted during verification.")})]),qyi=T.strictObject({name:$t.optional().describe("The parameter name exposed by the SDK."),environmentVariable:$t.optional().describe("The environment variable used to populate the parameter."),description:T.string().optional().describe("A description of the authentication parameter included in generated SDK documentation."),omit:T.boolean().optional().describe("Whether the parameter is omitted from the SDK surface.")}),kTg=T.strictObject({id:$t.describe("A unique identifier for this authentication scheme."),type:T.literal("api-key").describe("Identifies an API key authentication scheme."),location:T.enum(["header","query","cookie"]).describe("Where the API key is sent on requests."),name:$t.describe("The header, query parameter, or cookie name."),prefix:$t.optional().describe("A prefix added before the API key value."),environmentVariable:$t.optional().describe("The default environment variable for the API key."),description:T.string().optional().describe("A description of the authentication scheme included in generated SDK documentation.")}),FTg=T.strictObject({id:$t.describe("A unique identifier for this authentication scheme."),type:T.literal("bearer").describe("Identifies a bearer token authentication scheme."),header:$t.optional().describe("The request header that carries the bearer token."),prefix:$t.optional().describe('The token prefix, such as "Bearer".'),environmentVariable:$t.optional().describe("The default environment variable for the bearer token."),description:T.string().optional().describe("A description of the authentication scheme included in generated SDK documentation.")}),NTg=T.strictObject({id:$t.describe("A unique identifier for this authentication scheme."),type:T.literal("basic").describe("Identifies an HTTP Basic authentication scheme."),username:qyi.optional().describe("The username parameter exposed by the SDK."),password:qyi.optional().describe("The password parameter exposed by the SDK."),description:T.string().optional().describe("A description of the authentication scheme included in generated SDK documentation.")}),Uyi=T.strictObject({name:$t.describe("The OAuth scope value requested from the provider."),description:T.string().optional().describe("A description of the OAuth scope included in generated SDK documentation.")}),jTg=$t.refine(e=>e.trim()===e,{message:"must not have leading or trailing whitespace"}).refine(e=>!e.includes("${"),{message:"must be a literal public client ID, not an environment expression"}),zTg=T.discriminatedUnion("type",[T.strictObject({type:T.literal("authorization-code").describe("Uses the OAuth authorization code flow."),authorizationUrl:$t.describe("The URL used to authorize the client."),tokenUrl:$t.describe("The URL used to exchange a code for tokens."),refreshUrl:$t.optional().describe("The URL used to refresh access tokens."),scopes:T.array(Uyi).optional().describe("The scopes supported by this flow."),clientId:jTg.optional().describe("The public, non-secret OAuth client ID that generated interactive login flows, such as CLI browser login with PKCE, send to the authorization and token endpoints. It is embedded verbatim in generated code, so it must never be a client secret.")}),T.strictObject({type:T.literal("client-credentials").describe("Uses the OAuth client credentials flow."),tokenUrl:$t.describe("The URL used to obtain access tokens."),refreshUrl:$t.optional().describe("The URL used to refresh access tokens."),scopes:T.array(Uyi).optional().describe("The scopes supported by this flow.")}),T.strictObject({type:T.literal("implicit").describe("Uses the OAuth implicit flow."),authorizationUrl:$t.describe("The URL used to authorize the client."),refreshUrl:$t.optional().describe("The URL used to refresh access tokens."),scopes:T.array(Uyi).optional().describe("The scopes supported by this flow.")}),T.strictObject({type:T.literal("password").describe("Uses the OAuth resource owner password flow."),tokenUrl:$t.describe("The URL used to obtain access tokens."),refreshUrl:$t.optional().describe("The URL used to refresh access tokens."),scopes:T.array(Uyi).optional().describe("The scopes supported by this flow.")})]),QTg=T.strictObject({id:$t.describe("A unique identifier for this authentication scheme."),type:T.literal("oauth2").describe("Identifies an OAuth 2.0 authentication scheme."),flows:T.array(zTg).min(1).describe("The OAuth flows supported by the API."),clientId:qyi.optional().describe("The OAuth client ID parameter exposed by the SDK."),clientSecret:qyi.optional().describe("The OAuth client secret parameter exposed by the SDK."),tokenHeader:$t.optional().describe("The request header that carries the OAuth access token."),tokenPrefix:$t.optional().describe("The prefix added before the OAuth access token."),refreshBufferSeconds:T.number().nonnegative().optional().describe("How early, in seconds, the client refreshes a token before it expires."),description:T.string().optional().describe("A description of the authentication scheme included in generated SDK documentation.")}),MTg=T.strictObject({location:T.enum(["header","query","cookie"]).describe("Where the custom authentication value is sent."),name:$t.describe("The header, query parameter, or cookie name."),prefix:$t.optional().describe("A prefix added before the parameter value."),environmentVariable:$t.optional().describe("The default environment variable for the parameter.")}),LTg=T.strictObject({id:$t.describe("A unique identifier for this authentication scheme."),type:T.literal("custom").describe("Identifies a custom authentication scheme."),parameters:T.array(MTg).min(1).describe("The request parameters that implement the custom scheme."),description:T.string().optional().describe("A description of the authentication scheme included in generated SDK documentation.")}),_Tg=T.discriminatedUnion("type",[kTg,FTg,NTg,QTg,LTg]),UTg=T.strictObject({schemes:T.array($t).min(1).describe("Scheme identifiers that must be satisfied together.")}),VTg=T.strictObject({schemes:T.array(_Tg).min(1).describe("Authentication schemes offered by the API."),requirements:T.array(UTg).optional().describe("Valid combinations of authentication schemes."),endpointSecurity:T.boolean().optional().describe("Whether generated endpoints expose their individual security requirements.")}).superRefine(({requirements:e,schemes:t},r)=>{let n=new Set;t.forEach(({id:i},o)=>{n.has(i)&&r.addIssue({code:"custom",message:`auth scheme id "${i}" must be unique`,path:["schemes",o,"id"]}),n.add(i)}),e?.forEach((i,o)=>{i.schemes.forEach((s,a)=>{n.has(s)||r.addIssue({code:"custom",message:`auth requirement references unknown scheme "${s}"`,path:["requirements",o,"schemes",a]})})})}),GTg=T.strictObject({name:$t.describe("The display name for this environment URL."),url:$t.describe("The base URL used for this environment entry."),serverName:$t.optional().describe("The source server represented by this URL.")}),qTg=T.strictObject({name:$t.describe("The environment name exposed by the SDK."),urls:T.array(GTg).min(1).describe("The base URLs available in this environment."),description:T.string().optional().describe("A description of the environment included in generated SDK documentation.")}),WTg=T.strictObject({name:$t.describe("The HTTP header name."),value:T.string().optional().describe("A fixed value for the generated header."),description:T.string().optional().describe("A description of the header included in generated SDK documentation."),environmentVariable:$t.optional().describe("The environment variable used to populate the header.")}),HTg=T.strictObject({name:$t.describe("The environment variable name exposed by the SDK."),description:T.string().optional().describe("A description of the environment variable included in generated SDK documentation."),defaultValue:T.string().optional().describe("The default value used when the variable is unset.")}),kep=T.strictObject({baseUrl:T.string().default("").describe("The default base URL used by the generated client."),environments:T.array(qTg).default([]).describe("Named API environments and their base URLs."),environmentVariables:T.array(HTg).default([]).describe("Environment variables exposed through generated client configuration."),defaultEnvironment:$t.optional().describe("The environment selected when a caller does not choose one."),auth:VTg.optional().describe("Authentication supported by the API."),headers:T.array(WTg).optional().describe("Headers added to generated API requests."),audiences:T.array($t).optional().describe("Named API audiences included in the generated SDK."),webhookSignature:RTg.optional().describe("How generated helpers verify webhook signatures from the API.")});var KTg=kep;var Fep={enabled:T.boolean().optional().describe("Whether the generated client retries failed requests."),maxAttempts:T.number().int().min(1).optional().describe("The maximum total request attempts, including the initial attempt."),retryDelayMs:T.number().nonnegative().optional().describe("The initial delay between retry attempts, in milliseconds."),maxDelayMs:T.number().nonnegative().optional().describe("The maximum backoff delay between attempts, in milliseconds."),jitterMs:T.number().nonnegative().optional().describe("The maximum random jitter added to retry delays, in milliseconds."),backoffFactor:T.number().positive().optional().describe("The multiplier applied to the delay after each failed attempt."),statusCodes:T.array(T.number().int().min(100).max(599)).optional().describe("HTTP status codes that are eligible for retries."),methods:T.array($t).optional().describe("HTTP methods that are eligible for retries."),statusCodeProfile:T.enum(["legacy","recommended"]).optional().describe("The built-in retryable status-code policy."),maxRetryAfterDelayMs:T.number().nonnegative().optional().describe("The longest Retry-After delay the client will honor, in milliseconds.")};function Nep({maxDelayMs:e,retryDelayMs:t},r){e!==void 0&&t!==void 0&&e<t&&r.addIssue({code:"custom",message:"maxDelayMs must be greater than or equal to retryDelayMs",path:["maxDelayMs"]})}var JTg=T.strictObject(Fep).superRefine(Nep),YTg=T.strictObject({...Fep,enabled:T.boolean().default(!0).describe("Whether the generated client retries failed requests."),maxAttempts:T.number().int().min(1).default(3).describe("The maximum total request attempts, including the initial attempt."),retryDelayMs:T.number().nonnegative().default(150).describe("The initial delay between retry attempts, in milliseconds."),maxDelayMs:T.number().nonnegative().default(5e3).describe("The maximum backoff delay between attempts, in milliseconds."),jitterMs:T.number().nonnegative().default(50).describe("The maximum random jitter added to retry delays, in milliseconds."),backoffFactor:T.number().positive().default(2).describe("The multiplier applied to the delay after each failed attempt."),methods:T.array($t).default(["GET","PUT","DELETE","HEAD","OPTIONS"]).describe("HTTP methods that are eligible for retries."),maxRetryAfterDelayMs:T.number().nonnegative().default(6e4).describe("The longest Retry-After delay the client will honor, in milliseconds.")}).superRefine(Nep),jep=T.strictObject({name:$t.describe("The parameter name in the generated client constructor."),example:T.string().optional().describe("An example value shown in generated documentation."),description:T.string().optional().describe("A description of the constructor parameter included in generated SDK documentation."),required:T.boolean().optional().describe("Whether callers must provide the parameter.")}),bSs=T.enum(["wrapped","inline","language-default"]),XTg=T.strictObject({enabled:T.boolean().describe("Whether the client can exchange refresh tokens."),endpoint:$t.optional().describe("The API endpoint used to refresh tokens."),accessTokenField:$t.optional().describe("The response field containing the refreshed access token."),refreshTokenField:$t.optional().describe("The response field containing the refreshed refresh token.")}).superRefine(({enabled:e,endpoint:t},r)=>{e&&t===void 0&&r.addIssue({code:"custom",message:"endpoint is required when tokenRefresh is enabled",path:["endpoint"]})}),ZTg=T.strictObject({enabled:T.boolean().describe("Whether the client generates an idempotency key when the caller supplies none."),headerName:$t.optional().describe("The header that carries the generated key. Generators default to Idempotency-Key."),methods:T.array($t).optional().describe("HTTP methods that receive a generated key. Generators default to POST and PUT.")}),$Tg=T.strictObject({template:$t.optional().describe("The User-Agent product token, resolved at generation time. Supports the {packageName}, {version}, {language}, {generatorVersion}, {organization}, and {apiName} placeholders."),includePlatformInfo:T.boolean().optional().describe("Whether the User-Agent carries operating system, architecture, and runtime details, as `{product} ({os}; {arch}) {runtime}/{runtimeVersion}`."),allowAppInfo:T.boolean().optional().describe("Whether callers can pass application info that is appended to the User-Agent as a `{name}/{version} ({comment})` product token.")}),zep={retry:JTg.optional().describe("Retry behavior for generated API requests."),responseHeaders:T.boolean().optional().describe("Whether generated operations expose HTTP response headers."),responseValidation:T.boolean().optional().describe("Whether the client validates API responses against the schema."),multiTenant:T.boolean().optional().describe("Whether the client exposes configuration for tenant-specific API access."),additionalConstructorParameters:T.array(jep).optional().describe("Additional parameters added to the generated client constructor."),timeoutMs:T.union([T.number().nonnegative(),T.literal("infinity")]).optional().describe('The default request timeout in milliseconds, or "infinity" for no timeout.'),requestParameterStyle:bSs.optional().describe("Whether generated operation parameters are wrapped or passed inline."),pathParameterStyle:bSs.optional().describe("Whether generated path parameters are wrapped or passed inline."),filePropertyStyle:bSs.optional().describe("Whether generated file properties are wrapped or passed inline."),useDefaultRequestParameterValues:T.boolean().optional().describe("Whether schema defaults are applied to omitted request parameters."),respectOptionalRequestBody:T.boolean().optional().describe("Whether an optional request body remains optional in generated methods."),tokenRefresh:XTg.optional().describe("Refresh-token behavior for the generated client."),idempotencyKeyGeneration:ZTg.optional().describe("Automatic idempotency keys on eligible requests."),userAgent:$Tg.optional().describe("The User-Agent header the generated client sends."),offsetSemantics:T.enum(["item-index","page-index"]).optional().describe("How an offset-paginated endpoint advances: by the number of items returned, or by one page.")},eOg=T.strictObject(zep),Qep=T.strictObject({...zep,retry:YTg.prefault({}).describe("Retry behavior for generated API requests."),responseHeaders:T.boolean().default(!1).describe("Whether generated operations expose HTTP response headers."),multiTenant:T.boolean().default(!1).describe("Whether the client exposes configuration for tenant-specific API access."),additionalConstructorParameters:T.array(jep).default([]).describe("Additional parameters added to the generated client constructor.")}),tOg=Qep,rOg=eOg,Mep=Sae.regex(/^(?!.*(?:^|\/)\.{1,2}(?:\/|$))[A-Za-z0-9._~-]+(?:\/[A-Za-z0-9._~-]+)*$/,"Go module path must use letters, numbers, dots, dashes, underscores or tildes, in slash-delimited segments"),Lep=$t.regex(/^[a-z0-9]([_.-]?[a-z0-9]+)*\/[a-z0-9](([_.]?|-{0,2})[a-z0-9]+)*$/,'Composer package name must be a lowercase "vendor/package" name'),nOg=T.strictObject({name:$t.describe("The package author name."),email:T.email().optional().describe("The package author email address."),url:$t.optional().describe("The package author website.")}),iOg=T.strictObject({name:$t.describe("The package developer name."),email:T.email().optional().describe("The package developer email address."),organization:$t.optional().describe("The developer organization name."),organizationUrl:$t.optional().describe("The developer organization website.")}),oOg=T.strictObject({type:$t.describe("The license identifier or license type."),name:$t.optional().describe("The human-readable license name."),url:$t.optional().describe("The URL containing the license text."),path:$t.optional().describe("The path to a custom license file.")}),sOg=T.discriminatedUnion("type",[T.strictObject({type:T.literal("registry").describe("Resolves the dependency from a package registry."),registry:$t.optional().describe("The registry used to resolve the dependency.")}),T.strictObject({type:T.literal("git").describe("Resolves the dependency from a Git repository."),url:$t.describe("The Git repository URL."),ref:$t.optional().describe("The Git branch, tag, or commit to use."),subdirectory:$t.optional().describe("The package subdirectory within the Git repository.")}),T.strictObject({type:T.literal("path").describe("Resolves the dependency from a local path."),path:$t.describe("The local path containing the dependency.")})]),ESs=T.strictObject({name:$t.describe("The dependency name used by the package manager."),version:$t.optional().describe("The dependency version requirement."),source:sOg.optional().describe("A non-default source for the dependency."),packageName:$t.optional().describe("The source package name when it differs from the dependency alias."),features:T.array($t).optional().describe("Cargo features enabled for this dependency."),extras:T.array($t).optional().describe("Python extras enabled for this dependency."),optional:T.boolean().optional().describe("Whether the dependency is optional."),defaultFeatures:T.boolean().optional().describe("Whether the dependency enables its default Cargo features."),environmentMarker:$t.optional().describe("A Python environment marker that conditions this dependency.")}).refine(({source:e,version:t})=>e!==void 0||t!==void 0,{message:"dependency must define a version or a source"}),aOg=T.strictObject({url:$t.optional().describe("The issue tracker URL."),email:$t.optional().describe("The address for reporting issues.")}).refine(({url:e,email:t})=>e!==void 0||t!==void 0,{message:"bugs must define a url or an email"}),cOg=T.strictObject({label:$t.describe("The label displayed for the project link."),url:$t.describe("The project link URL.")}),_ep=T.strictObject({packageName:$t.optional().describe("The package name used by the target language registry."),moduleName:$t.optional().describe("The generated module or import name when it differs from the package name."),modulePath:Mep.optional().describe("The Go module path used for imports and publishing."),namespace:$t.optional().describe("The namespace or package prefix for generated code."),groupId:$t.optional().describe("The Maven group identifier."),artifactId:$t.optional().describe("The Maven artifact identifier."),description:T.string().optional().describe("The package description used in generated metadata."),repository:$t.optional().describe("The source repository for the generated SDK."),homepage:$t.optional().describe("The package homepage URL."),bugs:aOg.optional().describe("Where issues with the package are reported."),documentationUrl:$t.optional().describe("The package documentation URL."),authors:T.array(nOg).optional().describe("Authors credited in package metadata."),developers:T.array(iOg).optional().describe("Developers credited in package metadata."),license:oOg.optional().describe("License metadata for the generated package."),keywords:T.array($t).optional().describe("Search keywords for package metadata."),classifiers:T.array($t).optional().describe("Package classifiers used by registries such as PyPI."),projectUrls:T.array(cOg).optional().describe("Labeled project links for package metadata."),extraDependencies:T.array(ESs).optional().describe("Additional runtime dependencies added to the generated package."),extraDevDependencies:T.array(ESs).optional().describe("Additional development dependencies added to the generated package."),extraPeerDependencies:T.array(ESs).optional().describe("Additional peer dependencies added to the generated package."),extraPeerDependenciesMeta:T.record($t,_St).optional().describe("npm peerDependenciesMeta entries keyed by peer dependency name, such as { optional: true }.")}),lOg=/^[A-Z][A-Z0-9_]*$/,uOg=/^[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+$/,pOg=/^[a-z][a-z0-9-]*$/,Wyi=T.string({error:"must be the name of a GitHub Actions secret"}).regex(lOg,{error:"must be the name of a GitHub Actions secret: start with an uppercase letter and contain only A-Z, 0-9, or _. Secret values and ${...} expressions are not accepted."}).refine(e=>e!=="GITHUB_TOKEN",{error:"GITHUB_TOKEN cannot be used: it is the workflow's built-in token, scoped to the generated repository. Store the credential under a different secret name."}),Uep=T.string({error:'must be a GitHub repository in "<owner>/<repo>" form'}).regex(uOg,{error:'must be a GitHub repository in "<owner>/<repo>" form, for example "acme/homebrew-tap"'}),fOg=T.string({error:"must be a Homebrew formula name"}).regex(pOg,{error:"must be a Homebrew formula name: start with a lowercase letter and contain only a-z, 0-9, or -"}),dOg=T.strictObject({appIdSecretName:Wyi.describe("The name of the GitHub Actions secret holding the GitHub App ID or client ID."),privateKeySecretName:Wyi.describe("The name of the GitHub Actions secret holding the GitHub App private key in PEM form.")}),Vep="The name of the GitHub Actions secret holding a token with write access to the channel repository. Takes precedence over githubApp for this channel.",mOg=T.strictObject({tap:Uep.describe('The Homebrew tap repository in "<owner>/<repo>" form that receives the formula.'),formula:fOg.optional().describe("The Homebrew formula name; the generator defaults it to the CLI binary name."),tokenSecretName:Wyi.optional().describe(Vep)}),hOg=T.strictObject({bucket:Uep.describe('The Scoop bucket repository in "<owner>/<repo>" form that receives the manifest.'),tokenSecretName:Wyi.optional().describe(Vep)}),Gep=T.strictObject({githubApp:dOg.optional().describe("A GitHub App used to mint short-lived tokens for every channel without its own tokenSecretName."),homebrew:mOg.optional().describe("Publishes a Homebrew formula to a tap repository on each tagged release."),scoop:hOg.optional().describe("Publishes a Scoop manifest to a bucket repository on each tagged release."),githubAttestations:T.union([T.literal("auto"),T.boolean()],{error:'must be "auto", true, or false'}).optional().describe('Whether the generated release workflow attests build provenance. "auto" (the generator default) attests only on public repositories; true always attests, for private repositories on GitHub Enterprise Cloud; false omits the attestation step and its permissions.')}).superRefine((e,t)=>{if(!(e.homebrew!==void 0||e.scoop!==void 0)){if(e.githubApp!==void 0){t.addIssue({code:"custom",message:"githubApp requires at least one distribution channel: homebrew or scoop",path:["githubApp"]});return}e.githubAttestations===void 0&&t.addIssue({code:"custom",message:"distribution must configure at least one channel: homebrew or scoop"})}}),qep='distribution requires output.delivery "github": Homebrew and Scoop publish from a tagged GitHub Release produced by the generated release workflow. Set delivery to "github" or remove distribution.',Wep='package publication for target language "cli" requires output.delivery "github": the CLI generator publishes npm packages only from its generated GitHub workflow.';var gOg=T.enum(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","TRACE","CONNECT"]),yep=T.strictObject({method:gOg.describe("The HTTP method of the documented endpoint."),path:$t.describe("The endpoint path used in generated examples."),stream:T.boolean().optional().describe("Whether the example uses the streaming response API.")}),AOg=T.strictObject({title:$t.describe("The heading displayed for this README section."),content:T.string().describe("The Markdown content of this README section.")}),yOg=T.strictObject({apiName:$t.optional().describe("The API name displayed in the README."),introduction:T.string().optional().describe("Custom introductory Markdown for the README."),apiReferenceLink:$t.optional().describe("The URL linked as the API reference."),bannerLink:$t.optional().describe("The destination URL for the README banner."),disabledSections:T.array($t).optional().describe("Generated README sections to omit."),customSections:T.array(AOg).optional().describe("Additional sections inserted into the README."),defaultEndpoint:yep.optional().describe("The endpoint used for the primary README example."),features:T.record(T.string(),T.array(yep)).optional().describe("Named feature groups and the endpoints demonstrated by each group.")}),bOg=T.strictObject({enabled:T.boolean().describe("Whether standalone usage snippets are generated."),format:T.enum(["md","json"]).optional().describe("The output format for generated snippets."),outputPath:$t.optional().describe("The output path for generated snippet files.")}),Hep=T.strictObject({readme:yOg.optional().describe("README content and example configuration."),snippets:bOg.optional().describe("Standalone usage snippet generation."),referenceBaseUrl:$t.optional().describe("The base URL used for links to generated API reference files."),includeApiReference:T.boolean().optional().describe("Whether API reference documentation is included in the SDK output.")});var Kep=Hep;var EOg=/[A-Za-z0-9]/,IOg=/^[a-z][a-z0-9_-]*$/,Jep=/^[a-z][a-z0-9-]*$/,vOg=/^[a-z0-9-]+(?:\.[a-z0-9-]+)+$/,bep=/^[A-Za-z0-9_.-]+$/,COg=new Set(["params","output","json","format","dry-run","base-url","page-all","page-limit","page-delay","no-pager","no-extract","no-retry","no-stream","quiet","query","help","debug","schema"]),xOg=new Set(["auth","completion","man","errors","generate-skills","help"]),SOg=$t.regex(EOg,{message:"binaryName must contain at least one ASCII letter or digit"}),wOg=T.string().regex(IOg,{message:"rootGroup must start with a lowercase letter and contain only lowercase letters, digits, hyphens, and underscores"}),TOg=T.string().superRefine((e,t)=>{e.startsWith("-")?t.addIssue({code:"custom",message:'userAgentSuffixFlag must be the long flag name without the leading "--"'}):Jep.test(e)?COg.has(e)&&t.addIssue({code:"custom",message:`userAgentSuffixFlag "${e}" collides with a built-in global flag`}):t.addIssue({code:"custom",message:"userAgentSuffixFlag must start with a lowercase letter and contain only lowercase letters, digits, and hyphens"})}),OOg=T.string().superRefine((e,t)=>{Jep.test(e)?xOg.has(e)&&t.addIssue({code:"custom",message:`profiles.commandName "${e}" collides with a built-in command group`}):t.addIssue({code:"custom",message:"profiles.commandName must start with a lowercase letter and contain only lowercase letters, digits, and hyphens"})});function Yep(e){return T.string().regex(vOg,{message:`${e} must be a dotted command path such as "iam.keys.create"`})}function Eep(e){let t=`${e} keys and values must be field names containing only [A-Za-z0-9_.-]`;return T.record(T.string(),T.string().regex(bep,{message:t})).superRefine((r,n)=>{for(let i of Object.keys(r))bep.test(i)||n.addIssue({code:"custom",message:t,path:[i]})})}var POg=T.strictObject({operation:Yep("profiles.provisionOperation.operation").describe("The dotted command path of the operation that mints a profile credential."),credential:Eep("profiles.provisionOperation.credential").refine(e=>Object.keys(e).length>0,{message:"profiles.provisionOperation.credential must map at least one credential field"}).describe("Maps each stored credential field to the response field that supplies it."),revokeParameters:Eep("profiles.provisionOperation.revokeParameters").optional().describe("Maps each revoke-operation parameter to the response field that supplies it.")}),BOg=T.strictObject({enabled:T.boolean().describe("Whether the CLI emits profile commands and the global --profile flag."),commandName:OOg.optional().describe('The profile command group name. The generator defaults to "profiles".'),revokeOperation:Yep("profiles.revokeOperation").optional().describe('The dotted command path called by "profiles remove --revoke".'),provisionOperation:POg.optional().describe('The operation called by "profiles create --provision" and its response mapping.')}),Xep=T.strictObject({paginationParameters:T.array($t).optional().describe("Request parameter names treated as pagination controls by the CLI."),skills:T.boolean().optional().describe("Whether the generated CLI includes skills that teach AI agents to invoke commands."),binaryName:SOg.optional().describe("The CLI executable name. The generator kebab-cases it and also uses it for the source directory and env-var prefix."),customCommands:T.boolean().optional().describe("Whether hand-written command support is generated. The generator defaults to true."),rootGroup:wOg.optional().describe("A command group that every spec-derived command is nested under."),profiles:BOg.optional().describe("Named profile command configuration."),splitTypeCrates:T.boolean().optional().describe("Whether generated types are split into one crate per API behind a facade crate."),userAgentSuffixFlag:TOg.optional().describe('The long flag name, without "--", that appends a product token to the User-Agent.')});var Zep=_ep,riO=T.email();var LSt=Symbol("omit");function $ep(e){return T.toJSONSchema(e,{io:"input",unrepresentable:"any"})}function DOg(e,t){let r=Gyi(e,t,t,!0);return r===LSt?void 0:r}function Gyi(e,t,r,n){let i=CSs(t,r);if(n&&Object.hasOwn(i,"default")&&LGe(e,i.default))return LSt;let o=kOg(e,i,r);if(n&&o!==i&&Object.hasOwn(o,"default")&&LGe(e,o.default))return LSt;if(Array.isArray(e))return o.items?e.map(l=>{let u=Gyi(l,o.items,r,n);return u===LSt?l:u}):e;if(!Hyi(e)||o.type!=="object")return e;let s=[],a=o.properties??{},c=n?a:ROg(i,r);for(let[l,u]of Object.entries(a)){if(!Object.hasOwn(e,l))continue;let p=Gyi(e[l],u,r,n);p!==LSt&&s.push([l,p])}for(let[l,u]of Object.entries(e))if(!Object.hasOwn(a,l)){if(Object.hasOwn(c,l)){s.push([l,u]);continue}if(o.additionalProperties!==!1){let p=typeof o.additionalProperties=="object"?Gyi(u,o.additionalProperties,r,n):u;p!==LSt&&s.push([l,p])}else if(n)throw new Error(`Cannot serialize property unknown to the wire schema: ${l}`)}return Object.fromEntries(s)}function ROg(e,t){let r=e.oneOf??e.anyOf;return r?Object.assign({},...r.map(n=>CSs(n,t).properties??{})):e.properties??{}}function kOg(e,t,r){let n=t.oneOf??t.anyOf;if(!n||n.length===0)return t;let i=n.map((o,s)=>{let a=CSs(o,r);return{index:s,schema:a,score:FOg(e,a)}}).sort((o,s)=>s.score-o.score||o.index-s.index)[0];return i.score===Number.NEGATIVE_INFINITY?t:i.schema}function FOg(e,t){if(Object.hasOwn(t,"const")&&!LGe(e,t.const)||t.enum&&!t.enum.some(r=>LGe(e,r)))return Number.NEGATIVE_INFINITY;if(t.type==="object"){if(!Hyi(e))return Number.NEGATIVE_INFINITY;let r=t.properties??{};for(let[n,i]of Object.entries(r))if(Object.hasOwn(e,n)&&Object.hasOwn(i,"const")&&!LGe(e[n],i.const))return Number.NEGATIVE_INFINITY;return Object.keys(e).filter(n=>Object.hasOwn(r,n)).length}return t.type==="array"?Array.isArray(e)?1:Number.NEGATIVE_INFINITY:t.type==="string"?typeof e=="string"?1:Number.NEGATIVE_INFINITY:t.type==="number"||t.type==="integer"?typeof e=="number"?1:Number.NEGATIVE_INFINITY:t.type==="boolean"?typeof e=="boolean"?1:Number.NEGATIVE_INFINITY:t.type==="null"?e===null?1:Number.NEGATIVE_INFINITY:0}function CSs(e,t){if(!e.$ref||!e.$ref.startsWith("#/$defs/"))return e;let r=e.$ref.slice(8).replaceAll("~1","/").replaceAll("~0","~");return t.$defs?.[r]??e}function Hyi(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function LGe(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((r,n)=>LGe(r,t[n]));if(Hyi(e)&&Hyi(t)){let r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every(i=>Object.hasOwn(t,i)&&LGe(e[i],t[i]))}return!1}var etp=T.strictObject({clientName:$t.optional().describe("The generated client class name."),exportedClientName:$t.optional().describe("The client name exported from the generated package."),environmentTypeName:$t.optional().describe("The generated type name for API environments."),apiErrorName:$t.optional().describe("The generated API error class name."),baseErrorName:$t.optional().describe("The generated base error class name."),pagerName:$t.optional().describe("The generated pagination helper name."),smartCasing:T.boolean().optional().describe("Whether generated identifiers use initialism-aware casing."),smartCasingDigitWordBoundary:T.boolean().optional().describe("Whether smart casing preserves a word boundary after digits.")}),NOg=T.discriminatedUnion("type",[T.strictObject({type:T.literal("path").describe("Loads the generation asset from a relative path."),location:Sae.describe("The relative path to the generation asset.")}),T.strictObject({type:T.literal("url").describe("Loads the generation asset from a URL."),location:$t.describe("The URL of the generation asset.")})]),jOg=T.strictObject({enabled:T.boolean().describe("Whether customer-authored code is merged into generated output."),source:NOg.optional().describe("The source containing customer-authored code."),conflictStrategy:T.enum(["mark","ours","theirs"]).optional().describe("How merge conflicts between generated and custom code are handled."),trackChanges:T.boolean().optional().describe("Whether custom-code changes are tracked between builds."),protectedFiles:T.array($t).optional().describe("Generated file paths that custom-code merging must not overwrite.")}),zOg=T.strictObject({name:$t.describe("The exported telemetry header name."),value:T.string().describe("The literal telemetry header value.")}),QOg=T.strictObject({enabled:T.boolean().describe("Whether generated clients export usage telemetry."),endpoint:$t.optional().describe("The telemetry export endpoint."),exporter:T.enum(["otlp-http","console"]).optional().describe("The telemetry exporter implementation."),headers:T.array(zOg).optional().describe("Headers sent by the telemetry exporter."),batchSize:T.number().int().positive().optional().describe("The maximum spans in each export batch."),scheduledDelayMs:T.number().nonnegative().optional().describe("The delay between scheduled exports, in milliseconds."),exportTimeoutMs:T.number().nonnegative().optional().describe("The maximum time allowed for an export, in milliseconds.")}).superRefine(({enabled:e,endpoint:t},r)=>{e&&t===void 0&&r.addIssue({code:"custom",message:"endpoint is required when analytics is enabled",path:["endpoint"]})}),MOg=T.strictObject({enabled:T.boolean().describe("Whether wire-level request and response tests are generated."),exclusions:T.array($t).optional().describe("Operations excluded from wire tests."),fallbackToGeneratedErrorExamples:T.boolean().optional().describe("Whether missing error fixtures are synthesized from generated examples."),fixtureSource:T.enum(["synthetic","recorded","auto"]).optional().describe("Where wire-test fixtures are obtained.")}),LOg=T.strictObject({enabled:T.boolean().describe("Whether SDK unit tests are generated."),exclusions:T.array($t).optional().describe("Operations excluded from unit tests.")}),_Og=T.strictObject({enabled:T.boolean().describe("Whether generated clients expose streaming response APIs."),responseType:T.enum(["wrapper","native","web"]).optional().describe("The streaming response abstraction exposed by generated clients."),fileResponseType:T.enum(["stream","binary-response"]).optional().describe("The response type used for file downloads."),defaultChunkSizeBytes:T.number().int().positive().optional().describe("The default number of bytes yielded by streaming iterators.")}),UOg=T.strictObject({outputDirectory:T.enum(["project-root","source-root"]).optional().describe("Whether generated source is rooted at the project or its source directory."),packagePath:$t.optional().describe("The package-relative path for generated source files.")}),VOg=T.strictObject({enumRepresentation:T.enum(["enum","union","literal","forward-compatible-enum","language-default"]).optional().describe("How schema enums are represented in generated code."),additionalProperties:T.enum(["allow","forbid","ignore","language-default"]).optional().describe("How undeclared object properties are handled."),inlineTypes:T.boolean().optional().describe("Whether inline schemas remain nested under their parent types."),omitUndefined:T.boolean().optional().describe("Whether undefined properties are omitted during serialization.")}),xSs={includeOptionalSnippetParameters:T.boolean().optional().describe("Whether usage snippets include optional request parameters."),buildAllModels:T.boolean().optional().describe("Whether models not referenced by operations are also generated."),inferServiceNames:T.boolean().optional().describe("Whether service names are inferred from API structure."),includeDeprecatedOperations:T.boolean().optional().describe("Whether deprecated API operations are generated."),multipleResponses:T.boolean().optional().describe("Whether operations model multiple successful response types."),devContainer:T.boolean().optional().describe("Whether development-container configuration is generated."),allowMockClient:T.boolean().optional().describe("Whether a mock API client is included in the generated SDK."),ignoreFiles:T.array($t).optional().describe("Generated paths excluded from the final output."),reservedKeywords:T.array($t).optional().describe("Additional identifiers treated as reserved words."),customCode:jOg.optional().describe("Customer-authored code merge configuration."),customQueryPaths:T.array(Sae).optional().describe("Relative paths to custom query definitions."),analytics:QOg.optional().describe("Generated client telemetry configuration."),wireTests:MOg.optional().describe("Wire-level request and response test generation."),unitTests:LOg.optional().describe("SDK unit-test generation."),webSockets:T.boolean().optional().describe("Whether WebSocket clients are generated for supported channels."),streams:_Og.optional().describe("Streaming response generation behavior."),naming:etp.optional().describe("Names and casing used by generated code."),layout:UOg.optional().describe("Generated project and source layout."),serialization:VOg.optional().describe("Generated model serialization behavior.")},D4=T.strictObject(xSs),GOg=T.strictObject({...xSs,buildAllModels:T.boolean().default(!1).describe("Whether models not referenced by operations are also generated."),inferServiceNames:T.boolean().default(!1).describe("Whether service names are inferred from API structure."),includeDeprecatedOperations:T.boolean().default(!0).describe("Whether deprecated API operations are generated."),multipleResponses:T.boolean().default(!1).describe("Whether operations model multiple successful response types."),devContainer:T.boolean().default(!1).describe("Whether development-container configuration is generated."),allowMockClient:T.boolean().default(!1).describe("Whether a mock API client is included in the generated SDK.")}),niO=new Set(Object.keys(xSs));var iiO=T.enum(["npm","pypi","maven","nuget","rubygems","crates","go","composer"]),qOg=T.strictObject({keyId:$t.describe("The signing key identifier, or an environment expression that resolves to it."),password:$t.describe("The signing key password, or an environment expression that resolves to it."),secretKey:$t.describe("The armored secret key, or an environment expression that resolves to it.")});function Iep(e,t){return $t.regex(/^\$\{[A-Za-z_][A-Za-z0-9_]*\}$/,`${e} apiKey must be an environment expression naming a secret, such as ${t}`)}function vep(e,t){return`An environment expression naming the repository secret that the generated release workflow reads the ${e} API key from, such as ${t}. This is a secret name, never the key itself.`}function Cep(e){return T.boolean().optional().describe(`Whether ${e} publication uses trusted publishing (OIDC) instead of an API key secret.`)}function xep(e,t){e.trustedPublishing===!0&&e.apiKey!==void 0&&t.addIssue({code:"custom",message:"apiKey must be omitted when trustedPublishing is true",path:["apiKey"]})}var FFe={url:$t.optional().describe("A custom package registry URL."),releaseBranch:$t.optional().describe("The branch used by generated package release workflows."),tolerateRepublish:T.boolean().optional().describe("Whether an already-published package version is treated as non-fatal.")},SSs=T.discriminatedUnion("registry",[T.strictObject({registry:T.literal("npm").describe("Publishes the package to an npm-compatible registry."),token:$t.optional().describe("The npm registry token, or an environment expression that resolves to it."),trustedPublishing:T.boolean().optional().describe("Whether npm publication uses trusted publishing (OIDC) instead of a token."),...FFe}).superRefine((e,t)=>{e.trustedPublishing===!0&&e.token!==void 0&&t.addIssue({code:"custom",message:"token must be omitted when trustedPublishing is true",path:["token"]})}),T.strictObject({registry:T.literal("pypi").describe("Publishes the package to a PyPI-compatible registry."),username:$t.optional().describe("The PyPI username, or an environment expression that resolves to it."),password:$t.optional().describe("The PyPI password or token, or an environment expression that resolves to it."),...FFe}),T.strictObject({registry:T.literal("maven").describe("Publishes the package to a Maven-compatible repository."),username:$t.optional().describe("The Maven username, or an environment expression that resolves to it."),password:$t.optional().describe("The Maven password, or an environment expression that resolves to it."),signature:qOg.optional().describe("Credentials used to sign Maven artifacts."),...FFe}),T.strictObject({registry:T.literal("nuget").describe("Publishes the package to a NuGet-compatible registry."),apiKey:Iep("NuGet","${NUGET_API_KEY}").optional().describe(vep("NuGet","${NUGET_API_KEY}")),trustedPublishing:Cep("NuGet"),...FFe}).superRefine(xep),T.strictObject({registry:T.literal("rubygems").describe("Publishes the package to a RubyGems-compatible registry."),apiKey:Iep("RubyGems","${RUBYGEMS_API_KEY}").optional().describe(vep("RubyGems","${RUBYGEMS_API_KEY}")),trustedPublishing:Cep("RubyGems"),...FFe}).superRefine(xep),T.strictObject({registry:T.literal("crates").describe("Publishes the crate to a Cargo-compatible registry."),token:$t.optional().describe("The Cargo registry token, or an environment expression that resolves to it."),...FFe}),T.strictObject({registry:T.literal("go").describe("Publishes the SDK as a Go module."),...FFe}),T.strictObject({registry:T.literal("composer").describe("Publishes the package to a Composer-compatible registry."),...FFe})]),WOg=T.strictObject({teams:T.array($t).optional().describe("GitHub teams requested as reviewers."),users:T.array($t).optional().describe("GitHub users requested as reviewers.")}),HOg=T.strictObject({username:$t.optional().describe("The username used to authenticate with the GitHub host."),password:$t.optional().describe("The password used to authenticate with the GitHub host."),token:$t.optional().describe("A token used to authenticate with the GitHub host."),apiKey:$t.optional().describe("An API key used to authenticate with the GitHub host.")}),KOg=T.strictObject({repository:$t.describe("The GitHub repository that receives generated files."),host:$t.optional().describe("The GitHub host for enterprise installations."),branch:$t.optional().describe("The target branch for generated changes."),mode:T.enum(["release","pull-request","push","commit","commit-and-release"]).optional().describe("How generated changes are delivered to the repository."),reviewers:WOg.optional().describe("Reviewers requested for generated pull requests."),credentials:HOg.optional().describe("Credentials used to authenticate GitHub delivery."),privateRepository:T.boolean().optional().describe("Whether the destination repository is private."),workflows:T.boolean().optional().describe("Whether generated .github/workflows files are delivered. Defaults to true. When false, newly generated workflow files are skipped and existing ones in the repository are left untouched.")}),wSs=T.strictObject({delivery:T.literal("files").describe("Writes the generated SDK to a directory."),path:$t.optional().describe("The destination directory for generated files."),publish:SSs.optional().describe("Optional package registry publication.")}),TSs=T.strictObject({delivery:T.literal("zip").describe("Packages the generated SDK as a ZIP archive."),fileName:$t.optional().describe("The generated ZIP archive file name."),publish:SSs.optional().describe("Optional package registry publication.")}),OSs=T.strictObject({delivery:T.literal("github").describe("Delivers the generated SDK to GitHub."),github:KOg.describe("GitHub repository delivery settings."),publish:SSs.optional().describe("Optional package registry publication.")}),ttp=T.discriminatedUnion("delivery",[wSs,TSs,OSs],{error:'output.delivery must be one of "files", "zip", or "github"'}),JOg=T.strictObject({delivery:T.literal("hosted").describe("Deploys the generated MCP server to Fern-hosted infrastructure."),slug:$t.describe("The server slug. The hosted URL is https://{organization}.fernmcp.dev/{slug}. May be an environment expression that resolves to the slug.")}),YOg=T.discriminatedUnion("delivery",[wSs,TSs,OSs,JOg],{error:'output.delivery must be one of "files", "zip", "github", or "hosted"'}),ISs={distribution:Gep.optional().describe("CLI release channels and build attestation settings for the generated release workflow; credentials are GitHub Actions secret names.")};function Sep(e,t){e.distribution!==void 0&&t.addIssue({code:"custom",message:qep,path:["distribution"]})}var XOg=T.discriminatedUnion("delivery",[wSs.extend(ISs).superRefine(Sep),TSs.extend(ISs).superRefine(Sep),OSs.extend(ISs)],{error:'output.delivery must be one of "files", "zip", or "github"'}),ZOg=T.strictObject({enabled:T.boolean().describe("Whether regeneration reapplies customer-authored repository changes.")}),Kyi=T.strictObject({respectNullableSchemas:T.boolean().optional().describe("Whether nullable schemas remain nullable in generated types."),titleAsSchemaName:T.boolean().optional().describe("Whether a schema title can determine the generated type name."),coerceEnumsToLiterals:T.boolean().optional().describe("Whether single-value enums are imported as literal values."),idiomaticRequestNames:T.boolean().optional().describe("Whether request types use concise, idiomatic generated names."),wrapReferencesToNullableInOptional:T.boolean().optional().describe("Whether nullable schema references are also treated as optional."),coerceOptionalSchemasToNullable:T.boolean().optional().describe("Whether optional properties are represented as nullable required properties."),pathParameterOrder:T.enum(["url-order","spec-order"]).optional().describe("Whether path parameters follow their URL order or specification order."),onlyIncludeReferencedSchemas:T.boolean().optional().describe("Whether unreferenced schemas are omitted from the generated SDK."),objectQueryParameters:T.boolean().optional().describe("Whether object-valued query parameters are preserved as objects."),typeDatesAsStrings:T.boolean().optional().describe("Whether date and date-time schemas are generated as strings."),groupMultiApiEnvironments:T.boolean().optional().describe("Whether environments from multiple API sources are merged into shared named groups."),ignoreTags:T.boolean().optional().describe("Whether API tags are ignored when organizing generated resources."),disambiguateRequestNames:T.boolean().optional().describe("Whether colliding request type names are automatically disambiguated."),respectReadonlySchemas:T.boolean().optional().describe("Whether read-only properties are modeled separately for request and response types."),discriminatedUnionV2:T.boolean().optional().describe("Whether oneOf and anyOf schemas use the newer discriminator inference rules."),undiscriminatedUnionsWithLiterals:T.boolean().optional().describe("Whether literal-bearing unions remain undiscriminated during import."),inlineAllOfSchemas:T.boolean().optional().describe("Whether schemas composed with allOf are inlined when possible."),inferDiscriminatedUnionBaseProperties:T.boolean().optional().describe("Whether properties every discriminated-union variant shares are lifted onto the union."),resolveSchemaCollisions:T.boolean().optional().describe("Whether colliding imported schema names are resolved automatically."),asyncApiMessageNaming:T.enum(["v1","v2"]).optional().describe("The naming strategy used for messages imported from AsyncAPI."),defaultIntegerFormat:T.enum(["int32","int64","uint32","uint64"]).optional().describe("The integer format used when a schema does not declare one."),respectByteFormat:T.boolean().optional().describe("Whether string schemas with format byte are imported as base64-encoded bytes.")}),rtp=T.enum(["openapi","swagger","postman","asyncapi","graphql"]),ntp={id:$t.describe("A unique identifier for this API source."),name:$t.optional().describe("A human-readable name for this API source."),namespace:$t.optional().describe("A namespace used to isolate this source in a multi-source SDK."),apiImportSettings:Kyi.optional().describe("Import behavior that overrides the source-level defaults for this spec.")},wep={...ntp,type:rtp.describe("The API description format of this source."),overlays:T.array(Sae).optional().describe("Relative paths to overlays applied to this source in order."),overrides:T.array(Sae).optional().describe("Relative paths to source override files applied in order.")},$Og=T.strictObject({repo:$t.describe("The git repository URL."),ref:$t.optional().describe("The branch, tag, or commit SHA. Defaults to the repository's default branch."),path:Sae.describe("The path to the directory within the repository.")}),ePg=T.union([vSs.describe("The relative path to the .proto directory root."),T.strictObject({git:$Og.describe("The git remote holding the .proto files.")}).describe("A .proto directory root in a remote git repository.")]),tPg=T.strictObject({root:ePg.describe("The .proto directory root, as a relative path or a git remote."),target:vSs.optional().describe("The relative path to the single .proto file that defines the API."),overrides:T.array(vSs).optional().describe("Relative paths to override files applied to the converted API in order."),dependencies:T.array($t).optional().describe("Buf Schema Registry modules the .proto files depend on."),localGeneration:T.boolean().optional().describe("Whether the .proto files are compiled locally instead of remotely."),fromOpenApi:T.boolean().default(!1).describe("Whether SDKs are generated from the OpenAPI converted from the .proto files.")}),rPg=[T.strictObject({...wep,path:Sae.describe("The relative path to the API source file.")}),T.strictObject({...wep,url:T.url({protocol:/^https?$/}).describe("The HTTP or HTTPS URL of the API source file.")}),T.strictObject({...ntp,proto:tPg.describe("The protobuf definitions of this source.")})],nPg=2;function iPg(e){return typeof e=="object"&&e!==null&&"proto"in e}var oPg=T.union(rPg,{error:e=>e.code!=="invalid_union"||!iPg(e.input)?"source spec must contain exactly one locator: path, HTTP(S) url, or proto":`protobuf source spec is invalid: ${(e.errors[nPg]??[]).map(({path:r,message:n})=>r.length?`${r.join(".")}: ${n}`:n).join("; ")}`}),sPg=T.strictObject({specs:T.array(oPg).min(1,"source.specs must contain at least one source spec").describe("API source files in authoritative processing order."),apiImportSettings:Kyi.optional().describe("Default import behavior shared by every source spec.")}).superRefine(({specs:e},t)=>{let r=new Set;e.forEach(({id:n},i)=>{r.has(n)&&t.addIssue({code:"custom",message:`source spec id "${n}" must be unique`,path:["specs",i,"id"]}),r.add(n)})}),itp=T.strictObject({useOptionalWrapper:T.boolean().optional().describe("Whether optional values use an explicit Optional wrapper."),simplifyObjectDictionaries:T.boolean().optional().describe("Whether object schemas with arbitrary values use simplified dictionary types."),explicitNamespaces:T.boolean().optional().describe("Whether generated resource groups use explicit nested namespaces."),rootNamespaceForCoreClasses:T.boolean().optional().describe("Whether shared client classes are emitted in the root namespace."),includeExceptionHandler:T.boolean().optional().describe("Whether generated client operations use a configurable exception handler."),experimentalExplicitNullableOptional:T.boolean().optional().describe("Whether optional nullable properties distinguish omitted values from explicit nulls.")}),otp=T.strictObject({legacyComplexModels:T.boolean().optional().describe("Whether complex models use the legacy Go representation."),smartCasing:T.boolean().optional().describe("Whether generated Go names capitalize common initialisms."),clientConstructorName:$t.optional().describe("The generated root-client constructor name."),unionVersion:T.enum(["v0","v1"]).optional().describe("The representation used for generated Go unions."),includeLegacyClientOptions:T.boolean().optional().describe("Whether the client retains legacy constructor option helpers."),packageLayout:T.enum(["root","types"]).optional().describe("Where the generated Go schema types are declared.")}),stp=T.strictObject({packageLayout:T.enum(["flat","nested"]).optional().describe("Whether generated JVM packages use a flat or nested resource layout."),useLocalDateForDates:T.boolean().optional().describe("Whether date-only values use LocalDate instead of OffsetDateTime."),collapseOptionalNullable:T.boolean().optional().describe("Whether optional nullable values collapse into a single nullable representation."),gradleDistributionUrl:T.string().min(1).optional().describe("The Gradle distribution URL written to the generated wrapper."),gradlePluginManagement:T.string().optional().describe("Plugin management configuration added to the generated Gradle settings."),gradleCentralDependencyManagement:T.boolean().optional().describe("Whether dependency versions are managed centrally in the Gradle project."),asyncStyle:T.enum(["dedicated-client","twin-methods"]).optional().describe("Whether asynchronous operations use a separate client or co-located methods.")}),atp=stp.extend({includeKotlinSnippets:T.boolean().optional().describe("Whether Java SDK documentation includes Kotlin usage snippets.")}),ctp=stp,aPg=T.strictObject({target:$t.optional().describe("The JavaScript language target passed to TypeScript."),module:$t.optional().describe("The module format passed to TypeScript."),lib:T.array($t).optional().describe("The runtime library definitions passed to TypeScript.")}),cPg=T.strictObject({name:$t.describe("The package script name."),command:$t.describe("The command executed by the package script.")}),lPg=T.strictObject({name:T.enum(["axios","fetch","node-fetch"]).describe("The HTTP client used by generated TypeScript code.")}),PSs=T.strictObject({typescriptVersion:$t.optional().describe("The TypeScript version used by the generated project."),zodVersion:$t.optional().describe("The Zod version used by generated runtime schemas."),compilerOptions:aPg.optional().describe("TypeScript compiler options for the generated project."),httpClient:lPg.optional().describe("The HTTP client used by generated TypeScript code."),packageManager:T.enum(["pnpm","yarn"]).optional().describe("The package manager used by the generated project."),packageManagerVersion:$t.optional().describe("The package manager version used by the generated project."),testFramework:T.enum(["jest","vitest"]).optional().describe("The test framework used by generated tests."),namingStrategy:T.enum(["base","originalPropertyNames"]).optional().describe("How schema property names are converted into TypeScript identifiers."),bundle:T.boolean().optional().describe("Whether the generated package includes bundled output."),exportClassDefault:T.boolean().optional().describe("Whether the client class is also exported as the default export."),namespaceExportName:$t.optional().describe("The top-level namespace export name."),consolidateTypeFiles:T.boolean().optional().describe("Whether generated types are consolidated into fewer source files."),formDataSupport:T.enum(["Node16","Node18"]).optional().describe("The multipart form-data implementation: Node16 uses the form-data packages, Node18 uses the platform FormData."),allowExtraFields:T.boolean().optional().describe("Whether response parsing keeps unrecognized object keys and accepts unrecognized union members and enum values."),generateSubpackageExports:T.boolean().optional().describe("Whether the package manifest exports each subpackage client as its own entry point."),exportAllRequestsAtRoot:T.boolean().optional().describe("Whether every request type is also exported from the package root."),generateEndpointMetadata:T.boolean().optional().describe("Whether generated clients expose metadata for each endpoint."),outputEsm:T.boolean().optional().describe("Whether the package is marked as an ES module while still shipping its CommonJS build."),neverThrowErrors:T.boolean().optional().describe("Whether client methods return a wrapped response instead of throwing on a non-2xx status."),includeOtherInUnionTypes:T.boolean().optional().describe("Whether union types gain a member for variants the SDK does not recognize."),includeUtilsOnUnionMembers:T.boolean().optional().describe("Whether helper utilities are generated on each member of a union type."),omitFernHeaders:T.boolean().optional().describe("Whether requests omit the SDK identification headers and the User-Agent header."),linter:T.enum(["biome","oxlint","none"]).optional().describe("The linter configured in the generated project."),formatter:T.enum(["prettier","biome","oxfmt","none"]).optional().describe("The formatter configured in the generated project."),exports:_St.optional().describe("package.json exports entries, keyed by subpath, applied over the generated exports. Each subpath replaces the generated one."),files:T.array($t).optional().describe("package.json files entries, listed ahead of the generated ones."),engines:T.record($t,$t).optional().describe("package.json engines version ranges, keyed by engine name such as node."),lintStaged:T.record($t,T.array($t).min(1)).optional().describe("lint-staged commands to run, keyed by file glob."),browser:T.record($t,T.union([T.boolean(),$t])).optional().describe("package.json browser field: a module or file is excluded (false) or replaced by another path."),allowCustomFetcher:T.boolean().optional().describe("Whether callers can supply a custom fetch implementation."),useBrandedStringAliases:T.boolean().optional().describe("Whether string aliases are emitted as distinct branded types."),useLegacyExports:T.boolean().optional().describe("Whether the package emits the legacy export layout."),useBigInt:T.boolean().optional().describe("Whether 64-bit integer values are represented with bigint."),serdeLayer:T.boolean().optional().describe("Whether generated models use Fern serialization and deserialization helpers."),esmOnly:T.boolean().optional().describe("Whether the package emits only ECMAScript modules."),scripts:T.array(cPg).optional().describe("Additional scripts added to the generated package manifest.")}),uPg=["IN_DEVELOPMENT","PRE_RELEASE","GENERAL_AVAILABILITY","DEPRECATED","ALPHA","BETA","PREVIEW","LEGACY"],Tep=T.strictObject({include:T.array($t).optional().describe("Operations explicitly included as MCP tools."),exclude:T.array($t).optional().describe("Operations explicitly excluded from MCP tools.")}),pPg=$t.refine(e=>e!=="default"&&/^[a-z0-9-]+$/.test(e),'toolset names must match [a-z0-9-]+ and cannot be "default"'),ltp=PSs.extend({serverName:$t.optional().describe("The name advertised by the generated MCP server."),serverDescription:$t.optional().describe("The description advertised by the generated MCP server."),excludeAvailability:T.array(T.enum(uPg)).optional().describe("Operation availability statuses excluded from MCP tool generation."),tools:Tep.optional().describe("Global operation filters for generated MCP tools."),toolsets:T.record(pPg,Tep).optional().describe("Named MCP toolsets and the operation filters for each toolset.")}),utp=T.strictObject({propertyAccess:T.enum(["public","private"]).optional().describe("The visibility of generated PHP model properties."),generateClientInterfaces:T.boolean().optional().describe("Whether interfaces are generated for PHP client classes.")}),fPg=T.strictObject({fileName:$t.optional().describe("The source file name for the Python client."),exportedFileName:$t.optional().describe("The file name used when exporting the Python client.")}),dPg=T.strictObject({versionCompatibility:T.enum(["v1","v2","both","v1-on-v2"]).optional().describe("The Pydantic major versions supported by generated models."),frozen:T.boolean().optional().describe("Whether generated Pydantic models are immutable."),requireOptionalFields:T.boolean().optional().describe("Whether Optional fields remain required unless they declare a default."),unionNaming:T.enum(["v0","v1"]).optional().describe("The naming strategy for generated union types."),useFieldAliases:T.boolean().optional().describe("Whether Pydantic field aliases preserve wire names.")}),mPg=T.strictObject({from:$t.describe("The module from which names are re-exported."),imports:T.array($t).min(1).describe("Names re-exported from the module.")}),ptp=T.strictObject({pythonVersion:$t.optional().describe("The Python version targeted by the generated project."),pydanticVersion:$t.optional().describe("The Pydantic dependency version requirement."),pydantic:dPg.optional().describe("Pydantic model-generation behavior."),client:fPg.optional().describe("Python client file naming."),followRedirectsByDefault:T.boolean().optional().describe("Whether generated HTTP clients follow redirects by default."),defaultBytesStreamChunkSize:T.number().int().positive().optional().describe("The default byte-stream iterator chunk size."),recursionLimit:T.number().int().gt(1e3).optional().describe("The Python recursion limit installed when the generated package is imported."),extras:T.record($t,T.array($t)).optional().describe("Published Python extras and their dependency names."),alwaysInitializeOptionals:T.boolean().optional().describe("Whether optional model fields are initialized even when omitted."),useTypedDictRequests:T.boolean().optional().describe("Whether request bodies are generated as TypedDict types."),streamAbstraction:T.boolean().optional().describe("Whether streaming endpoints return Stream and AsyncStream objects instead of plain iterators."),additionalInitExports:T.array(mPg).optional().describe("Additional names re-exported from the package initializer.")}),ftp=T.strictObject({requirePaths:T.array($t).optional().describe("Files the generated entry file loads with `require`.")}),dtp=T.strictObject({dateTimeType:T.enum(["offset","utc"]).optional().describe("Whether datetime values preserve their offset or normalize to UTC."),capitalizeInitialisms:T.boolean().optional().describe("Whether generated Rust names capitalize common initialisms."),features:T.record(T.string(),T.array($t)).optional().describe("Cargo features and the dependencies or features each enables."),defaultFeatures:T.array($t).optional().describe("Cargo features included in the crate default feature set.")}),mtp=T.strictObject({moduleName:$t.optional().describe("The Swift module name for the generated package."),nullableAsOptional:T.boolean().optional().describe("Whether nullable values are represented as Swift optionals.")}),Oep=T.discriminatedUnion("enabled",[T.strictObject({enabled:T.literal(!0).describe("Enables custom Terraform plan modifiers."),sourceDir:$t.describe("The directory containing custom plan modifier source files.")}),T.strictObject({enabled:T.literal(!1).describe("Disables custom Terraform plan modifiers.")})]),hPg=T.strictObject({resources:Oep.describe("Custom plan modifiers for generated resources."),attributes:Oep.describe("Custom plan modifiers for generated attributes.")}),gPg=T.strictObject({addressKey:$t.describe("The provider attribute used to configure the API address."),authTokenKey:$t.describe("The provider attribute used to configure the authentication token.")}),htp=T.strictObject({providerName:$t.optional().describe("The Terraform provider name."),providerVersion:$t.optional().describe("The generated Terraform provider version."),providerModulePath:Mep.optional().describe("The Go module path for the generated provider."),mockAcceptance:T.boolean().optional().describe("Whether acceptance tests use a mock API server."),hideComputedDiff:T.boolean().optional().describe("Whether computed-only changes are hidden from Terraform plans."),providerSchema:gPg.optional().describe("Names of provider-level configuration attributes."),planModifiers:hPg.optional().describe("Custom plan modifier source configuration.")}),R4={generatorVersion:Bep.optional().describe("The exact generator version used for this target."),sdkName:$t.optional().describe("An SDK name that overrides the root value for this target."),sdkVersion:$t.optional().describe("An SDK version that overrides the root value for this target."),client:rOg.optional().describe("Client settings that override root client configuration for this target."),docs:Kep.optional().describe("Documentation settings that override root documentation for this target."),package:Zep.optional().describe("Package metadata that overrides root package configuration for this target."),output:ttp.optional().describe("Output configuration that replaces the root output for this target.")},APg=T.discriminatedUnion("language",[T.strictObject({language:T.literal("typescript").describe("Generates a TypeScript SDK."),generation:D4.extend(PSs.shape).optional().describe("Common and TypeScript-specific generation settings for this target."),...R4}),T.strictObject({language:T.literal("python").describe("Generates a Python SDK."),generation:D4.extend(ptp.shape).optional().describe("Common and Python-specific generation settings for this target."),...R4}),T.strictObject({language:T.literal("java").describe("Generates a Java SDK."),generation:D4.extend(atp.shape).optional().describe("Common and Java-specific generation settings for this target."),...R4}),T.strictObject({language:T.literal("kotlin").describe("Generates a Kotlin SDK."),generation:D4.extend(ctp.shape).optional().describe("Common and Kotlin-specific generation settings for this target."),...R4}),T.strictObject({language:T.literal("go").describe("Generates a Go SDK."),generation:D4.extend(otp.shape).optional().describe("Common and Go-specific generation settings for this target."),...R4}),T.strictObject({language:T.literal("csharp").describe("Generates a C# SDK."),generation:D4.extend(itp.shape).optional().describe("Common and C#-specific generation settings for this target."),...R4}),T.strictObject({language:T.literal("php").describe("Generates a PHP SDK."),generation:D4.extend(utp.shape).optional().describe("Common and PHP-specific generation settings for this target."),...R4}),T.strictObject({language:T.literal("ruby").describe("Generates a Ruby SDK."),generation:D4.extend(ftp.shape).optional().describe("Common and Ruby-specific generation settings for this target."),...R4}),T.strictObject({language:T.literal("rust").describe("Generates a Rust SDK."),generation:D4.extend(dtp.shape).optional().describe("Common and Rust-specific generation settings for this target."),...R4}),T.strictObject({language:T.literal("swift").describe("Generates a Swift SDK."),generation:D4.extend(mtp.shape).optional().describe("Common and Swift-specific generation settings for this target."),...R4}),T.strictObject({language:T.literal("cli").describe("Generates a command-line interface."),generation:D4.extend(Xep.shape).optional().describe("Common and CLI-specific generation settings for this target."),...R4,output:XOg.optional().describe("Output configuration, including optional CLI distribution channels, that replaces the root output for this target.")}),T.strictObject({language:T.literal("mcp").describe("Generates an MCP server."),generation:D4.extend(ltp.shape).optional().describe("Common and MCP-specific generation settings for this target."),...R4,output:YOg.optional().describe("Output configuration, including Fern-hosted deployment, that replaces the root output for this target.")}),T.strictObject({language:T.literal("terraform").describe("Generates a Terraform provider."),generation:D4.extend(htp.shape).optional().describe("Common and Terraform-specific generation settings for this target."),...R4})]),yPg="sdk-config/v1",bPg={npm:["typescript","mcp","cli"],pypi:["python"],maven:["java","kotlin"],nuget:["csharp"],rubygems:["ruby"],crates:["rust"],go:["go"],composer:["php"]},EPg=new Set(["npm","pypi","nuget","rubygems","crates","composer"]);function IPg(e,t,r,n){let i=["targets",r,"package"];if(EPg.has(t)&&!e.packageName&&n.addIssue({code:"custom",message:`packageName is required when publishing to "${t}"`,path:[...i,"packageName"]}),t==="composer"&&e.packageName){let o=Lep.safeParse(e.packageName);o.success||n.addIssue({code:"custom",message:o.error.issues[0]?.message??"Invalid Composer package name",path:[...i,"packageName"]})}t==="go"&&!e.modulePath&&n.addIssue({code:"custom",message:"modulePath is required when publishing a Go module",path:[...i,"modulePath"]}),t==="maven"&&["groupId","artifactId"].forEach(o=>{e[o]||n.addIssue({code:"custom",message:`${o} is required when publishing to Maven`,path:[...i,o]})})}function vPg(e,t,r,n,i){let o=e.output??n;if(!o){i.addIssue({code:"custom",message:"output is required on the target when no global output is configured",path:["targets",t,"output"]});return}if(o.delivery==="hosted"||!o.publish)return;let s=o.publish.registry;if(!bPg[s].some(a=>a===e.language)){i.addIssue({code:"custom",message:`registry "${s}" is not supported for target language "${e.language}"`,path:["targets",t,e.output?"output":"language"]});return}e.language==="cli"&&o.delivery!=="github"&&i.addIssue({code:"custom",message:Wep,path:e.output?["targets",t,"output","delivery"]:["output","delivery"]}),IPg({...r,...e.package},s,t,i)}var CPg=T.strictObject({schemaVersion:T.literal(yPg).describe("The version of the customer-facing SDK Config schema."),sdkName:$t.describe("The default name used for generated SDKs."),sdkVersion:$t.default("1.0.0").describe("The default version assigned to generated SDKs."),apiVersion:$t.optional().describe("The version of the API represented by the generated SDKs."),source:sPg.describe("The API descriptions used to generate the SDKs."),api:KTg.prefault({}).describe("Shared API behavior for every target."),client:tOg.prefault({}).describe("Shared generated-client behavior for every target."),package:Zep.prefault({}).describe("Package metadata inherited by every target."),output:ttp.optional().describe("The default output delivery and publication configuration."),replay:ZOg.optional().describe("Generation replay behavior shared by every target."),docs:Kep.prefault({}).describe("Documentation settings inherited by every target."),generation:GOg.prefault({}).describe("Generation settings inherited by every target."),targets:T.array(APg).min(1).describe("Language targets to generate; each language may appear once.")}).superRefine(({output:e,package:t,targets:r},n)=>{let i=new Set;r.forEach((o,s)=>{i.has(o.language)&&n.addIssue({code:"custom",message:`target language "${o.language}" must be unique`,path:["targets",s,"language"]}),i.add(o.language),vPg(o,s,t,e,n)})});var oiO=$ep(CPg);var xPg=T.strictObject({source:T.enum(["fern","postman","sdk-config-ir"]).describe("The configuration surface containing the unsupported field."),path:T.array(T.union([$t,T.number().int().nonnegative()])).min(1).describe("The property path to the unsupported field in its source configuration."),code:$t.optional().describe("A stable diagnostic code for the unsupported field."),reason:$t.describe("Why the field could not be represented in normalized configuration."),severity:T.enum(["error","warning","info"]).describe("The diagnostic severity."),risk:T.enum(["high","medium","low"]).describe("The migration risk of omitting this field."),owner:$t.describe("The component or team responsible for resolving the gap."),suggestedAction:$t.describe("Recommended action for preserving the intended behavior.")}),SPg=T.strictObject({kind:T.literal("postman-build-parameters").describe("Identifies legacy Postman build parameters."),value:_St.describe("A debugging copy of the original Postman build parameters.")}),wPg=T.strictObject({kind:T.literal("fern-generator-invocation").describe("Identifies a legacy Fern generator invocation."),value:_St.describe("A debugging copy of the original Fern generator invocation.")}),TPg=T.discriminatedUnion("kind",[SPg,wPg]),OPg=T.strictObject({outputProfile:T.enum(["converged","postman-legacy","fern-legacy"]).describe("The output-default profile retained while legacy producers converge."),legacyInput:TPg.optional().describe("Original producer input retained only for migration debugging."),unsupportedFields:T.array(xPg).optional().describe("Legacy fields that could not be represented in normalized configuration.")});var gtp=T.discriminatedUnion("type",[T.strictObject({type:T.literal("path").describe("Loads the generation asset from a relative path."),location:Sae.describe("The relative path to the generation asset.")}),T.strictObject({type:T.literal("url").describe("Loads the generation asset from a URL."),location:$t.describe("The URL of the generation asset.")}),T.strictObject({type:T.literal("artifact").describe("Loads the generation asset from stored build output."),location:$t.describe("The artifact identifier or location.")})]),PPg=T.strictObject({name:$t.describe("The hook dependency name."),version:$t.describe("The hook dependency version requirement."),groupId:$t.optional().describe("The Maven group identifier for the dependency.")}),BPg=T.strictObject({enabled:T.boolean().describe("Whether custom request and response hooks are generated."),source:gtp.optional().describe("The source containing custom hook implementations."),dependencies:T.array(PPg).optional().describe("Dependencies required by custom hooks.")}),DPg=T.strictObject({enabled:T.boolean().describe("Whether customer-authored code is merged into generated output."),source:gtp.optional().describe("The source containing customer-authored code."),conflictStrategy:T.enum(["mark","ours","theirs"]).optional().describe("How merge conflicts between generated and custom code are handled."),trackChanges:T.boolean().optional().describe("Whether custom-code changes are tracked between builds."),previousBuildId:T.number().int().positive().optional().describe("The previous build used as the merge baseline."),protectedFiles:T.array($t).optional().describe("Generated file paths that custom-code merging must not overwrite.")}),RPg=T.strictObject({path:Sae.describe("The relative path to the workflow definition."),outputName:$t.optional().describe("The file name used for the generated workflow.")}),kPg=T.union([T.strictObject({name:$t.describe("The exported telemetry header name."),value:T.string().describe("The literal telemetry header value.")}),T.strictObject({name:$t.describe("The exported telemetry header name."),valueRef:$t.describe("A reference to the telemetry header value.")})]),FPg=T.strictObject({enabled:T.boolean().describe("Whether generated clients export usage telemetry."),endpoint:$t.optional().describe("The telemetry export endpoint."),exporter:T.enum(["otlp-http","console"]).optional().describe("The telemetry exporter implementation."),headers:T.array(kPg).optional().describe("Headers sent by the telemetry exporter."),batchSize:T.number().int().positive().optional().describe("The maximum spans in each export batch."),scheduledDelayMs:T.number().nonnegative().optional().describe("The delay between scheduled exports, in milliseconds."),exportTimeoutMs:T.number().nonnegative().optional().describe("The maximum time allowed for an export, in milliseconds.")}).superRefine(({enabled:e,endpoint:t},r)=>{e&&t===void 0&&r.addIssue({code:"custom",message:"endpoint is required when analytics is enabled",path:["endpoint"]})}),NPg=T.strictObject({enabled:T.boolean().describe("Whether wire-level request and response tests are generated."),exclusions:T.array($t).optional().describe("Operations excluded from wire tests."),fallbackToGeneratedErrorExamples:T.boolean().optional().describe("Whether missing error fixtures are synthesized from generated examples."),fixtureSource:T.enum(["synthetic","recorded","auto"]).optional().describe("Where wire-test fixtures are obtained.")}),jPg=T.strictObject({enabled:T.boolean().describe("Whether SDK unit tests are generated."),mode:T.enum(["core-runtime","schema-driven","both"]).optional().describe("The unit-test generation strategy."),exclusions:T.array($t).optional().describe("Operations excluded from unit tests.")}),zPg=T.strictObject({definitionS3DownloadUrl:$t.describe("The download URL for the materialized Fern definition archive."),outputPath:$t.optional().describe("The destination path for Fern definition support files."),cliVersion:$t.optional().describe("The Fern CLI version associated with the definition.")}),QPg=T.strictObject({enabled:T.boolean().describe("Whether generated clients expose streaming response APIs."),responseType:T.enum(["wrapper","native","web"]).optional().describe("The streaming response abstraction exposed by generated clients."),fileResponseType:T.enum(["stream","binary-response"]).optional().describe("The response type used for file downloads."),defaultChunkSizeBytes:T.number().int().positive().optional().describe("The default number of bytes yielded by streaming iterators.")}),MPg=T.strictObject({outputDirectory:T.enum(["project-root","source-root"]).optional().describe("Whether generated source is rooted at the project or its source directory."),packagePath:$t.optional().describe("The package-relative path for generated source files.")}),LPg=T.strictObject({enumRepresentation:T.enum(["enum","union","literal","forward-compatible-enum","language-default"]).optional().describe("How schema enums are represented in generated code."),additionalProperties:T.enum(["allow","forbid","ignore","language-default"]).optional().describe("How undeclared object properties are handled."),inlineTypes:T.boolean().optional().describe("Whether inline schemas remain nested under their parent types."),omitUndefined:T.boolean().optional().describe("Whether undefined properties are omitted during serialization.")}),_Pg=T.strictObject({typescript:PSs.optional().describe("TypeScript-specific generation settings."),python:ptp.optional().describe("Python-specific generation settings."),java:atp.optional().describe("Java-specific generation settings."),kotlin:ctp.optional().describe("Kotlin-specific generation settings."),go:otp.optional().describe("Go-specific generation settings."),csharp:itp.optional().describe("C#-specific generation settings."),php:utp.optional().describe("PHP-specific generation settings."),ruby:ftp.optional().describe("Ruby-specific generation settings."),rust:dtp.optional().describe("Rust-specific generation settings."),cli:Xep.optional().describe("CLI-specific generation settings."),mcp:ltp.optional().describe("MCP-specific generation settings."),swift:mtp.optional().describe("Swift-specific generation settings."),terraform:htp.optional().describe("Terraform-specific generation settings.")}),UPg=T.strictObject({includeWatermark:T.boolean().default(!1).describe("Whether generated files include a generator watermark."),ai:T.boolean().default(!1).describe("Whether the SDK includes generated AI service helpers."),includeOptionalSnippetParameters:T.boolean().optional().describe("Whether usage snippets include optional request parameters."),buildAllModels:T.boolean().default(!1).describe("Whether models not referenced by operations are also generated."),inferServiceNames:T.boolean().default(!1).describe("Whether service names are inferred from API structure."),includeDeprecatedOperations:T.boolean().default(!0).describe("Whether deprecated API operations are generated."),multipleResponses:T.boolean().default(!1).describe("Whether operations model multiple successful response types."),generateFullProject:T.boolean().default(!1).describe("Whether generation emits a complete publishable project."),devContainer:T.boolean().default(!1).describe("Whether development-container configuration is generated."),allowMockClient:T.boolean().default(!1).describe("Whether a mock API client is included in the generated SDK."),ignoreFiles:T.array($t).optional().describe("Generated paths excluded from the final output."),fernignoreContents:T.string().optional().describe("The raw .fernignore contents retained for external publishers."),fernDefinitionMetadata:zPg.optional().describe("Materialized Fern definition metadata used by external publishers."),reservedKeywords:T.array($t).optional().describe("Additional identifiers treated as reserved words."),hooks:BPg.optional().describe("Custom SDK request and response hook configuration."),customCode:DPg.optional().describe("Customer-authored code merge configuration."),workflows:T.array(RPg).optional().describe("Workflow definitions included in generated output."),customQueryPaths:T.array(Sae).optional().describe("Relative paths to custom query definitions."),analytics:FPg.optional().describe("Generated client telemetry configuration."),wireTests:NPg.optional().describe("Wire-level request and response test generation."),unitTests:jPg.optional().describe("SDK unit-test generation."),webSockets:T.boolean().optional().describe("Whether WebSocket clients are generated for supported channels."),streams:QPg.optional().describe("Streaming response generation behavior."),naming:etp.optional().describe("Names and casing used by generated code."),layout:MPg.optional().describe("Generated project and source layout."),serialization:LPg.optional().describe("Generated model serialization behavior."),language:_Pg.optional().describe("Settings specific to the selected target language.")}),siO=T.enum(["npm","pypi","maven","nuget","rubygems","crates","go","composer"]),VPg=T.enum(["refs-only","resolved-by-orchestrator","resolved-by-fiddle"]),Atp=T.strictObject({username:$t.optional().describe("The resolved credential username."),password:$t.optional().describe("The resolved credential password."),token:$t.optional().describe("The resolved credential token."),apiKey:$t.optional().describe("The resolved credential API key.")}),NFe={url:$t.optional().describe("A custom package registry URL."),credentialsRef:$t.optional().describe("A reference to registry publishing credentials."),credentials:Atp.optional().describe("Resolved registry publishing credentials."),version:$t.optional().describe("A registry-specific package version override."),releaseBranch:$t.optional().describe("The branch used by generated package release workflows."),tolerateRepublish:T.boolean().optional().describe("Whether publishing succeeds when this package version already exists."),shouldGeneratePublishWorkflow:T.boolean().optional().describe("Whether GitHub delivery includes a registry publishing workflow.")},Vyi={trustedPublishing:T.boolean().optional().describe("Whether registry publication uses trusted publishing or OIDC.")},GPg=$t.regex(/^[A-Za-z0-9_.-]+:[A-Za-z0-9_.-]+$/,"Maven coordinate must be in groupId:artifactId form"),qPg=T.strictObject({keyIdEnvironmentVariable:$t.optional().describe("The environment variable containing the signing key ID."),passwordEnvironmentVariable:$t.optional().describe("The environment variable containing the signing key password."),secretKeyEnvironmentVariable:$t.optional().describe("The environment variable containing the armored secret key.")}),WPg=T.strictObject({keyId:$t.describe("The resolved signing key identifier."),password:$t.describe("The resolved signing key password."),secretKey:$t.describe("The resolved armored secret key.")}),BSs=T.discriminatedUnion("registry",[T.strictObject({registry:T.literal("npm").describe("Publishes the package to an npm-compatible registry."),tokenEnvironmentVariable:$t.optional().describe("The environment variable containing the npm registry token."),isPackagePrivate:T.boolean().optional().describe("Whether generated npm package metadata marks the package as private."),publishToJsr:T.boolean().optional().describe("Whether the npm publishing flow also publishes the package to JSR."),...Vyi,...NFe}),T.strictObject({registry:T.literal("pypi").describe("Publishes the package to a PyPI-compatible registry."),usernameEnvironmentVariable:$t.optional().describe("The environment variable containing the PyPI username."),passwordEnvironmentVariable:$t.optional().describe("The environment variable containing the PyPI password or token."),...Vyi,...NFe}),T.strictObject({registry:T.literal("nuget").describe("Publishes the package to a NuGet-compatible registry."),apiKeyEnvironmentVariable:$t.optional().describe("The environment variable containing the NuGet API key."),...Vyi,...NFe}),T.strictObject({registry:T.literal("rubygems").describe("Publishes the package to a RubyGems-compatible registry."),apiKeyEnvironmentVariable:$t.optional().describe("The environment variable containing the RubyGems API key."),...Vyi,...NFe}),T.strictObject({registry:T.literal("crates").describe("Publishes the crate to a Cargo-compatible registry."),tokenEnvironmentVariable:$t.optional().describe("The environment variable containing the Cargo registry token."),...NFe}),T.strictObject({registry:T.literal("go").describe("Publishes the SDK as a Go module."),...NFe}),T.strictObject({registry:T.literal("composer").describe("Publishes the package to a Composer-compatible registry."),...NFe}),T.strictObject({registry:T.literal("maven").describe("Publishes the package to a Maven-compatible repository."),coordinate:GPg.optional().describe("The Maven coordinate in groupId:artifactId form."),usernameEnvironmentVariable:$t.optional().describe("The environment variable containing the Maven username."),passwordEnvironmentVariable:$t.optional().describe("The environment variable containing the Maven password."),mavenUrlEnvironmentVariable:$t.optional().describe("The environment variable containing the Maven repository URL."),signatureEnvironmentVariables:qPg.optional().describe("Environment variables containing Maven signing material."),signingCredentialsRef:$t.optional().describe("A reference to Maven signing credentials."),signature:WPg.optional().describe("Resolved Maven signing material."),...NFe})]),HPg=T.strictObject({teams:T.array($t).optional().describe("GitHub teams requested as reviewers."),users:T.array($t).optional().describe("GitHub users requested as reviewers.")}),KPg=T.strictObject({enabled:T.boolean().describe("Whether regeneration reapplies customer-authored repository changes.")}),JPg=T.strictObject({type:$t.optional().describe("The SPDX identifier or license key for the repository license."),customPath:$t.optional().describe("The path to a custom license file committed to the repository.")}).refine(e=>e.type!==void 0||e.customPath!==void 0,{message:"GitHub license must set type or customPath"}),YPg=T.strictObject({repository:$t.describe("The GitHub repository that receives generated files."),host:$t.optional().describe("The GitHub host for enterprise installations."),branch:$t.optional().describe("The target branch for generated changes."),mode:T.enum(["release","pull-request","push","commit","commit-and-release"]).optional().describe("How generated changes are delivered to the repository."),reviewers:HPg.optional().describe("Reviewers requested for generated pull requests."),credentialsRef:$t.optional().describe("A reference to GitHub credentials."),credentials:Atp.optional().describe("Resolved GitHub credentials."),privateRepository:T.boolean().optional().describe("Whether the destination repository is private."),workflows:T.boolean().optional().describe("Whether generated .github/workflows files are delivered. Defaults to true. When false, newly generated workflow files are skipped and existing ones in the repository are left untouched."),license:JPg.optional().describe("License configuration for the destination repository."),replay:KPg.optional().describe("Replay behavior for the external GitHub publisher."),verify:T.boolean().default(!1).describe("Whether the GitHub publisher verifies the generated result."),skipIfNoDiff:T.boolean().default(!1).describe("Whether GitHub publication is skipped when no generated files changed."),autoMerge:T.boolean().default(!1).describe("Whether the GitHub publisher automatically merges its pull request.")}),DSs={distribution:Gep.optional().describe("CLI release channels and build attestation settings for the generated release workflow; credentials are GitHub Actions secret names.")},RSs={credentialResolution:VPg.default("refs-only").describe("Where output credential references are resolved.")},XPg=T.strictObject({delivery:T.literal("files").describe("Writes the generated SDK to a directory."),path:$t.optional().describe("The destination directory for generated files."),publish:BSs.optional().describe("Optional package registry publication."),...DSs,...RSs}),ZPg=T.strictObject({delivery:T.literal("zip").describe("Packages the generated SDK as a ZIP archive."),fileName:$t.optional().describe("The generated ZIP archive file name."),publish:BSs.optional().describe("Optional package registry publication."),...DSs,...RSs}),$Pg=T.strictObject({delivery:T.literal("github").describe("Delivers the generated SDK to GitHub."),github:YPg.describe("GitHub repository delivery settings."),publish:BSs.optional().describe("Optional package registry publication."),...DSs,...RSs}),eBg=T.discriminatedUnion("delivery",[XPg,ZPg,$Pg],{error:'output.delivery must be one of "files", "zip", or "github"'}),tBg=T.strictObject({enabled:T.boolean().describe("Whether regeneration reapplies customer-authored repository changes.")}),rBg=T.enum(["protobuf"]),nBg=T.strictObject({id:$t.optional().describe("A unique identifier for this API source."),name:$t.optional().describe("A human-readable name for this API source."),namespace:$t.optional().describe("A namespace used to isolate this source in a multi-source SDK."),specUrl:$t.describe("The materialized URL from which the generator retrieves the API source."),specType:rtp.describe("The API description format of this source."),origin:rBg.optional().describe("The format this source was authored in before it was converted to specType."),apiImportSettings:Kyi.optional().describe("Import behavior that overrides the source-level defaults for this spec."),overlays:T.array($t).optional().describe("Materialized overlays applied to this source in order."),overrides:T.array($t).optional().describe("Materialized source overrides applied in order.")}).superRefine(({specType:e,origin:t},r)=>{t==="protobuf"&&e!=="openapi"&&r.addIssue({code:"custom",message:'origin "protobuf" is only allowed on openapi specs',path:["origin"]})}),iBg=T.strictObject({specs:T.array(nBg).min(1,"source.specs must contain at least one source spec").describe("Materialized API sources in authoritative processing order."),apiImportSettings:Kyi.optional().describe("Default import behavior shared by every source spec.")}).superRefine(({specs:e},t)=>{let r=new Set;e.forEach(({id:n},i)=>{n&&r.has(n)&&t.addIssue({code:"custom",message:`source spec id "${n}" must be unique`,path:["specs",i,"id"]}),n&&r.add(n)})}),kSs=T.enum(["typescript","python","java","kotlin","go","csharp","php","ruby","rust","swift","cli","mcp","terraform"]),oBg=T.strictObject({language:kSs.describe("The language or platform generated by this single-target request."),generatorVersion:Bep.optional().describe("The exact generator version requested for this target."),sourceOrigin:T.enum(["postman","fern"]).describe("The configuration system from which this IR was normalized."),sdkName:$t.describe("The name used for the generated SDK."),apiName:$t.optional().describe("The stable API identity used for external publishing."),organization:$t.optional().describe("Source organization metadata retained for generation."),organizationName:$t.optional().describe("The stable organization identity used for external publishing."),sdkVersion:$t.default("1.0.0").describe("The version of the generated SDK."),apiVersion:$t.optional().describe("The version of the API represented by the SDK.")}),FSs="sdk-config-ir/v1",sBg={npm:["typescript","mcp","cli"],pypi:["python"],maven:["java","kotlin"],nuget:["csharp"],rubygems:["ruby"],crates:["rust"],go:["go"],composer:["php"]},aBg=new Set(["npm","pypi","nuget","rubygems","crates","composer"]);function cBg(e,t,r){if(aBg.has(t)&&!e.packageName){r.addIssue({code:"custom",message:`package.packageName is required when publishing to "${t}"`,path:["package","packageName"]});return}if(t==="composer"&&e.packageName){let n=Lep.safeParse(e.packageName);n.success||r.addIssue({code:"custom",message:n.error.issues[0]?.message??"Invalid Composer package name",path:["package","packageName"]})}t==="go"&&!e.modulePath&&r.addIssue({code:"custom",message:"package.modulePath is required when publishing a Go module",path:["package","modulePath"]}),t==="maven"&&["groupId","artifactId"].forEach(n=>{e[n]||r.addIssue({code:"custom",message:`package.${n} is required when publishing to Maven`,path:["package",n]})})}function lBg(e,t,r){e.distribution!==void 0&&t!=="cli"?r.addIssue({code:"custom",message:`output.distribution is supported only for target language "cli", not "${t}"`,path:["output","distribution"]}):e.distribution!==void 0&&e.delivery!=="github"&&r.addIssue({code:"custom",message:qep,path:["output","distribution"]}),t==="cli"&&e.publish&&e.delivery!=="github"&&r.addIssue({code:"custom",message:Wep,path:["output","publish"]})}var yZt=T.strictObject({schemaVersion:T.literal(FSs).describe("The version of the normalized SDK Config IR schema."),source:iBg.describe("Materialized API descriptions consumed by generation."),target:oBg.describe("Identity and provenance for this single generation target."),api:kep.describe("API behavior exposed by the generated SDK."),client:Qep.describe("Behavior of the generated API client."),package:_ep.describe("Package identity and metadata for the generated SDK."),output:eBg.describe("Artifact delivery and optional package publication."),replay:tBg.optional().describe("Generation replay behavior."),docs:Hep.describe("Generated documentation settings."),generation:UPg.describe("Shared and language-specific generation behavior."),compatibility:OPg.optional().describe("Temporary provenance and diagnostics retained during legacy migration.")}).superRefine(({compatibility:e,generation:t,output:r,package:n,target:i},o)=>{let s=Object.keys(t.language??{});if((r.delivery==="github"||r.publish!==void 0)&&[["apiName","target.apiName is required for external publishing"],["organizationName","target.organizationName is required for external publishing"]].forEach(([c,l])=>{i[c]||o.addIssue({code:"custom",message:l,path:["target",c]})}),s.forEach(c=>{c!==i.language&&o.addIssue({code:"custom",message:`generation.language.${c} does not match target language "${i.language}"`,path:["generation","language",c]})}),r.publish&&!sBg[r.publish.registry].some(c=>c===i.language)&&o.addIssue({code:"custom",message:`registry "${r.publish.registry}" is not supported for target language "${i.language}"`,path:["output","publish","registry"]}),r.publish&&(cBg(n,r.publish.registry,o),r.delivery!=="github"&&r.publish.shouldGeneratePublishWorkflow===!0&&o.addIssue({code:"custom",message:"output.publish.shouldGeneratePublishWorkflow requires GitHub delivery",path:["output","publish","shouldGeneratePublishWorkflow"]})),lBg(r,i.language,o),e?.legacyInput){let c=i.sourceOrigin==="postman"?"postman-build-parameters":"fern-generator-invocation";e.legacyInput.kind!==c&&o.addIssue({code:"custom",message:`compatibility.legacyInput kind "${e.legacyInput.kind}" does not match target.sourceOrigin "${i.sourceOrigin}"`,path:["compatibility","legacyInput","kind"]})}});function bZt(e){return yZt.parse(e)}var aiO=T.enum(["generation.generateFullProject"]),uBg=$ep(yZt);function Jyi(e){let t=bZt(e),r=DOg(t,uBg),n=[];if(r===void 0)throw new Error("SDK Config IR v1 root cannot be omitted from its wire payload");t.generation.generateFullProject&&n.push("generation.generateFullProject");let i=JSON.stringify(r);if(i===void 0)throw new Error("SDK Config IR v1 could not be serialized as JSON");return{body:new TextEncoder().encode(i),requiredCapabilities:n}}Io();cQ();var pBg=50,fBg=6e4;async function ytp({origin:e,token:t,organization:r,sdkName:n,version:i,languages:o}){let s=new URLSearchParams({sdkName:n,version:i,status:"SUCCESS",limit:String(pBg)});for(let l of o)s.append("language",l);let{data:a}=await Nd.get(`${e}/v1/fern/artifacts?${s}`,{headers:{Authorization:`Bearer ${t}`,"X-Fern-Organization-Id":r},timeout:fBg}),c=new Map;for(let{language:l,placeholdersSnippetsUrl:u}of a.data)u!=null&&!c.has(l)&&c.set(l,u);return c}It();qZt();cQ();function npp(e){let t=JSON.parse(e),r=si(t)&&si(t.snippets)?t.snippets.endpoints:void 0,n=si(t)?t.endpoints??r:void 0;return si(n)?Object.entries(n).flatMap(([i,o])=>Object.entries(si(o)?o:{}).flatMap(([s,a])=>{let c=hL.safeParse(s.toUpperCase());return c.success&&typeof a=="string"&&a.trim()!==""?[{path:i,method:c.data,code:a}]:[]})):[]}async function ipp(e){return(await Nd.get(e,{responseType:"text",transformResponse:r=>r})).data}var q2g=["cli","mcp","terraform"],opp=new Set(kSs.options);for(let e of q2g)opp.delete(e);function spp(e){let t=e;return[...opp].flatMap(r=>{let n=Vsr(t[`${r}Sdk`]?.version);return n==null?[]:[{type:r,version:n}]})}function app({snippetsConfig:e,sdkNames:t={},error:r}){let n=oi(r),i=spp(e);return i.length===0?[`Failed to read sdk snippets, error: ${n}`]:i.map(({type:o,version:s})=>{let a=t[o]??[];return`Failed to read sdk snippets for sdk: ${a.length>0?a.join(", "):"unknown"}, language: ${o}, version: ${s}, error: ${n}`})}var W2g=e=>e.type==="literal"?e.value:`{${e.value}}`;function H2g({method:e,path:t}){return`${e} ${t.parts.map(W2g).join("")}`}function K2g(e=[],t){return[...e,...t.filter(r=>!e.some(({language:n})=>n===r.language))]}function J2g(e,t){let r=H2g(e),n=[...t].flatMap(([o,s])=>{let a=s.get(r);return a==null?[]:[{language:o,code:a}]});if(n.length===0)return e;let i=e.examples.map(o=>({...o,codeSamples:K2g(o.codeSamples??void 0,n)}));return{...e,examples:i}}function RTs(e,t){return cNi(e,...[...t].map(r=>`${r}Sdk`))}function cpp({sdkGenLanguages:e,dynamicIrLanguages:t}){let r=[...[...e].map(n=>`${n}: sdk-gen`),...[...t].map(n=>`${n}: Fern dynamic IR`)];return r.length===0?void 0:`SDK snippet sources (${r.join(", ")})`}function Y2g(e,t){let r=i=>({...i,endpoints:i.endpoints.map(t)}),n=Object.entries(e.subpackages).map(([i,o])=>[i,r(o)]);return{...e,rootPackage:r(e.rootPackage),subpackages:Object.fromEntries(n)}}var lpp=(e,t)=>`${e}
|
|
4106
4107
|
${t}`;function X2g(e,t){let r=new Map;for(let{type:n,version:i}of e)for(let o of t[n]??[]){let s=lpp(o,i),a=r.get(s)??{sdkName:o,version:i,languages:[]};r.set(s,{...a,languages:[...a.languages,n]})}return r}function Z2g(e,t){try{let r=e();return r==null&&t.warn("FERN_SDK_GEN_API_ORIGIN is not set, so the SDK snippets cannot be read (the docs are not affected)"),r}catch(r){t.warn(`The sdk-gen-api origin is not usable, so the SDK snippets cannot be read (the docs are not affected): ${oi(r)}`);return}}async function upp({token:e,organization:t,snippetsConfig:r,sdkNames:n={},logger:i},{getOrigin:o=gFe,findSnippetsUrls:s=c=>ytp(c),readSnippets:a=ipp}={}){let c=spp(r);if(c.length===0)return new Map;let l=Z2g(o,i);if(l==null)return new Map;let u=new Map(await Promise.all([...X2g(c,n)].map(async([f,m])=>{try{return[f,await s({origin:l,token:e,organization:t,...m})]}catch(g){return i.warn(`Could not find the snippets of SDK "${m.sdkName}" ${m.version} in the sdk-gen-api (the docs are not affected): ${oi(g)}`),[f,new Map]}}))),p=new Map(await Promise.all(c.map(async({type:f,version:m})=>{let g=n[f]??[],A=g.map(y=>u.get(lpp(y,m))?.get(f)).find(y=>y!=null);if(A==null)return g.length>0&&i.warn(`No built ${f} SDK ${m} with snippets was found (the docs are not affected)`),[f,new Map];try{let y=npp(await a(A));return[f,new Map(y.map(({method:I,path:C,code:x})=>[`${I} ${C}`,x]))]}catch(y){return i.warn(`Could not read the ${f} snippets (the docs are not affected): ${oi(y)}`),[f,new Map]}}))),d=new Map([...p].filter(([,f])=>f.size>0));if(d.size>0){let f=[...d].map(([m,g])=>`${m}: ${g.size}`);i.info(`Loaded SDK snippets (${f.join(", ")})`)}return d}function ppp(e,t){if(t.size===0)return e;let{snippetsConfiguration:r}=e;return{...Y2g(e,n=>J2g(n,t)),snippetsConfiguration:r==null?void 0:RTs(r,t.keys())}}var $2g=new Set(["legacy","ledger"]);function Qbi(){if(process.env.FERN_SELF_HOSTED==="true")return"legacy";let e=process.env.FERN_DOCS_DEPLOY_MODE?.toLowerCase().trim();return e==null||e===""?"ledger":eNg(e)?e:(console.warn(`[fern] Unrecognized FERN_DOCS_DEPLOY_MODE="${e}" \u2014 falling back to "ledger". Valid values: ledger, legacy.`),"ledger")}function eNg(e){return $2g.has(e)}function Mbi(){return process.env.FERN_FDR_ORIGIN??process.env.OVERRIDE_FDR_ORIGIN??"https://registry.buildwithfern.com"??"https://registry.buildwithfern.com"}function tNg(e){if(typeof e!="object"||e==null)return!1;let t=e;return typeof t.siteId=="string"&&typeof t.orgId=="string"&&typeof t.domain=="string"&&typeof t.url=="string"&&typeof t.status=="string"&&typeof t.expiresAt=="string"}async function fpp({fdrOrigin:e,token:t}){let r=new URL("/v2/registry/docs/anonymous/guest-site",e);r.searchParams.set("orgId",t.organizationId);let n=await fetch(r,{headers:{Authorization:`Bearer ${t.value}`},signal:AbortSignal.timeout(15e3)});if(!n.ok){let o=await n.text().catch(()=>"");throw new Error(`FDR answered ${n.status} when resolving the guest docs site: ${o}`)}let i=await n.json().catch(()=>{});if(!tNg(i))throw new Error("FDR returned an unexpected guest docs site payload");return i}function dpp(e){if(typeof e!="object"||e==null)return{};let t=e,r=typeof t.expiresAt=="string"?new Date(t.expiresAt):void 0;return{claimUrl:typeof t.claimUrl=="string"?t.claimUrl:void 0,expiresAt:r!=null&&!Number.isNaN(r.getTime())?r:void 0}}It();lI();Mm();Nhe();var bpp=require("crypto"),Epp=require("fs/promises"),Ipp=Ae(rpe(),1);It();function iwt(e,t){if(e==null)return;let r=t?.get(e);return r??e}function rNg(e,t,r){let n=iwt(e,r);if(n==null)return;let i=t?.[n];if(!(i?.width==null||i?.height==null))return{path:n,width:i.width,height:i.height}}function WZt(e,t){if(e==null)return;if(e.type==="url")return{type:"url",value:e.value};let r=iwt(e.value,t);if(r!=null)return{type:"path",value:r}}function kTs(e,t,r){let n=e.background!=null?{type:"solid",...e.background}:void 0,i=iwt(e.backgroundImage,r);return{logo:rNg(e.logo,t,r),backgroundImage:i,accentPrimary:e.accentPrimary,background:n,border:e.border,sidebarBackground:e.sidebarBackground,headerBackground:e.headerBackground,cardBackground:e.cardBackground}}function nNg(e,t,r){if(e!=null)switch(e.type){case"dark":case"light":return{type:e.type,...kTs(e,t,r)};case"darkAndLight":return{type:"darkAndLight",dark:kTs(e.dark,t,r),light:kTs(e.light,t,r)};default:rt(e)}}function iNg(e,t){if(e==null)return;let{"og:image":r,"og:logo":n,"twitter:image":i,"og:background-image":o,"og:dynamic:background-image":s,...a}=e;return{...a,"og:image":WZt(r,t)??void 0,"og:logo":WZt(n,t)??void 0,"twitter:image":WZt(i,t)??void 0,"og:background-image":WZt(o,t)??void 0,"og:dynamic:background-image":WZt(s,t)??void 0}}function oNg(e,t){if(e==null)return;let r=[];for(let n of e.files){let i=iwt(n.fileId,t);i!=null&&r.push({path:i,strategy:n.strategy})}return{remote:e.remote?.map(n=>({url:n.url,strategy:n.strategy,disableSri:n.disableSri})),files:r,inline:e.inline}}function sNg(e,t){if(e==null)return;let r=n=>{if(n!=null)return{type:"custom",name:n.name,variants:n.variants.map(i=>({fontFile:iwt(i.fontFile,t)??i.fontFile,weight:i.weight,style:i.style})),display:n.display,fallback:n.fallback,fontVariationSettings:n.fontVariationSettings}};return{headingsFont:r(e.headingsFont),bodyFont:r(e.bodyFont),codeFont:r(e.codeFont)}}function aNg(e){if(e==null)return;let t={pageDirective:e.pageDirective,pageDescriptionSource:e.pageDescriptionSource,siteDescription:e.siteDescription},{robotsTxtOnInstanceUrl:r}=e;return r!=null?Object.assign(t,{robotsTxtOnInstanceUrl:r}):t}function cNg(e){if(e!=null)return{intercom:e.intercom}}function mpp({docsConfig:e,fileManifest:t,fileIdToPath:r,editThisPage:n}){return{title:e.title,defaultLanguage:e.defaultLanguage,translations:e.translations,announcement:e.announcement,navbarLinks:e.navbarLinks,footerLinks:e.footerLinks,logoHeight:e.logoHeight,logoHref:e.logoHref,logoRightText:e.logoRightText,favicon:iwt(e.favicon,r),agents:aNg(e.agents),metadata:iNg(e.metadata,r),redirects:e.redirects,colorsV3:nNg(e.colorsV3,t,r),layout:e.layout,theme:e.theme,settings:e.settings,typographyV2:sNg(e.typographyV2,r),analyticsConfig:e.analyticsConfig,css:e.css,js:oNg(e.js,r),aiChatConfig:e.aiChatConfig,pageActions:e.pageActions,editThisPageLaunch:e.editThisPageLaunch,embedding:e.embedding,editThisPageGithub:n?.github!=null?{owner:n.github.owner,repo:n.github.repo,branch:n.github.branch??"main",host:n.github.host??"https://github.com"}:void 0,integrations:cNg(e.integrations),header:e.header,footer:e.footer}}var uNg=10,pNg=4,NTs=3,fNg=1e3;function vpp(e){return(0,bpp.createHash)("sha256").update(e).digest("hex")}var Cpp=/file:([^\s"'<>)}\]]+)/g;function dNg(e){let t=new Set;for(let r of e.matchAll(Cpp)){let n=r[1];n!=null&&t.add(n)}return[...t]}function mNg(e,t){return t==null||t.size===0?e:e.replace(Cpp,(r,n)=>`file:${t.get(n)??n}`)}function hNg(e){return JSON.stringify(e,(t,r)=>Pr(r)?Object.fromEntries(Object.entries(r).sort(([n],[i])=>n<i?-1:n>i?1:0)):r)}function App(e){let t=Buffer.from(hNg(e),"utf-8"),r=vpp(t);return{ref:{hash:r,contentType:"application/json",contentLength:t.length},hash:r,buf:t}}var gNg={robotsTxt:"robots.txt",llmsTxt:"llms.txt",llmsFullTxt:"llms-full.txt"};function ANg({agents:e,fileManifest:t,fileIdToPath:r}){if(e==null||t==null)return t;let n;for(let[i,o]of Object.entries(gNg)){let s=e[i];if(s==null)continue;let a=r?.get(s)??s,c=t[a];a===o||c==null||(n??={...t},n[o]={...c,filename:o})}return n??t}function qGe({docsDefinition:e,git:t,apiDefinitions:r,fileManifest:n,fileIdToPath:i,editThisPage:o,locale:s}){let a=new Map,c={};for(let[f,m]of Object.entries(e.pages)){if(m==null)continue;let g=mNg(m.markdown,i),A=Buffer.from(g,"utf-8"),y=vpp(A),I=dNg(g);c[f]={hash:y,contentType:"text/markdown",contentLength:A.length,...I.length>0?{referencedFiles:I}:{}},a.set(y,A)}let l=mpp({docsConfig:e.config,fileManifest:n,fileIdToPath:i,editThisPage:o}),u=null;if(r.size>0){let f=Object.fromEntries(r),m=App(f);a.set(m.hash,m.buf),u=m.ref}let p=null;if(e.jsFiles!=null&&Object.keys(e.jsFiles).length>0){let f=App(e.jsFiles);a.set(f.hash,f.buf),p=f.ref}return{localeEntry:{root:e.config.root??e.config.navigation,pages:c,config:l,apiManifest:u,jsFiles:p,fileManifest:ANg({agents:e.config.agents,fileManifest:n,fileIdToPath:i}),redirects:null,locale:s??e.config.translations?.defaultLocale??"en",git:t},blobs:a}}async function xpp({docsDefinition:e,organization:t,domain:r,basepath:n,basepathAware:i,previewId:o,customDomains:s,git:a,token:c,fdrOrigin:l,headers:u,context:p,apiDefinitions:d,fileManifest:f,filePaths:m,fileIdToPath:g,editThisPage:A,resolver:y}){let{localeEntry:I,blobs:C}=qGe({docsDefinition:e,git:a,apiDefinitions:d,fileManifest:f,fileIdToPath:g,editThisPage:A}),x=await owt({docsDefinition:e,git:a,apiDefinitions:d,fileManifest:f,fileIdToPath:g,editThisPage:A,resolver:y,context:p});for(let ue of x)for(let[oe,me]of ue.blobs)C.set(oe,me);let{createDocsLedgerClient:S}=await Promise.resolve().then(()=>(qZt(),rpp)),B=S({baseUrl:l,token:c,headers:u}),D=[I,...x.map(ue=>ue.localeEntry)],R={orgId:t,domain:r,basepath:n??"",...i&&{basepathAware:!0},customDomains:s??[],previewId:o??null,defaultLocale:I.locale,locales:D};p.logger.debug("[ledger] Registering deployment...");let O=performance.now(),z=await B.register(R),Y=performance.now()-O;p.logger.debug(`[ledger] Registered in ${Y.toFixed(0)}ms \u2014 hash=${z.deploymentHash}, missing=${z.missingContent.length} blobs`),await jTs(z.missingContent,C,p,m),p.logger.debug("[ledger] Finishing deployment...");let $=performance.now(),ee=await B.finish(R),se=performance.now()-$;if(p.logger.debug(`[ledger] Finished in ${se.toFixed(0)}ms \u2014 deploymentId=${ee.deploymentId}, reused=${ee.reusedDeployment}`),ee.translationsProcessed!=null)for(let ue of ee.translationsProcessed)p.logger.debug(`[ledger] Locale "${ue.locale}": ${ue.segmentsAdded} segment(s) added`);return ee}async function jTs(e,t,r,n){if(e.length>0){r.logger.debug(`[ledger] Uploading ${e.length} missing blobs...`);let i=performance.now(),o=await WB(uNg,[...e],async({hash:l,uploadUrl:u})=>{let p=t.get(l),d="application/octet-stream";if(p==null&&n!=null){let f=n.get(l);if(f!=null){p=await(0,Epp.readFile)(f);let m=Ipp.lookup(f);m!==!1&&(d=m)}}return p==null?(r.logger.warn(`[ledger] Server requested blob ${l} but we don't have it \u2014 skipping`),"skipped"):yNg(p,u,l,d,r)}),s=o.filter(l=>l==="uploaded").length,a=o.filter(l=>l==="already_exists").length,c=performance.now()-i;r.logger.debug(`[ledger] Upload complete in ${c.toFixed(0)}ms \u2014 ${s} uploaded, ${a} already in store`)}else r.logger.debug("[ledger] All content already in CAS \u2014 no uploads needed")}async function yNg(e,t,r,n,i){let o=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);for(let s=0;s<=NTs;s++){let a=await fetch(t,{method:"PUT",headers:{"Content-Type":n},body:o});if(a.ok)return"uploaded";if(a.status===412)return i.logger.debug(`[ledger] Blob ${r} already exists in store \u2014 skipping`),"already_exists";if(a.status===403){let u=await a.text();throw new Error(`[ledger] Presigned URL rejected for ${r} (expired or signature mismatch): ${u}`)}if(a.status===400){let u=await a.text();throw new Error(`[ledger] Content integrity check failed for ${r}: ${u}`)}if((a.status===429||a.status>=500)&&s<NTs){let u=fNg*2**s;i.logger.debug(`[ledger] Upload ${r} got ${a.status}, retrying in ${u}ms (attempt ${s+1}/${NTs})`),await Xp(u);continue}let l=await a.text();throw new Error(`[ledger] S3 upload failed for ${r}: ${a.status} ${l}`)}throw new Error(`[ledger] Upload exhausted retries for ${r}`)}function ypp(e,t,r){try{let n=g7(e,sn.ApiDefinitionId(t),new A7({snippetsConfigWithSdkId:{},snippetsBySdkId:{},snippetTemplatesByEndpoint:{},snippetTemplatesByEndpointId:{},snippetsBySdkIdAndEndpointId:{}}));return y7(n)}catch(n){r.logger.debug(`[ledger] Failed to convert API definition "${t}" to read form: ${String(n)}`);return}}function bNg({baseApiDefinitions:e,translatedSpecs:t,context:r}){let n=new Map(e);for(let[i,o]of t)try{let s=aO({ir:o.ir,snippetsConfig:o.snippetsConfig,playgroundConfig:o.playgroundConfig,graphqlOperations:o.graphqlOperations,graphqlTypes:o.graphqlTypes,context:r,apiNameOverride:o.apiName});n.set(i,s)}catch(s){r.logger.warn(`[ledger] Failed to convert translated API definition for API "${i}": ${String(s)}. Falling back to base (untranslated) API.`)}return n}async function owt({docsDefinition:e,git:t,apiDefinitions:r,fileManifest:n,fileIdToPath:i,editThisPage:o,resolver:s,context:a}){if(s==null)return[];let c=s.getTranslationPages(),l=s.getTranslationNavigationOverlays();if(c==null||Object.keys(c).length===0)return[];let u=s.getTranslatedApiSpecs(),p={};if(u.size>0)for(let[m,g]of r){let A=ypp(g,m,a);A!=null&&(p[m]=A)}let d=Object.entries(c);a.logger.debug(`[ledger] Building ${d.length} translation locale(s)...`);let{buildTranslatedDocsDefinition:f}=await Promise.resolve().then(()=>(gpp(),hpp));return WB(pNg,d,async([m,g])=>{let A=await f({docsDefinition:e,locale:m,localePages:g,translationNavigationOverlays:l,resolver:s,context:a}),y=u.get(m),I=r,C=new Set;if(y!=null&&y.size>0&&(I=bNg({baseApiDefinitions:r,translatedSpecs:y,context:a}),A.config.root!=null)){let B={};for(let[O]of y){let z=I.get(O);if(z!=null){let Y=ypp(z,O,a);Y!=null&&(B[O]=Y)}}let D=VVe(A.config.root,p,B);if(D.size>0){a.logger.warn(`Translated API definition(s) [${Array.from(D).join(", ")}] for locale "${m}" diverge from the default-locale spec (e.g. changed OpenAPI tag names, operationIds, or paths, or a missing/added endpoint), so they can't be fully matched to the navigation tree. Serving the default-locale API for those (localized sidebar titles are still applied where they can be matched). For fully localized API reference content, translate only human-readable text and keep tag names/operationIds/paths identical to the base spec.`);for(let O of D){let z=r.get(O);z!=null&&I.set(O,z)}}let R=new Set(Object.keys(B).filter(O=>!D.has(O)));C=new Set(Array.from(R).filter(O=>I.get(O)!==r.get(O))),Object.keys(B).length>0&&(A.config.root=GVe(A.config.root,p,B,{rewritableApiIds:R}))}A.config.root=JVe(A.config.root,{translatedApiDefinitionIds:C});let{localeEntry:x,blobs:S}=qGe({docsDefinition:A,git:t,apiDefinitions:I,fileManifest:n,fileIdToPath:i,editThisPage:o,locale:m});return{locale:m,localePages:g,translatedDefinition:A,localeEntry:x,blobs:S}})}qZt();async function Spp({docsDefinition:e,organization:t,basePath:r,previewId:n,git:i,token:o,fdrOrigin:s,headers:a,context:c,apiDefinitions:l,fileManifest:u,filePaths:p,fileIdToPath:d,editThisPage:f,resolver:m}){let{localeEntry:g,blobs:A}=qGe({docsDefinition:e,git:i,apiDefinitions:l,fileManifest:u,fileIdToPath:d,editThisPage:f}),y=await owt({docsDefinition:e,git:i,apiDefinitions:l,fileManifest:u,fileIdToPath:d,editThisPage:f,resolver:m,context:c});for(let Y of y)for(let[$,ee]of Y.blobs)A.set($,ee);let I=[g,...y.map(Y=>Y.localeEntry)],C=Fbi({baseUrl:s,token:o,headers:a});c.logger.debug("[ledger-preview] Registering preview deployment...");let x=performance.now(),S={orgId:t,previewId:n??null,basePath:r??"",defaultLocale:g.locale,locales:I,root:g.root,pages:g.pages,apiManifest:g.apiManifest,config:g.config,fileManifest:g.fileManifest,jsFiles:g.jsFiles,redirects:g.redirects,locale:g.locale,version:g.version,repo:g.repo,git:i},B=await C.previewRegister(S),D=performance.now()-x;c.logger.debug(`[ledger-preview] Registered in ${D.toFixed(0)}ms \u2014 hash=${B.deploymentHash}, preview=${B.previewUrl}, missing=${B.missingContent.length} blobs`),await jTs(B.missingContent,A,c,p),c.logger.debug("[ledger-preview] Finishing preview deployment...");let R=performance.now(),O=await C.finish({orgId:t,domain:B.domain,basepath:B.basepath,customDomains:[],previewId:B.previewId,defaultLocale:g.locale,locales:I}),z=performance.now()-R;if(c.logger.debug(`[ledger-preview] Finished in ${z.toFixed(0)}ms \u2014 deploymentId=${O.deploymentId}, reused=${O.reusedDeployment}`),O.translationsProcessed!=null)for(let Y of O.translationsProcessed)c.logger.debug(`[ledger-preview] Locale "${Y.locale}": ${Y.segmentsAdded} segment(s) added`);return{previewUrl:B.previewUrl,deploymentId:O.deploymentId}}It();async function wpp({fn:e,maxRetries:t,baseDelayMs:r,jitterFactor:n=0,isRetryable:i=()=>!0,logger:o,label:s,delayFn:a=Xp}){let c;for(let l=0;l<=t;l++)try{return await e()}catch(u){if(c=u,!i(u)||l>=t)throw u;let p=n>0?1+(Math.random()-.5)*n:1,d=Math.round(r*2**l*p);s!=null&&o.warn(`${s} (attempt ${l+1}/${t+1}), retrying in ${d}ms...`),await a(d)}throw c}var ENg=10,Tpp=10,Lbi=parseInt(process.env.FERN_DOCS_ASSET_HASH_CONCURRENCY??"32",10),INg=3,vNg=1e3,CNg=.5;function xNg(e){if(e==null)return"Unknown error";let t=oi(e),r=e.data;if(r?.issues!=null&&Array.isArray(r.issues)&&r.issues.length>0){let n=r.issues.map(i=>{let o=i.path?.join(".")??"",s=i.message??"invalid";return o?` - ${o}: ${s}`:` - ${s}`}).join(`
|
|
@@ -4115,7 +4116,7 @@ Please ensure you have membership at https://dashboard.buildwithfern.com, and as
|
|
|
4115
4116
|
|
|
4116
4117
|
Please ensure you have membership at https://dashboard.buildwithfern.com, and ask a team member for an invite if not.`}function DNg(e){if(e==null)return{code:void 0,message:void 0};let t=e.body;if(t!=null&&typeof t=="object"){let n=typeof t.code=="string"?t.code:void 0,i=typeof t.message=="string"?t.message:void 0;return{code:n,message:i}}return{code:void 0,message:typeof t=="string"&&t.length>0?t:typeof e.errorMessage=="string"?e.errorMessage:typeof e.message=="string"?e.message:void 0}}function RNg(e){try{return new URL(xN(e)).pathname}catch{return}}async function kNg({fdr:e,workspace:t,apiWorkspaces:r,organization:n,context:i,snippetsConfig:o}){if(!t)return;let s=await NNg({fdr:e,generators:zpp({workspace:t,apiWorkspaces:r,context:i}),snippetsConfig:o,context:i});if(Object.keys(s).length===0){i.logger.debug("[SDK Dynamic IR] No snippet configs found, skipping S3 check");return}try{let a=Object.fromEntries(Object.entries(s).map(([p,d])=>[p,{packageName:d.packageName,version:d.version}])),l=(await e.api.register.checkSdkDynamicIrExists({orgId:sn.OrgId(n),snippetConfiguration:a})).existingDynamicIrs??{};if(Object.keys(l).length===0){i.logger.debug("[SDK Dynamic IR] No existing SDK dynamic IRs found in S3");return}let u={};for(let[p,d]of Object.entries(l??{}))try{i.logger.debug(`Downloading existing SDK dynamic IR for ${p}...`);let f=await fetch(d.downloadUrl);if(f.ok){let m=await f.json();u[p]={dynamicIR:m},i.logger.debug(`Successfully downloaded SDK dynamic IR for ${p}`)}else i.logger.warn(`Failed to download SDK dynamic IR for ${p}: ${f.status}`)}catch(f){i.logger.warn(`Error downloading SDK dynamic IR for ${p}: ${f}`)}return Object.keys(u).length>0?u:void 0}catch(a){i.logger.debug(`Error checking for existing SDK dynamic IRs: ${a}`);return}}function Ubi(e){return e.replace(/^https:\/\//,"")}function FNg({generatorInvocation:e,dynamicGeneratorConfig:t}){let r=got(e);if(r==null&&t?.outputConfig.type==="publish"){let n=t.outputConfig.value;switch(n.type){case"npm":case"nuget":case"pypi":case"rubygems":case"crates":r=n.packageName;break;case"maven":r=n.coordinate;break;case"go":case"swift":r=n.repoUrl;break}}if(!(r==null||r===""))return e.language==="go"?Ubi(r):r}async function NNg({fdr:e,generators:t,snippetsConfig:r,context:n}){let i={},o=[{language:"typescript",snippetName:r.typescriptSdk?.package??void 0,explicitVersion:r.typescriptSdk?.version??void 0},{language:"python",snippetName:r.pythonSdk?.package??void 0,explicitVersion:r.pythonSdk?.version??void 0},{language:"java",snippetName:r.javaSdk?.coordinate??void 0,explicitVersion:r.javaSdk?.version??void 0},{language:"go",snippetName:r.goSdk?.githubRepo&&Ubi(r.goSdk?.githubRepo),explicitVersion:r.goSdk?.version??void 0},{language:"csharp",snippetName:r.csharpSdk?.package??void 0,explicitVersion:r.csharpSdk?.version??void 0},{language:"ruby",snippetName:r.rubySdk?.gem??void 0,explicitVersion:r.rubySdk?.version??void 0},{language:"php",snippetName:r.phpSdk?.package??void 0,explicitVersion:r.phpSdk?.version??void 0},{language:"swift",snippetName:r.swiftSdk?.package??void 0,explicitVersion:r.swiftSdk?.version??void 0},{language:"rust",snippetName:r.rustSdk?.package??void 0,explicitVersion:r.rustSdk?.version??void 0}];for(let s of o){if(!s.snippetName)continue;let a=s.explicitVersion??void 0;a||(a=(await LNg({fdr:e,generators:t,language:s.language,snippetName:s.snippetName,context:n}))?.version),i[s.language]={packageName:s.snippetName,version:a},a||n.logger.debug(`[SDK Dynamic IR] ${s.language}: no version specified, will use latest`)}return i}function jNg({generators:e,language:t,snippetName:r}){let n=c=>t==="go"?Ubi(c):c,i=(c,l,u)=>({generatorName:c.name,generatorPackage:l,githubRepository:c.outputMode.type==="githubV2"?`${c.outputMode.githubV2.owner}/${c.outputMode.githubV2.repo}`:void 0,matchesSnippetName:u}),o=e.filter(c=>c.language===t),s=n(r);for(let c of o){let l=got(c);if(l!=null&&n(l)===s)return i(c,l,!0)}for(let c of o){let l=zr.getPackageName({generatorInvocation:c});if(l!=null)return i(c,l,!1)}let a=Qpp(o);if(a!=null)return{...i(a,r,!0),assumedFromSnippetName:!0}}function zpp({workspace:e,apiWorkspaces:t,context:r}){let n=e.generatorsConfiguration?.groups.flatMap(s=>s.generators)??[],i=t.filter(s=>s.workspaceName!==e.workspaceName),o=i.flatMap(s=>s.generatorsConfiguration?.groups.flatMap(a=>a.generators.map(c=>({generatorInvocation:c,from:s.workspaceName})))??[]);return n.length===0&&r.logger.debug(`[SDK Dynamic IR] API workspace "${e.workspaceName??""}" has no SDK generators in its generators.yml${e.generatorsConfiguration==null?" (none loaded)":""}; ${o.length>0?`considering ${o.length} generator(s) from ${[...new Set(o.map(s=>s.from))].join(", ")}`:`no other API workspace in the fern folder has generators either (${i.length} other workspace(s))`}`),[...n,...o.map(s=>s.generatorInvocation)]}function Qpp(e){let[t]=e;if(!(e.length!==1||t==null))return got(t)==null?t:void 0}function zNg({language:e,ownGenerators:t,candidates:r}){let n=o=>o.filter(s=>s.language===e),i=n(t);return Qpp(i.length>0?i:n(r))}function QNg(e){let t={};for(let r of e){let n="namespace"in r?r.namespace:void 0;typeof n=="string"&&n.length>0&&(t[oo(n)]=n)}return Object.keys(t).length>0?t:void 0}function MNg({dynamicGeneratorConfig:e,language:t,namespaces:r}){if(t!=="cli"||r==null||e==null)return e;let n=e.customConfig;return{...e,customConfig:{...n!=null&&typeof n=="object"?n:{},namespaces:r}}}function QTs(e){let t=e.config,r=typeof t=="object"&&t!==null?Object.keys(t).join(","):"none";return`${e.name} (language=${e.language??"unknown"}, output=${e.outputMode.type}, publish-target=${zr.getPackageName({generatorInvocation:e})??"none"}, config keys=[${r}])`}async function LNg({fdr:e,generators:t,language:r,snippetName:n,context:i}){let o;switch(r){case"csharp":o="Csharp";break;case"go":o="Go";break;case"java":o="Java";break;case"python":o="Python";break;case"ruby":o="Ruby";break;case"typescript":o="TypeScript";break;case"php":o="Php";break;case"swift":o="Swift";break;default:return}let s=jNg({generators:t,language:r,snippetName:n});if(s==null){let l=t.filter(u=>u.language===r);i.logger.debug(`[SDK Dynamic IR] ${r}: none of ${l.length} ${r} generator(s) in generators.yml resolved a package name (checked publish target and generator config): ${l.map(QTs).join("; ")||"no generators for this language"}`);return}s.assumedFromSnippetName?i.logger.debug(`[SDK Dynamic IR] ${r}: ${s.generatorName} is the only ${r} generator and has no package name in config; assuming it publishes snippets package "${n}"`):s.matchesSnippetName||i.logger.debug(`[SDK Dynamic IR] ${r}: no generator resolved package "${n}"; computing version against publish target "${s.generatorPackage}" of ${s.generatorName}`);let{generatorPackage:a,githubRepository:c}=s;try{let l=await e.sdks.computeSemanticVersion({githubRepository:c,language:o,package:a});return i.logger.debug(`[SDK Dynamic IR] ${r}: computed version ${l.version} for package "${a}"`),{version:l.version,generatorPackage:a}}catch(l){i.logger.debug(`[SDK Dynamic IR] ${r}: error computing version: ${l}`);return}}async function _Ng({workspace:e,apiWorkspaces:t,organization:r,context:n,snippetsConfig:i,skipLanguages:o=new Set,pool:s}){let a=[];if(!e)return;let c={typescript:i.typescriptSdk?.package,python:i.pythonSdk?.package,java:i.javaSdk?.coordinate,go:i.goSdk?.githubRepo&&Ubi(i.goSdk?.githubRepo),csharp:i.csharpSdk?.package,ruby:i.rubySdk?.gem,php:i.phpSdk?.package,swift:i.swiftSdk?.package,rust:i.rustSdk?.package,cli:i.cliSdk?.package},l=zpp({workspace:e,apiWorkspaces:t,context:n}),u=e.generatorsConfiguration?.groups.flatMap(m=>m.generators)??[],p=QNg(t.find(m=>m instanceof gl&&m.workspaceName===e.workspaceName)?.specs??[]);p!=null&&n.logger.debug(`[SDK Dynamic IR] cli namespaces: ${JSON.stringify(p)}`);for(let m of l){let g=MNg({dynamicGeneratorConfig:hGe({apiName:e.workspaceName??"",organization:r,generatorInvocation:m}),language:m.language,namespaces:p}),A=FNg({generatorInvocation:m,dynamicGeneratorConfig:g});if(!m.language)continue;if(o.has(m.language)){n.logger.debug(`Skipping dynamic IR generation for ${m.language} (using existing SDK dynamic IR)`);continue}let y=c[m.language];if(y!=null){if(A==null){if(zNg({language:m.language,ownGenerators:u,candidates:l})!==m){n.logger.debug(`[SDK Dynamic IR] ${m.language}: ${QTs(m)} has no resolvable package name, cannot match snippets package "${y}"`);continue}n.logger.debug(`[SDK Dynamic IR] ${m.language}: ${QTs(m)} is the only ${m.language} generator and has no package name in config; assuming it publishes snippets package "${y}"`),A=y}if(y!==A){n.logger.debug(`[SDK Dynamic IR] ${m.language}: generator "${m.name}" package "${A}" does not match snippets package "${y}"`);continue}a.push({language:m.language,smartCasing:m.smartCasing,smartCasingDigitWordBoundary:m.smartCasingDigitWordBoundary,packageName:A,dynamicGeneratorConfig:g})}}let d=new Set,f=[];for(let[m,g]of await VNg({workspace:e,generatorJobs:a,context:n,pool:s}))g!=null?(f.push([m,g]),d.add(m)):n.logger.debug(`Failed to create dynamic IR for ${m}`);for(let[m,g]of Object.entries(c))m&&g&&!d.has(m)&&!o.has(m)&&n.logger.warn(UNg({language:m,packageName:g,workspaceName:e.workspaceName,otherApiWorkspaceCount:t.length}));if(d.size>0)return()=>{let m={};for(let[g,A]of f)m[g]={dynamicIR:A()};return m}}function UNg({language:e,packageName:t,workspaceName:r,otherApiWorkspaceCount:n}){return`No ${e} SDK snippets for package \`${t}\`: no sdk-gen build was found, and no generator in the generators.yml of this fern folder (checked ${r?`${r}/`:""}generators.yml and the other ${n} API workspace(s)) publishes that package.`}async function VNg({workspace:e,generatorJobs:t,context:r,pool:n}){if(t.length===0)return[];if(n!=null)try{let{results:i,logs:o}=await n.run(e,t);for(let[s,a]of o)r.logger.log(s,...a);return i.map(([s,a])=>[s,a==null?void 0:()=>w_u(a)])}catch(i){if(n.isTerminated)throw i;r.logger.debug(`Dynamic IR worker failed (${String(i)}); generating in-process`)}return Bmi({workspace:e,generators:t,context:r}).map(([i,o])=>[i,o==null?void 0:()=>o])}async function GNg({dynamicIRs:e,dynamicIRUploadUrls:t,context:r,apiId:n}){if(Object.keys(t).length>0)for(let[i,o]of Object.entries(t)){let s=e[i]?.dynamicIR;if(s){let a=JSON.stringify(s);try{(await fetch(o.uploadUrl,{method:"PUT",body:a,headers:{"Content-Type":"application/octet-stream","Content-Length":Buffer.byteLength(a,"utf8").toString()}})).ok?r.logger.debug(`Uploaded dynamic IR for ${n}:${i}`):r.logger.warn(`Failed to upload dynamic IR for ${n}:${i}`)}catch(c){r.logger.warn(`Network error uploading dynamic IR for ${n}:${i}: ${c}`)}}else r.logger.warn(`Could not find matching dynamic IR to upload for ${n}:${i}`)}}async function qNg({docsDefinition:e,isPreview:t,context:r}){e.config.aiChatConfig==null||t||r.logger.warn(le.yellow("Enabling Ask Fern from docs.yml is deprecated. Please enable it from the Fern dashboard instead."))}function WNg(e){let t=e,r=t?.content,n=t?.statusCode??r?.statusCode;return n==null?!0:n===429||n>=500}function Mpp(e){let t=e,r=t?.content;return{errorType:t?.error,statusCode:t?.statusCode??r?.statusCode,reason:r?.reason,errorMessage:r?.errorMessage??r?.message,body:r?.body,cause:r?.cause,rawError:e}}Ode();Uo();It();fd();Dt();o4();NU();var bfp=require("fs/promises");tr();cQ();cn();var Lpp=require("fs"),Vbi=require("fs/promises"),_pp=require("stream/promises");async function Upp({snippetsS3PreSignedReadUrl:e,absolutePathToLocalSnippetJSON:t,context:r}){try{await HNg({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}),r.logger.info(le.green(`Downloaded to ${t}`))}catch{r.logger.debug(le.yellow("Failed to download snippet.json from output."))}}async function HNg({s3PreSignedReadUrl:e,absolutePathToLocalOutput:t}){let r=await Nd.get(e,{responseType:"stream"});await Ut(t)&&await(0,Vbi.rm)(t,{recursive:!0}),await(0,Vbi.mkdir)(Vr(t),{recursive:!0}),await(0,_pp.pipeline)(r.data,(0,Lpp.createWriteStream)(t))}function Vpp(e,t){if(e.payloadKind!=="sdk-config-v1"||e.configKind!=="sdk-config-v1")return;if(t.specIndexes.length===0)throw new Error("SDK Config v1 requires at least one effective Fern source spec");let r=new Set;for(let n of t.specIndexes){if(r.has(n))throw new Error(`Fern target source selection contains duplicate manifest index ${n}`);r.add(n);let i=t.manifest.specs[n];if(i==null)throw new Error(`Fern source manifest does not contain selected index ${n}`);if(!KNg(i.type))throw new Error(`Generator ${e.generatorId} ${e.requestedVersion??"(unpinned)"} requires SDK Config v1, but selected source ${n} cannot be represented downstream: SDK Config generation does not support Fern source type ${i.type} (${i.specPath}). Use an OpenAPI, AsyncAPI, or GraphQL source for this generator version.`)}}function KNg(e){return e==="openapi"||e==="asyncapi"||e==="graphql"}It();function JNg(e){let t=e.outputMode;if(t.type==="github")return t.publishInfo;if(t.type==="githubV2")return t.githubV2.publishInfo}function Gpp(e){return e.type==="nuget"||e.type==="rubygems"}function qpp(e){let t=JNg(e);if(!(t==null||!Gpp(t)))return t.apiKey}function MTs(e,t){let r=e.outputMode;return r.type==="github"&&r.publishInfo!=null?{...e,outputMode:{...r,publishInfo:t(r.publishInfo)}}:r.type==="githubV2"&&r.githubV2.publishInfo!=null?{...e,outputMode:{...r,githubV2:{...r.githubV2,publishInfo:t(r.githubV2.publishInfo)}}}:e}function LTs(e,t){return Gpp(e)?{...e,apiKey:t}:e}function Wpp(e,t,r={}){let n=qpp(e);if(n==null)return jp(e,t,r);let i=MTs(e,s=>LTs(s,void 0)),o=jp(i,t,r);return MTs(o,s=>LTs(s,n))}function Hpp(e,t,r={}){let n=qpp(e);if(n==null)return e;let i=jp(n,t,r);return MTs(e,o=>LTs(o,i))}Uo();tr();async function Kpp({generatorInvocation:e,context:t}){if(e.absolutePathToLocalOutput==null)return;let r=Re(e.absolutePathToLocalOutput,be.of(F1));if(await Ut(r))return t.logger.debug(`Auto-discovered ${F1} at ${r}`),r}yc();P2();Uo();ef();It();Mm();var kB=Ae(jge(),1);ep();jn();tc();fd();Nhe();Dt();yc();Uo();ef();It();tr();Dt();NU();cQ();var tfp=Ae(AJe(),1),Hbi=require("fs/promises");Ko();var rfp=Ae(Of(),1),nfp=require("util"),ifp=require("zlib");ef();async function Gbi({intermediateRepresentation:e,generatorInvocation:t,context:r,irVersionOverride:n}){let i=await LQe(t),o=n??(i==null?void 0:`v${i}`),s={name:t.name,version:t.version};return o==null?R7t({intermediateRepresentation:e,context:r,targetGenerator:s}):hos({intermediateRepresentation:e,context:r,irVersion:o,targetGenerator:s})}It();tr();var Ypp=require("crypto"),Wbi=require("fs/promises"),qbi=Ae(require("path"),1),YNg=new Set(["openapi","asyncapi","overrides","overlays"]);async function Xpp({generatorsConfiguration:e,generatorInvocation:t}){let r=Zpp($Ng(t.raw??{name:t.name,version:t.version,config:t.config}));if(e==null)return{specs:[],generatorsYml:void 0,generatorConfigSha256:r,generatorName:t.name,generatorVersion:t.version};let n=e.absolutePathToConfiguration,i=qbi.default.dirname(n),o=new Set,s=t.apiOverride?.specs;s!=null?UTs(s,o):e.api!=null&&XNg(e.api,o);let a=[];for(let c of[...o].sort()){let l=qbi.default.resolve(i,c),u=await Jpp(l,i);u!=null&&a.push(u)}return{specs:a,generatorsYml:await Jpp(n,i),generatorConfigSha256:r,generatorName:t.name,generatorVersion:t.version}}function XNg(e,t){switch(e.type){case"singleNamespace":_Ts(e.definitions,t);return;case"multiNamespace":_Ts(e.rootDefinitions??[],t);for(let r of Object.values(e.definitions))_Ts(r,t);return;case"conjure":t.add(e.pathToConjureDefinition);return;default:rt(e)}}function _Ts(e,t){for(let r of e){let n=ZNg(r.schema);n!=null&&!VTs(n)&&t.add(n);for(let i of[r.overrides,r.overlays].flat())i!=null&&!VTs(i)&&t.add(i)}}function ZNg(e){switch(e.type){case"oss":case"openrpc":case"graphql":return e.path;case"protobuf":return;default:return rt(e)}}function UTs(e,t){if(Array.isArray(e)){for(let r of e)UTs(r,t);return}if(!(e==null||typeof e!="object"))for(let[r,n]of Object.entries(e))if(YNg.has(r))for(let i of Array.isArray(n)?n:[n])typeof i=="string"&&!VTs(i)&&t.add(i);else UTs(n,t)}async function Jpp(e,t){try{if(!(await(0,Wbi.stat)(e)).isFile())return}catch{return}return{path:py(qbi.default.relative(t,e)),sha256:Zpp(await(0,Wbi.readFile)(e))}}function VTs(e){return/^https?:\/\//i.test(e)}function Zpp(e){return(0,Ypp.createHash)("sha256").update(e).digest("hex")}function $Ng(e){return JSON.stringify(GTs(e))??"null"}function GTs(e){return Array.isArray(e)?e.map(GTs):e!=null&&typeof e=="object"?Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0).sort(([t],[r])=>t<r?-1:t>r?1:0).map(([t,r])=>[t,GTs(r)])):e}It();Dt();var ejg=2e3,$pp=12e4,qTs=5,tjg=.5,WGe=class e extends Error{retryAfterSeconds;constructor(t){super("Received 429 Too Many Requests"),Object.setPrototypeOf(this,e.prototype),this.retryAfterSeconds=t}};async function efp({fn:e,retryRateLimited:t,logger:r,onRateLimitedWithoutRetry:n,delayFn:i=Xp}){if(!t)try{return await e()}catch(o){if(o instanceof WGe)return n();throw o}for(let o=0;o<=qTs;o++)try{return await e()}catch(s){if(s instanceof WGe&&o<qTs){let a=Math.min(ejg*2**o,$pp),c=s.retryAfterSeconds!=null?s.retryAfterSeconds*1e3:void 0,l=c!=null?Math.max(a,c):a,u=1+(Math.random()-.5)*tjg,p=Math.round(Math.min(Math.max(l*u,c??0),$pp));r.warn(`Received 429 Too Many Requests. Retrying in ${(p/1e3).toFixed(1)}s (attempt ${o+1}/${qTs})...`),await i(p)}else throw s}throw new w({message:"Exceeded maximum retries for 429 Too Many Requests.",code:w.Code.NetworkError})}var rjg=(0,nfp.promisify)(ifp.gzip);async function ofp({projectConfig:e,workspace:t,organization:r,intermediateRepresentation:n,generatorInvocation:i,version:o,context:s,shouldLogS3Url:a,token:c,whitelabel:l,replay:u,irVersionOverride:p,absolutePathToPreview:d,fiddlePreview:f,pushPreviewBranch:m,fernignorePath:g,skipFernignore:A,retryRateLimited:y,automationMode:I,autoMerge:C,skipIfNoDiff:x,verify:S,loginCommand:B="fern login",specsTarGzBuffer:D}){let R;if(A)R="";else if(g!=null)try{R=await(0,Hbi.readFile)(g,"utf-8")}catch(z){s.failAndThrow(`Failed to read fernignore file at ${g}: ${z}`,void 0,{code:w.Code.ConfigError})}let O=await efp({fn:()=>njg({projectConfig:e,workspace:t,organization:r,generatorInvocation:i,version:o,context:s,shouldLogS3Url:a,token:c,whitelabel:l,replay:u,absolutePathToPreview:d,fiddlePreview:f,pushPreviewBranch:m,fernignoreContents:R,automationMode:I,autoMerge:C,skipIfNoDiff:x,verify:S,loginCommand:B}),retryRateLimited:y,logger:s.logger,onRateLimitedWithoutRetry:()=>s.failAndThrow("Received 429 Too Many Requests. Re-run with --retry-rate-limited to automatically retry.",void 0,{code:w.Code.NetworkError})});return await ijg({intermediateRepresentation:n,job:O,context:s,generatorInvocation:i,irVersionOverride:p,specsTarGzBuffer:D,generatorsConfiguration:t.generatorsConfiguration}),O}async function njg({projectConfig:e,workspace:t,organization:r,generatorInvocation:n,version:i,context:o,shouldLogS3Url:s,token:a,whitelabel:c,replay:l,absolutePathToPreview:u,fiddlePreview:p,pushPreviewBranch:d,fernignoreContents:f,automationMode:m,autoMerge:g,skipIfNoDiff:A,verify:y,loginCommand:I}){let C=gpe({token:a.value}),x={id:n.name,version:n.version,outputMode:n.outputMode,customConfig:Dee(n.config),publishMetadata:n.publishMetadata},S={apiName:t.definition.rootApiFile.contents.name,version:i,organizationName:r,generators:[x],uploadToS3:ljg({outputMode:n.outputMode,generatorInvocation:n,absolutePathToPreview:u,shouldLogS3Url:s}),whitelabel:c,replay:l!=null?{enabled:l.enabled}:void 0,preview:p??u!=null,pushPreviewBranch:d,fernignoreContents:f,skipIfNoDiff:A,verify:y,automationMode:m,autoMerge:g===!0||zr.isGithubAutoMergeEnabled(n.raw?.github),runId:process.env.FERN_RUN_ID},B=await C.remoteGen.createJobV3(S);if(!B.ok){let D=B.error;if(D?.content?.reason==="status-code"&&D.content.statusCode===429){let O=ajg(D);throw new WGe(O)}let R=sjg(D);return R!=null?o.failAndThrow(R,void 0,{code:w.Code.ConfigError}):cjg(D)._visit({illegalApiNameError:()=>o.failAndThrow("API name is invalid: "+t.definition.rootApiFile.contents.name,void 0,{code:w.Code.ConfigError}),illegalApiVersionError:()=>o.failAndThrow("API version is invalid: "+i,void 0,{code:w.Code.ConfigError}),cannotPublishToNpmScope:({validScope:O,invalidScope:z})=>o.failAndThrow(`You do not have permission to publish to ${z} (expected ${O})`,void 0,{code:w.Code.AuthError}),cannotPublishToMavenGroup:({validGroup:O,invalidGroup:z})=>o.failAndThrow(`You do not have permission to publish to ${z} (expected ${O})`,void 0,{code:w.Code.AuthError}),cannotPublishPypiPackage:({validPrefix:O,invalidPackageName:z})=>o.failAndThrow(`You do not have permission to publish to ${z} (expected ${O})`,void 0,{code:w.Code.AuthError}),generatorsDoNotExistError:O=>o.failAndThrow("Generators do not exist: "+O.nonExistentGenerators.map(z=>`${z.id}@${z.version}`).join(", "),void 0,{code:w.Code.ConfigError}),insufficientPermissions:()=>a.type==="guest"?o.failAndThrow(O7e({statusCode:403,code:void 0,message:void 0}),void 0,{code:w.Code.AuthError}):o.failAndThrow(`You do not have permission to run this generator for organization '${r}'. Please run '${I}' to ensure you are logged in with the correct account.
|
|
4117
4118
|
|
|
4118
|
-
Please ensure you have membership at https://dashboard.buildwithfern.com, and ask a team member for an invite if not.`,void 0,{code:w.Code.AuthError}),orgNotConfiguredForWhitelabel:()=>o.failAndThrow("Your org is not configured for white-labeling. Please reach out to support@buildwithfern.com.",void 0,{code:w.Code.AuthError}),branchDoesNotExist:O=>o.failAndThrow(`Branch ${O.branch} does not exist in repository ${O.repositoryOwner}/${O.repositoryName}`,void 0,{code:w.Code.ConfigError}),rateLimitExceeded:()=>{throw new WGe},_other:O=>{if(o.logger.debug(`Failed to create job: ${JSON.stringify(O)}`),a.type==="guest"){let Y=yDt(O);if(ADt(Y))return o.failAndThrow(O7e(Y),void 0,{code:w.Code.AuthError})}let z=ojg(O);return z!=null?o.failAndThrow(z,void 0,{code:w.Code.NetworkError}):o.failAndThrow("Failed to create job. Please try again or contact support@buildwithfern.com for assistance.",void 0,{code:w.Code.NetworkError})}})}return B.body}async function ijg({intermediateRepresentation:e,generatorInvocation:t,job:r,context:n,irVersionOverride:i,specsTarGzBuffer:o,generatorsConfiguration:s}){let a=await Gbi({intermediateRepresentation:e,generatorInvocation:t,context:n,irVersionOverride:i}),c=new tfp.default,l=await Ocr(a,{onWrite:f=>{n.logger.debug("Wrote IR to disk: "+f)}}),u=new TextEncoder().encode(l),p=await rjg(u);n.logger.debug(`Compressed IR from ${u.byteLength} bytes to ${p.length} bytes (${((1-p.length/u.byteLength)*100).toFixed(1)}% reduction)`),c.append("ir",p,{filename:"ir.json",contentType:"application/octet-stream"}),o!=null&&(c.append("specs",o,{filename:"specs.tar.gz",contentType:"application/gzip"}),n.logger.debug(`Appended specs tar.gz (${o.length} bytes)`));try{let f=await Xpp({generatorsConfiguration:s,generatorInvocation:t});c.append("provenance",JSON.stringify(f),{filename:"provenance.json",contentType:"application/json"}),n.logger.debug(`Appended provenance inputs for ${f.specs.length} spec file(s)`)}catch(f){n.logger.debug(`Skipping provenance inputs: ${oi(f)}`)}let d=(0,rfp.default)(sMe(),`/api/remote-gen/jobs/${r.jobId}/start`);try{await Nd.post(d,c,{headers:c.getHeaders(),maxBodyLength:1/0})}catch(f){let m=f instanceof FVt?f.response?.data:f;n.logger.debug(`POST ${d} failed with ${JSON.stringify(f)}`),n.failAndThrow("Failed to start job",m,{code:w.Code.NetworkError})}}function ojg(e){let t;if(e?.reason==="status-code"?t=e.body:e?.content?.reason==="status-code"&&(t=e.content.body),typeof t?.content?.message=="string")return t.content.message;if(typeof t?.message=="string")return t.message}function sjg(e){let t=e?.content?.reason==="status-code"?e.content.body:void 0;return t?.error!=="GithubAppNotInstalled"?void 0:typeof t?.content?.message=="string"?t.content.message:`The Fern GitHub App is not installed on ${typeof t?.content?.repositoryName=="string"?t.content.repositoryName:"the target repository"}. Please install it (https://github.com/apps/fern-api) and try again.`}function ajg(e){let t=e?.content?.body?.content?.retryAfter;return typeof t=="number"&&t>0?t:void 0}function cjg(e){if(e?.content?.reason==="status-code"){let t=e.content.body;switch(t?.error){case"IllegalApiNameError":return Gr.remoteGen.createJobV3.Error.illegalApiNameError();case"IllegalApiVersionError":return Gr.remoteGen.createJobV3.Error.illegalApiVersionError(t.content);case"GeneratorsDoNotExistError":return Gr.remoteGen.createJobV3.Error.generatorsDoNotExistError(t.content);case"CannotPublishToNpmScope":return Gr.remoteGen.createJobV3.Error.cannotPublishToNpmScope(t.content);case"CannotPublishToMavenScope":return Gr.remoteGen.createJobV3.Error.cannotPublishToMavenGroup(t.content);case"CannotPublishPypiPackage":return Gr.remoteGen.createJobV3.Error.cannotPublishPypiPackage(t.content);case"InsufficientPermissions":return Gr.remoteGen.createJobV3.Error.insufficientPermissions(t.content);case"OrgNotConfiguredForWhitelabel":return Gr.remoteGen.createJobV3.Error.orgNotConfiguredForWhitelabel(t.content);case"BranchDoesNotExist":return Gr.remoteGen.createJobV3.Error.branchDoesNotExist(t.content)}}return e}function ljg({outputMode:e,generatorInvocation:t,absolutePathToPreview:r,shouldLogS3Url:n}){return e.type==="downloadFiles"||t.absolutePathToLocalSnippets!=null||r!=null||n}Dt();ef();var sfp=gpe();var ujg=3;function afp({job:e,taskId:t,taskHandler:r,context:n}){let i=0,o=async()=>{let s=await sfp.remoteGen.getJobStatus(e.jobId);if(s.ok)return s.body[t];n.logger.debug("Failed to get job status.",JSON.stringify(s.error.content))};return new Promise((s,a)=>{c();async function c(){try{let l=await o();if(l==null)i++,i===ujg&&n.failAndThrow(`Failed to get job status after ${i} attempts.`,void 0,{code:w.Code.NetworkError}),setTimeout(c,2e3+1e3*i);else{i=0;let u=await r.processUpdate(l);r.isFinished?s(u):setTimeout(c,2e3)}}catch(l){a(l)}}})}yc();tr();var cfp=Ae(Yn(),1),lfp=require("util"),ufp=require("zlib");var pjg=(0,lfp.promisify)(ufp.gzip),fjg=Zt.of("/tmp/fern-runtime/ir.json"),djg=Zt.of("/tmp/fern-runtime/snippet.json"),mjg=Zt.of("/fern/output");async function pfp({apiName:e,organization:t,generatorInvocation:r,sdkVersion:n,intermediateRepresentation:i,irVersionOverride:o,writeUnitTests:s=!1,generateOauthClients:a=!1,generatePaginatedClients:c=!1,context:l}){let u=await Gbi({intermediateRepresentation:i,generatorInvocation:r,context:l,irVersionOverride:o}),p=r.readme!=null||hjg(r)?djg:void 0,d=MSt({workspaceName:e,organization:t,outputVersion:n,customConfig:Dee(r.config),generatorInvocation:r,absolutePathToSnippet:p,absolutePathToSnippetTemplates:void 0,absolutePathToFernConfig:void 0,writeUnitTests:s,generateOauthClients:a,generatePaginatedClients:c,publishToRegistry:!1,omitPublishCredentials:!0,paths:{snippetPath:p,snippetTemplatePath:void 0,irPath:fjg,outputDirectory:mjg}}),f=await cfp.GeneratorConfig.jsonOrThrow(d);return pjg(Buffer.from(JSON.stringify({config:f,ir:u})))}function hjg(e){let t=e.outputMode;return t.type==="downloadFiles"&&t.downloadSnippets===!0}tr();jn();FE();Dt();var Kbi=require("fs/promises"),ffp=Ae(x0(),1),gjg="proto.zip",JZt=class{sourceTypes;context;sources;constructor(t,r){this.context=t,this.sources=Object.fromEntries(r.map(n=>[n.id,n])),this.sourceTypes=new Set(Object.values(this.sources).map(n=>n.type))}async uploadSources(t){for(let[r,n]of Object.entries(t)){let i=this.getSourceOrThrow(r);await this.uploadSource(i,n.uploadUrl)}return this.convertFdrSourceUploadsToSourceConfig(t)}async uploadSource(t,r){let n=await this.getUploadCommand(t),i=await(0,Kbi.readFile)(n.absoluteFilePath),o;try{o=await fetch(r,{method:"PUT",body:i,headers:{"Content-Type":"application/octet-stream"}})}catch(s){await n.cleanup(),this.context.failAndThrow(`Network error uploading source file: ${t.absoluteFilePath}`,s,{code:w.Code.NetworkError});return}await n.cleanup(),o.ok||this.context.failAndThrow(`Failed to upload source file: ${t.absoluteFilePath}. Status: ${o.status}, ${o.statusText}`,void 0,{code:w.Code.NetworkError})}async getUploadCommand(t){if(t.type==="protobuf"){let r=await this.zipSource(t.absoluteFilePath);return{absoluteFilePath:r,cleanup:async()=>{this.context.logger.debug(`Removing ${r}`),await(0,Kbi.unlink)(r)}}}return{absoluteFilePath:t.absoluteFilePath,cleanup:async()=>{}}}async zipSource(t){let r=await ffp.default.dir(),n=Re(Zt.of(r.path),be.of(gjg));return this.context.logger.debug(`Zipping source ${t} into ${n}`),await za(this.context.logger,"zip",["-r",n,"."],{cwd:t,doNotPipeOutput:!0}),n}convertFdrSourceUploadsToSourceConfig(t){let r=[];for(let[n,i]of Object.entries(t))switch(this.getSourceOrThrow(n).type){case"protobuf":r.push(xz.proto({id:n,protoRootUrl:i.downloadUrl}));continue;case"openapi":r.push(xz.openapi());continue;case"asyncapi":continue}return{sources:r}}getSourceOrThrow(t){let r=this.sources[t];return r==null&&this.context.failAndThrow(`Internal error; server responded with source id "${t}" which does not exist in the workspace.`,void 0,{code:w.Code.InternalError}),r}};function dfp(e,t){if(e==null||t==null)return;let r=Number(t);return Number.isInteger(r)&&r>=0?e.targets[r]:void 0}function mfp(e){return{payloadKind:"sdk-config-v1",body:e.body,...e.package==null?{}:{package:e.package}}}async function Afp({projectConfig:e,organization:t,workspace:r,interactiveTaskContext:n,generatorInvocation:i,version:o,audiences:s,shouldLogS3Url:a,token:c,whitelabel:l,replay:u,irVersionOverride:p,absolutePathToPreview:d,isPreview:f,fiddlePreview:m,pushPreviewBranch:g,readme:A,fernignorePath:y,skipFernignore:I,dynamicIrOnly:C,retryRateLimited:x,requireEnvVars:S,automationMode:B,autoMerge:D,skipIfNoDiff:R,verify:O,noReplay:z,disableTelemetry:Y,loginCommand:$,specsTarGzBuffer:ee,sdkGenApiSourceArchive:se,sdkGenApiRoute:ue,sdkConfigV1:oe,sdkGenApiPreparationBatch:me,sdkGenApiBatch:xe,sdkGenApiTargetIdSeed:Be,generateFullProject:pe,mapFernGroupToSdkConfig:ce}){let Pe=ue?.payloadKind!=="sdk-config-v1",Ee=dF({token:c.value}),Fe=await yjg({requiresFdrRegistration:Pe,fdrOrigin:"https://registry.buildwithfern.com",logger:n.logger}),Le=zr.getPackageName({generatorInvocation:i})??(i.outputMode.type==="downloadFiles"?Bee(i):void 0),qe=got(i),mt=f??d!=null,At=l==null?void 0:jp(l,{onError:Et=>{!mt&&S&&n.failAndThrow(void 0,Et,{code:w.Code.EnvironmentError})}},{substituteAsEmpty:mt}),Ht=hGe({apiName:r.definition.rootApiFile.contents.name,organization:t,generatorInvocation:i}),er=ue?.payloadKind==="sdk-config-v1"?dfp(oe,Be):void 0,Ce=er?.sdkVersion??oe?.sdkVersion,ge=o??Ce??(ue==null?await j3t({packageName:Le,generatorInvocation:i}):void 0),nt=ge==null&&qe!=null&&qe!==Le?await j3t({packageName:qe,generatorInvocation:i}):void 0;o!=null&&(mt?n.logger.warn(`Skipping version availability check in preview mode. Version ${o} may already exist on the package registry.`):await pQr({version:o,packageName:Le,generatorInvocation:i,context:n}));let ut=ge!=null&&(0,kB.isAutoVersion)(ge)||ge==null&&ue!=null?(0,kB.mapMagicVersionForLanguage)(kB.MAGIC_VERSION,i.language??(0,kB.extractLanguageFromGeneratorName)(i.name)):ge,Ie=Sve(i),we=wve(i),pt=Mg({workspace:r,generationLanguage:i.language,keywords:i.keywords,smartCasing:i.smartCasing,smartCasingDigitWordBoundary:i.smartCasingDigitWordBoundary,exampleGeneration:{disabled:i.disableExamples,skipAutogenerationIfManualExamplesExist:!0,skipErrorAutogenerationIfManualErrorExamplesExist:!1},audiences:s,readme:A,packageName:Le,userAgentTemplate:Ie,idempotencyKeyGeneration:we,webhookSignature:Tve(i,n),organization:t,version:ut,context:n,sourceResolver:new Dh(n,r),dynamicGeneratorConfig:Ht,generationMetadata:{cliVersion:r.cliVersion,generatorName:i.name,generatorVersion:i.version,generatorConfig:i.config,originGitCommit:Nee(),originGitCommitIsDirty:jee(),invokedBy:kee(),requestedVersion:o,ciProvider:Fee()}}),We,je=(m??d!=null)&&g!==!0,it=je?{type:"download"}:void 0,vt=bjg({replay:u,verify:O,skipIfNoDiff:R,noReplay:z}),sr=ue!=null&&er==null?fSt(i,vt).requestedOutput:void 0,Qn=ue!=null&&je&&ge!=null&&(0,kB.isAutoVersion)(ge)?er?.autoVersionPreviewOutput??er?.requestedOutput??sr:void 0,Fr=Qn?.type==="github"?Qn:void 0,Hn;if(ue!=null){let Et=er!=null?S7u(er.requestedOutput,mt):void 0,qt={generatorInvocation:i,sdkVersion:ge,specsTarGzBuffer:ee,whitelabel:l,requestedOutput:Fr??Et??sr};if(!F7u(qt)){let Te=j7u({candidate:qt,isSdkConfigTarget:er!=null,isPreview:mt});return n.failAndThrow(`Cannot submit SDK generation to sdk-gen-api: ${Te}`,void 0,{code:w.Code.ConfigError})}if(We=qt,ue.payloadKind==="sdk-config-v1")if(oe!=null&&er!=null)Hn={apiName:jr(pt.apiName),organization:t,cliVersion:r.cliVersion,generatorInvocation:qt.generatorInvocation,sdkGenApiRoute:ue,sdkName:er.sdkName??oe.sdkName,sdkVersion:qt.sdkVersion,apiVersion:oe.apiVersion,token:c,specsTarGzBuffer:qt.specsTarGzBuffer,payload:mfp(er),requestedOutput:Et,autoVersionPreviewOutput:Fr,...!mt&&er.publishCredential!=null?{publishCredential:er.publishCredential}:{},githubOptions:vt,absolutePathToLocalOutputArchive:er.absolutePathToLocalOutputArchive,absolutePathToPreview:d,context:n,targetIdSeed:Be,sourceSpecIndexes:se?.specIndexes,skipFernignore:I};else if(pSt(qt.generatorInvocation.name)){if(se==null)return n.failAndThrow(`Cannot submit ${qt.generatorInvocation.name} ${ue.requestedVersion??"(unpinned)"} to sdk-gen-api: the source archive is unavailable`,void 0,{code:w.Code.ConfigError});if(ce==null)return n.failAndThrow(`Cannot submit ${qt.generatorInvocation.name} ${ue.requestedVersion??"(unpinned)"} to sdk-gen-api: no SDK Config mapper was provided`,void 0,{code:w.Code.ConfigError});let Te=uep({workspace:r,generatorInvocation:qt.generatorInvocation,audiences:s,replay:u,sourceArchive:se,mapFernGroupToSdkConfig:ce}),_t=[];for(let ur of Te.diagnostics)switch(ur.severity){case"error":_t.push(ur);break;case"warning":n.logger.warn(`SDK Config mapping: ${fSs(ur)}`);break;default:rt(ur.severity)}if(_t.length>0)return n.failAndThrow(`SDK Config mapping failed:
|
|
4119
|
+
Please ensure you have membership at https://dashboard.buildwithfern.com, and ask a team member for an invite if not.`,void 0,{code:w.Code.AuthError}),orgNotConfiguredForWhitelabel:()=>o.failAndThrow("Your org is not configured for white-labeling. Please reach out to support@buildwithfern.com.",void 0,{code:w.Code.AuthError}),branchDoesNotExist:O=>o.failAndThrow(`Branch ${O.branch} does not exist in repository ${O.repositoryOwner}/${O.repositoryName}`,void 0,{code:w.Code.ConfigError}),rateLimitExceeded:()=>{throw new WGe},_other:O=>{if(o.logger.debug(`Failed to create job: ${JSON.stringify(O)}`),a.type==="guest"){let Y=yDt(O);if(ADt(Y))return o.failAndThrow(O7e(Y),void 0,{code:w.Code.AuthError})}let z=ojg(O);return z!=null?o.failAndThrow(z,void 0,{code:w.Code.NetworkError}):o.failAndThrow("Failed to create job. Please try again or contact support@buildwithfern.com for assistance.",void 0,{code:w.Code.NetworkError})}})}return B.body}async function ijg({intermediateRepresentation:e,generatorInvocation:t,job:r,context:n,irVersionOverride:i,specsTarGzBuffer:o,generatorsConfiguration:s}){let a=await Gbi({intermediateRepresentation:e,generatorInvocation:t,context:n,irVersionOverride:i}),c=new tfp.default,l=await Ocr(a,{onWrite:f=>{n.logger.debug("Wrote IR to disk: "+f)}}),u=new TextEncoder().encode(l),p=await rjg(u);n.logger.debug(`Compressed IR from ${u.byteLength} bytes to ${p.length} bytes (${((1-p.length/u.byteLength)*100).toFixed(1)}% reduction)`),c.append("ir",p,{filename:"ir.json",contentType:"application/octet-stream"}),o!=null&&(c.append("specs",o,{filename:"specs.tar.gz",contentType:"application/gzip"}),n.logger.debug(`Appended specs tar.gz (${o.length} bytes)`));try{let f=await Xpp({generatorsConfiguration:s,generatorInvocation:t});c.append("provenance",JSON.stringify(f),{filename:"provenance.json",contentType:"application/json"}),n.logger.debug(`Appended provenance inputs for ${f.specs.length} spec file(s)`)}catch(f){n.logger.debug(`Skipping provenance inputs: ${oi(f)}`)}let d=(0,rfp.default)(sMe(),`/api/remote-gen/jobs/${r.jobId}/start`);try{await Nd.post(d,c,{headers:c.getHeaders(),maxBodyLength:1/0})}catch(f){let m=f instanceof FVt?f.response?.data:f;n.logger.debug(`POST ${d} failed with ${JSON.stringify(f)}`),n.failAndThrow("Failed to start job",m,{code:w.Code.NetworkError})}}function ojg(e){let t;if(e?.reason==="status-code"?t=e.body:e?.content?.reason==="status-code"&&(t=e.content.body),typeof t?.content?.message=="string")return t.content.message;if(typeof t?.message=="string")return t.message}function sjg(e){let t=e?.content?.reason==="status-code"?e.content.body:void 0;return t?.error!=="GithubAppNotInstalled"?void 0:typeof t?.content?.message=="string"?t.content.message:`The Fern GitHub App is not installed on ${typeof t?.content?.repositoryName=="string"?t.content.repositoryName:"the target repository"}. Please install it (https://github.com/apps/fern-api) and try again.`}function ajg(e){let t=e?.content?.body?.content?.retryAfter;return typeof t=="number"&&t>0?t:void 0}function cjg(e){if(e?.content?.reason==="status-code"){let t=e.content.body;switch(t?.error){case"IllegalApiNameError":return Gr.remoteGen.createJobV3.Error.illegalApiNameError();case"IllegalApiVersionError":return Gr.remoteGen.createJobV3.Error.illegalApiVersionError(t.content);case"GeneratorsDoNotExistError":return Gr.remoteGen.createJobV3.Error.generatorsDoNotExistError(t.content);case"CannotPublishToNpmScope":return Gr.remoteGen.createJobV3.Error.cannotPublishToNpmScope(t.content);case"CannotPublishToMavenScope":return Gr.remoteGen.createJobV3.Error.cannotPublishToMavenGroup(t.content);case"CannotPublishPypiPackage":return Gr.remoteGen.createJobV3.Error.cannotPublishPypiPackage(t.content);case"InsufficientPermissions":return Gr.remoteGen.createJobV3.Error.insufficientPermissions(t.content);case"OrgNotConfiguredForWhitelabel":return Gr.remoteGen.createJobV3.Error.orgNotConfiguredForWhitelabel(t.content);case"BranchDoesNotExist":return Gr.remoteGen.createJobV3.Error.branchDoesNotExist(t.content)}}return e}function ljg({outputMode:e,generatorInvocation:t,absolutePathToPreview:r,shouldLogS3Url:n}){return e.type==="downloadFiles"||t.absolutePathToLocalSnippets!=null||r!=null||n}Dt();ef();var sfp=gpe();var ujg=3;function afp({job:e,taskId:t,taskHandler:r,context:n}){let i=0,o=async()=>{let s=await sfp.remoteGen.getJobStatus(e.jobId);if(s.ok)return s.body[t];n.logger.debug("Failed to get job status.",JSON.stringify(s.error.content))};return new Promise((s,a)=>{c();async function c(){try{let l=await o();if(l==null)i++,i===ujg&&n.failAndThrow(`Failed to get job status after ${i} attempts.`,void 0,{code:w.Code.NetworkError}),setTimeout(c,2e3+1e3*i);else{i=0;let u=await r.processUpdate(l);r.isFinished?s(u):setTimeout(c,2e3)}}catch(l){a(l)}}})}yc();tr();var cfp=Ae(Yn(),1),lfp=require("util"),ufp=require("zlib");var pjg=(0,lfp.promisify)(ufp.gzip),fjg=Zt.of("/tmp/fern-runtime/ir.json"),djg=Zt.of("/tmp/fern-runtime/snippet.json"),mjg=Zt.of("/fern/output");async function pfp({apiName:e,organization:t,generatorInvocation:r,sdkVersion:n,intermediateRepresentation:i,irVersionOverride:o,writeUnitTests:s=!1,generateOauthClients:a=!1,generatePaginatedClients:c=!1,context:l}){let u=await Gbi({intermediateRepresentation:i,generatorInvocation:r,context:l,irVersionOverride:o}),p=hjg(r)?djg:void 0,d=MSt({workspaceName:e,organization:t,outputVersion:n,customConfig:Dee(r.config),generatorInvocation:r,absolutePathToSnippet:p,absolutePathToSnippetTemplates:void 0,absolutePathToFernConfig:void 0,writeUnitTests:s,generateOauthClients:a,generatePaginatedClients:c,publishToRegistry:!1,omitPublishCredentials:!0,paths:{snippetPath:p,snippetTemplatePath:void 0,irPath:fjg,outputDirectory:mjg}}),f=await cfp.GeneratorConfig.jsonOrThrow(d);return pjg(Buffer.from(JSON.stringify({config:f,ir:u})))}function hjg(e){if(e.readme!=null)return!0;let t=e.outputMode;return t.type==="github"||t.type==="githubV2"||t.type==="downloadFiles"&&t.downloadSnippets===!0}tr();jn();FE();Dt();var Kbi=require("fs/promises"),ffp=Ae(x0(),1),gjg="proto.zip",JZt=class{sourceTypes;context;sources;constructor(t,r){this.context=t,this.sources=Object.fromEntries(r.map(n=>[n.id,n])),this.sourceTypes=new Set(Object.values(this.sources).map(n=>n.type))}async uploadSources(t){for(let[r,n]of Object.entries(t)){let i=this.getSourceOrThrow(r);await this.uploadSource(i,n.uploadUrl)}return this.convertFdrSourceUploadsToSourceConfig(t)}async uploadSource(t,r){let n=await this.getUploadCommand(t),i=await(0,Kbi.readFile)(n.absoluteFilePath),o;try{o=await fetch(r,{method:"PUT",body:i,headers:{"Content-Type":"application/octet-stream"}})}catch(s){await n.cleanup(),this.context.failAndThrow(`Network error uploading source file: ${t.absoluteFilePath}`,s,{code:w.Code.NetworkError});return}await n.cleanup(),o.ok||this.context.failAndThrow(`Failed to upload source file: ${t.absoluteFilePath}. Status: ${o.status}, ${o.statusText}`,void 0,{code:w.Code.NetworkError})}async getUploadCommand(t){if(t.type==="protobuf"){let r=await this.zipSource(t.absoluteFilePath);return{absoluteFilePath:r,cleanup:async()=>{this.context.logger.debug(`Removing ${r}`),await(0,Kbi.unlink)(r)}}}return{absoluteFilePath:t.absoluteFilePath,cleanup:async()=>{}}}async zipSource(t){let r=await ffp.default.dir(),n=Re(Zt.of(r.path),be.of(gjg));return this.context.logger.debug(`Zipping source ${t} into ${n}`),await za(this.context.logger,"zip",["-r",n,"."],{cwd:t,doNotPipeOutput:!0}),n}convertFdrSourceUploadsToSourceConfig(t){let r=[];for(let[n,i]of Object.entries(t))switch(this.getSourceOrThrow(n).type){case"protobuf":r.push(xz.proto({id:n,protoRootUrl:i.downloadUrl}));continue;case"openapi":r.push(xz.openapi());continue;case"asyncapi":continue}return{sources:r}}getSourceOrThrow(t){let r=this.sources[t];return r==null&&this.context.failAndThrow(`Internal error; server responded with source id "${t}" which does not exist in the workspace.`,void 0,{code:w.Code.InternalError}),r}};function dfp(e,t){if(e==null||t==null)return;let r=Number(t);return Number.isInteger(r)&&r>=0?e.targets[r]:void 0}function mfp(e){return{payloadKind:"sdk-config-v1",body:e.body,...e.package==null?{}:{package:e.package}}}async function Afp({projectConfig:e,organization:t,workspace:r,interactiveTaskContext:n,generatorInvocation:i,version:o,audiences:s,shouldLogS3Url:a,token:c,whitelabel:l,replay:u,irVersionOverride:p,absolutePathToPreview:d,isPreview:f,fiddlePreview:m,pushPreviewBranch:g,readme:A,fernignorePath:y,skipFernignore:I,dynamicIrOnly:C,retryRateLimited:x,requireEnvVars:S,automationMode:B,autoMerge:D,skipIfNoDiff:R,verify:O,noReplay:z,disableTelemetry:Y,loginCommand:$,specsTarGzBuffer:ee,sdkGenApiSourceArchive:se,sdkGenApiRoute:ue,sdkConfigV1:oe,sdkGenApiPreparationBatch:me,sdkGenApiBatch:xe,sdkGenApiTargetIdSeed:Be,generateFullProject:pe,mapFernGroupToSdkConfig:ce}){let Pe=ue?.payloadKind!=="sdk-config-v1",Ee=dF({token:c.value}),Fe=await yjg({requiresFdrRegistration:Pe,fdrOrigin:"https://registry.buildwithfern.com",logger:n.logger}),Le=zr.getPackageName({generatorInvocation:i})??(i.outputMode.type==="downloadFiles"?Bee(i):void 0),qe=got(i),mt=f??d!=null,At=l==null?void 0:jp(l,{onError:Et=>{!mt&&S&&n.failAndThrow(void 0,Et,{code:w.Code.EnvironmentError})}},{substituteAsEmpty:mt}),Ht=hGe({apiName:r.definition.rootApiFile.contents.name,organization:t,generatorInvocation:i}),er=ue?.payloadKind==="sdk-config-v1"?dfp(oe,Be):void 0,Ce=er?.sdkVersion??oe?.sdkVersion,ge=o??Ce??(ue==null?await j3t({packageName:Le,generatorInvocation:i}):void 0),nt=ge==null&&qe!=null&&qe!==Le?await j3t({packageName:qe,generatorInvocation:i}):void 0;o!=null&&(mt?n.logger.warn(`Skipping version availability check in preview mode. Version ${o} may already exist on the package registry.`):await pQr({version:o,packageName:Le,generatorInvocation:i,context:n}));let ut=ge!=null&&(0,kB.isAutoVersion)(ge)||ge==null&&ue!=null?(0,kB.mapMagicVersionForLanguage)(kB.MAGIC_VERSION,i.language??(0,kB.extractLanguageFromGeneratorName)(i.name)):ge,Ie=Sve(i),we=wve(i),pt=Mg({workspace:r,generationLanguage:i.language,keywords:i.keywords,smartCasing:i.smartCasing,smartCasingDigitWordBoundary:i.smartCasingDigitWordBoundary,exampleGeneration:{disabled:i.disableExamples,skipAutogenerationIfManualExamplesExist:!0,skipErrorAutogenerationIfManualErrorExamplesExist:!1},audiences:s,readme:A,packageName:Le,userAgentTemplate:Ie,idempotencyKeyGeneration:we,webhookSignature:Tve(i,n),organization:t,version:ut,context:n,sourceResolver:new Dh(n,r),dynamicGeneratorConfig:Ht,generationMetadata:{cliVersion:r.cliVersion,generatorName:i.name,generatorVersion:i.version,generatorConfig:i.config,originGitCommit:Nee(),originGitCommitIsDirty:jee(),invokedBy:kee(),requestedVersion:o,ciProvider:Fee()}}),We,je=(m??d!=null)&&g!==!0,it=je?{type:"download"}:void 0,vt=bjg({replay:u,verify:O,skipIfNoDiff:R,noReplay:z}),sr=ue!=null&&er==null?fSt(i,vt).requestedOutput:void 0,Qn=ue!=null&&je&&ge!=null&&(0,kB.isAutoVersion)(ge)?er?.autoVersionPreviewOutput??er?.requestedOutput??sr:void 0,Fr=Qn?.type==="github"?Qn:void 0,Hn;if(ue!=null){let Et=er!=null?S7u(er.requestedOutput,mt):void 0,qt={generatorInvocation:i,sdkVersion:ge,specsTarGzBuffer:ee,whitelabel:l,requestedOutput:Fr??Et??sr};if(!F7u(qt)){let Te=j7u({candidate:qt,isSdkConfigTarget:er!=null,isPreview:mt});return n.failAndThrow(`Cannot submit SDK generation to sdk-gen-api: ${Te}`,void 0,{code:w.Code.ConfigError})}if(We=qt,ue.payloadKind==="sdk-config-v1")if(oe!=null&&er!=null)Hn={apiName:jr(pt.apiName),organization:t,cliVersion:r.cliVersion,generatorInvocation:qt.generatorInvocation,sdkGenApiRoute:ue,sdkName:er.sdkName??oe.sdkName,sdkVersion:qt.sdkVersion,apiVersion:oe.apiVersion,token:c,specsTarGzBuffer:qt.specsTarGzBuffer,payload:mfp(er),requestedOutput:Et,autoVersionPreviewOutput:Fr,...!mt&&er.publishCredential!=null?{publishCredential:er.publishCredential}:{},githubOptions:vt,absolutePathToLocalOutputArchive:er.absolutePathToLocalOutputArchive,absolutePathToPreview:d,context:n,targetIdSeed:Be,sourceSpecIndexes:se?.specIndexes,skipFernignore:I};else if(pSt(qt.generatorInvocation.name)){if(se==null)return n.failAndThrow(`Cannot submit ${qt.generatorInvocation.name} ${ue.requestedVersion??"(unpinned)"} to sdk-gen-api: the source archive is unavailable`,void 0,{code:w.Code.ConfigError});if(ce==null)return n.failAndThrow(`Cannot submit ${qt.generatorInvocation.name} ${ue.requestedVersion??"(unpinned)"} to sdk-gen-api: no SDK Config mapper was provided`,void 0,{code:w.Code.ConfigError});let Te=uep({workspace:r,generatorInvocation:qt.generatorInvocation,audiences:s,replay:u,sourceArchive:se,mapFernGroupToSdkConfig:ce}),_t=[];for(let ur of Te.diagnostics)switch(ur.severity){case"error":_t.push(ur);break;case"warning":n.logger.warn(`SDK Config mapping: ${fSs(ur)}`);break;default:rt(ur.severity)}if(_t.length>0)return n.failAndThrow(`SDK Config mapping failed:
|
|
4119
4120
|
`+_t.map(fSs).join(`
|
|
4120
4121
|
`),void 0,{code:w.Code.ConfigError});Hn={apiName:jr(pt.apiName),organization:t,cliVersion:r.cliVersion,generatorInvocation:qt.generatorInvocation,sdkGenApiRoute:ue,sdkVersion:qt.sdkVersion,apiVersion:pt.specVersion,token:c,specsTarGzBuffer:qt.specsTarGzBuffer,payload:{payloadKind:"sdk-config-v1",body:Te.body},requestedOutput:it,autoVersionPreviewOutput:Fr,absolutePathToPreview:d,context:n,targetIdSeed:Be,sourceSpecIndexes:se.specIndexes,audiences:s.type==="select"?s.audiences:void 0,githubOptions:vt,skipFernignore:I}}else return n.failAndThrow(`Cannot submit ${qt.generatorInvocation.name} ${ue.requestedVersion??"(unpinned)"} without an SDK Config v1 document. Run \`fern sdk migrate\`, then pass the generated document with \`fern generate --sdk-config <path>\`.`,void 0,{code:w.Code.ConfigError});if(Be==null)throw new Error("sdk-gen-api target is missing its preparation ID");await me?.ready(Be,Hn)}let Yt=!0,Er=!0;if(!Fe&&Pe){let qt=await kl({token:c.value}).organization.get({orgId:e.organization});qt.ok?(qt.body.isWhitelabled&&(pt.readmeConfig==null&&(pt.readmeConfig=vjg),pt.readmeConfig.whiteLabel=!0),pt.selfHosted=qt.body.selfHostedSdKs,Yt=qt.body.oauthClientEnabled??!0,Er=qt.body.paginationEnabled??!0):n.logger.warn(`Failed to load organization settings for ${e.organization}; assuming pagination and OAuth clients are enabled.`)}let Je;if(Pe){let Et=r.getSources(),qt,Te=aO({ir:pt,snippetsConfig:{typescriptSdk:void 0,pythonSdk:void 0,javaSdk:void 0,rubySdk:void 0,goSdk:void 0,csharpSdk:void 0,phpSdk:void 0,swiftSdk:void 0,rustSdk:void 0},context:n});try{let ur=await Ee.api.register.registerApiDefinition({orgId:sn.OrgId(t),apiId:sn.ApiId(jr(pt.apiName)),definition:Te,sources:Et.length>0?Ijg(Et):void 0});Je=ur.apiDefinitionId,qt=ur.sources??void 0}catch(ur){new JZt(n,Et).sourceTypes.has("protobuf")&&n.failAndThrow(`Failed to register API definition: ${JSON.stringify(ur)}`)}let _t=new JZt(n,Et);if(qt==null&&_t.sourceTypes.has("protobuf")&&n.failAndThrow("Did not successfully upload Protobuf source files.",void 0,{code:w.Code.NetworkError}),qt!=null){n.logger.debug("Uploading source files ...");let ur=await _t.uploadSources(qt);n.logger.debug("Setting IR source configuration ..."),pt.sourceConfig=ur}}if(C){if(n.logger.info("Dynamic IR only mode: skipping SDK generation and uploading dynamic IR only"),o==null){n.failAndThrow("Version is required for dynamic IR only mode",void 0,{code:w.Code.ConfigError});return}if(i.language==null){n.failAndThrow("Language is required for dynamic IR only mode",void 0,{code:w.Code.ConfigError});return}if(qe==null){n.failAndThrow("Package name is required for dynamic IR only mode",void 0,{code:w.Code.ConfigError});return}try{await hfp({fdr:Ee,organization:t,version:o,language:i.language,packageName:qe,ir:pt,smartCasing:i.smartCasing,smartCasingDigitWordBoundary:i.smartCasingDigitWordBoundary,dynamicGeneratorConfig:Ht,context:n})}catch(Et){n.failAndThrow(`Failed to upload dynamic IR: ${tn(Et)}`,void 0,{code:w.Code.NetworkError})}return{createdSnippets:!1,snippetsS3PreSignedReadUrl:void 0,actualVersion:o,pullRequestUrl:void 0,noChangesDetected:void 0,publishTarget:void 0}}let Ue={...pt,fdrApiDefinitionId:Je,publishConfig:Ejg({generatorInvocation:i,version:ge,userProvidedVersion:o,packageName:Le,selfHosted:pt.selfHosted??!1,generateFullProject:pe,context:n})},G;if(ue!=null){if(We==null)throw new Error("sdk-gen-api target passed preflight without an eligible candidate");let Et;ue.payloadKind==="fern-runtime-bundle"&&ue.requestedVersion==null&&ue.versionSource==="fern-latest"&&(Et=await Ajg({generatorInvocation:We.generatorInvocation,organization:t,token:c}));let qt=ue.requestedVersion??Et;if(ue.payloadKind==="fern-runtime-bundle"&&qt!=null)try{fGe({generatorId:ue.generatorId,language:ue.language,requestedVersion:qt,configKind:ue.configKind})}catch(hr){if(!(hr instanceof Ose))throw hr;n.failAndThrow(_Xt(hr),void 0,{code:w.Code.ConfigError})}let Te=Et==null?We.generatorInvocation:{...We.generatorInvocation,version:Et},_t=Et==null?Ue:{...Ue,generationMetadata:Ue.generationMetadata==null?void 0:{...Ue.generationMetadata,generatorVersion:Et}},ur=ue.payloadKind==="sdk-config-v1"?Hn??n.failAndThrow("SDK Config v1 target reached submission without prepared build parameters",void 0,{code:w.Code.ConfigError}):{apiName:jr(pt.apiName),organization:t,cliVersion:r.cliVersion,generatorInvocation:We.generatorInvocation,resolvedGeneratorVersion:Et,sdkGenApiRoute:ue,sdkVersion:We.sdkVersion,apiVersion:pt.specVersion,token:c,specsTarGzBuffer:We.specsTarGzBuffer,payload:{payloadKind:"fern-runtime-bundle",body:await pfp({apiName:jr(pt.apiName),organization:t,generatorInvocation:Te,sdkVersion:ut??(0,kB.mapMagicVersionForLanguage)(kB.MAGIC_VERSION,Te.language??(0,kB.extractLanguageFromGeneratorName)(Te.name)),intermediateRepresentation:_t,irVersionOverride:p,generateOauthClients:Yt,generatePaginatedClients:Er,context:n})},requestedOutput:it,autoVersionPreviewOutput:Fr,absolutePathToPreview:d,context:n,targetIdSeed:Be,sourceSpecIndexes:se?.specIndexes,audiences:s.type==="select"?s.audiences:void 0,githubOptions:vt,skipFernignore:I};G=await(xe?.run(ur)??z7u(ur))}else{let Et=await ofp({projectConfig:e,workspace:r,organization:t,generatorInvocation:i,context:n,version:ge,intermediateRepresentation:Ue,shouldLogS3Url:a,token:c,whitelabel:At,replay:u,irVersionOverride:p,absolutePathToPreview:d,fiddlePreview:m,pushPreviewBranch:g,fernignorePath:y,skipFernignore:I,retryRateLimited:x,automationMode:B,autoMerge:D,skipIfNoDiff:R,verify:O,loginCommand:$,specsTarGzBuffer:ee});n.logger.debug(`Job ID: ${Et.jobId}`);let qt=Et.taskIds[0];if(qt==null){n.failAndThrow("Did not receive a task ID.",void 0,{code:w.Code.NetworkError});return}n.logger.debug(`Task ID: ${qt}`);let Te=new Rgi({job:Et,taskId:qt,generatorInvocation:i,interactiveTaskContext:n,absolutePathToPreview:d,telemetryContext:{cliVersion:r.cliVersion,orgId:e.organization,automationMode:B===!0,autoMerge:D===!0,skipIfNoDiff:R===!0,versionArg:o==null?"none":(0,kB.isAutoVersion)(o)?"auto":"explicit",versionBump:void 0,replayConfigEnabled:u?.enabled===!0,noReplayFlag:z===!0,disableTelemetry:Y===!0}});G=await afp({job:Et,taskHandler:Te,taskId:qt,context:n})}if(G!=null&&G.actualVersion==null){let Et=gfp(ge);Et!=null&&(G={...G,actualVersion:Et})}let Se=G?.actualVersion??gfp(ge),Xe;if(Se==null&&G!=null&&qe!=null)if(nt==null)Xe=`no SDK version was resolved and none could be computed for package ${qe}`;else{let Et=await Hcl({packageName:qe,generatorInvocation:i});Et===nt?Se=Et:Xe=`computed candidate ${nt} for package ${qe} but the registry/GitHub reports ${Et??"no release"}, so the generated SDK version is unconfirmed`}let xt=Cjg({hasResult:G!=null,version:Se,versionUnresolvedReason:Xe,language:i.language,packageName:qe,isPreview:mt});if(!xt.upload)n.logger.debug(`Skipping dynamic IR upload for ${i.name}: ${xt.reason}`);else try{await hfp({fdr:Ee,organization:t,version:xt.version,language:xt.language,packageName:xt.packageName,ir:pt,smartCasing:i.smartCasing,smartCasingDigitWordBoundary:i.smartCasingDigitWordBoundary,dynamicGeneratorConfig:Ht,context:n})}catch(Et){n.logger.warn(`Failed to upload dynamic IR for SDK generation: ${tn(Et)}`)}return G}async function Ajg({generatorInvocation:e,organization:t,token:r}){let n=gFe(),i=e.language??fv(e.name);if(n==null)throw new Error("FERN_SDK_GEN_API_ORIGIN is required when sdk-gen-api generation is enabled");if(i==null)throw new Error(`Cannot discover a generator version for unsupported generator ${e.name}`);let o=await I_u({origin:n,organization:t,token:r,generatorId:e.name,language:i});if(o.state==="UNAVAILABLE"||o.compatibleVersion==null)throw new Error(`SDK Gen API cannot resolve a latest executable version for ${e.name}`+(o.state==="UNAVAILABLE"?` (${o.reason})`:""));return o.compatibleVersion}async function yjg({requiresFdrRegistration:e,fdrOrigin:t,logger:r}){return e?await X5t(`${t}/health`,r):!1}function bjg({replay:e,verify:t,skipIfNoDiff:r,noReplay:n}){let i=n===!0?{enabled:!1}:e!=null?{enabled:e.enabled===!0}:void 0,o={...i!=null?{replay:i}:{},...t===!0?{verify:!0}:{},...r===!0?{skipIfNoDiff:!0}:{}};return Object.keys(o).length>0?o:void 0}function Ejg({generatorInvocation:e,version:t,userProvidedVersion:r,packageName:n,selfHosted:i,generateFullProject:o,context:s}){let a=e.language??(0,kB.extractLanguageFromGeneratorName)(e.name),c=l=>l!=null&&(0,kB.isAutoVersion)(l)?(0,kB.mapMagicVersionForLanguage)(kB.MAGIC_VERSION,a):l;return e.outputMode._visit({downloadFiles:()=>Xt.PublishingConfig.filesystem({generateFullProject:i||(o??!1),publishTarget:OMr({generatorInvocation:e,version:c(t),userProvidedVersion:c(r),packageName:n,context:s})}),github:()=>{},githubV2:()=>{},publish:()=>{},publishV2:l=>l._visit({mavenOverride:()=>{},pypiOverride:()=>{},nugetOverride:()=>{},npmOverride:()=>{},rubyGemsOverride:()=>{},cratesOverride:()=>{},postman:u=>{let p;return e.raw?.output?.location==="postman"&&(p=e.raw.output?.["collection-id"]),Xt.PublishingConfig.direct({target:Xt.PublishTarget.postman({apiKey:u.apiKey,workspaceId:u.workspaceId,collectionId:p})})},_other:()=>{}}),_other:()=>{}})}function Ijg(e){return Object.fromEntries(Object.values(e).map(t=>[t.id,{type:t.type==="protobuf"?"proto":t.type}]))}var vjg={defaultEndpoint:void 0,bannerLink:void 0,introduction:void 0,apiReferenceLink:void 0,apiName:void 0,disabledFeatures:void 0,whiteLabel:void 0,customSections:void 0,features:void 0,exampleStyle:void 0};function Cjg({hasResult:e,version:t,versionUnresolvedReason:r,language:n,packageName:i,isPreview:o}){return o?{upload:!1,reason:"preview generation"}:e?n==null?{upload:!1,reason:"generator has no language"}:i==null?{upload:!1,reason:"no package name could be resolved from publish target or generator config"}:t==null?{upload:!1,reason:r??"no SDK version was resolved"}:{upload:!0,version:t,language:n,packageName:i}:{upload:!1,reason:"generation did not produce a result"}}async function hfp({fdr:e,organization:t,version:r,language:n,packageName:i,ir:o,smartCasing:s,smartCasingDigitWordBoundary:a,dynamicGeneratorConfig:c,context:l}){l.logger.debug(`Uploading dynamic IR for ${n} SDK...`);let u;try{u=await e.api.register.getSdkDynamicIrUploadUrls({orgId:sn.OrgId(t),version:r,snippetConfiguration:{[n]:i}})}catch(m){l.logger.warn(`Failed to get dynamic IR upload URLs (non-fatal, dynamic snippets may be stale): ${m}`);return}let p=u.uploadUrls[n]?.uploadUrl;if(p==null){l.logger.warn(`No upload URL returned for ${n}`);return}let d=m4e({ir:o,disableExamples:!0,smartCasing:s,smartCasingDigitWordBoundary:a,generationLanguage:n,generatorConfig:c}),f=JSON.stringify(d);try{let m=await fetch(p,{method:"PUT",body:f,headers:{"Content-Type":"application/octet-stream","Content-Length":f.length.toString()}});m.ok?l.logger.debug(`Uploaded dynamic IR for ${n}:${i} (${r})`):l.logger.warn(`Failed to upload dynamic IR for ${n}: ${m.status}`)}catch(m){l.logger.warn(`Network error uploading dynamic IR for ${n}: ${m}`)}}function gfp(e){if(e!=null&&e.toUpperCase()!=="AUTO")return e}var xjg={typescript:"TypeScript SDK",python:"Python SDK",java:"Java SDK",kotlin:"Kotlin SDK",go:"Go SDK",csharp:"C# SDK",php:"PHP SDK",ruby:"Ruby SDK",rust:"Rust SDK",swift:"Swift SDK",cli:"CLI",mcp:"MCP server"};function Sjg(e,t){if(lSt()===!0||!(e instanceof gl))return!1;let r=t.apiOverride?.specs;return r!=null?Array.isArray(r)&&r.some(wjg):[...e.specs,...e.allSpecs].some(n=>n.type==="protobuf")}function wjg(e){return"proto"in e}async function LFe({projectConfig:e,organization:t,workspace:r,context:n,generatorGroup:i,version:o,shouldLogS3Url:s,token:a,whitelabel:c,replay:l,absolutePathToPreview:u,isPreview:p,fiddlePreview:d,pushPreviewBranch:f,mode:m,fernignorePath:g,skipFernignore:A,dynamicIrOnly:y,validateWorkspace:I,retryRateLimited:C,requireEnvVars:x,automationMode:S,autoMerge:B,skipIfNoDiff:D,verify:R,noReplay:O,disableTelemetry:z,automation:Y,occurrenceTracker:$,loginCommand:ee,getSpecsTarGzBuffer:se,sdkConfigV1:ue,generateFullProject:oe,libraryVisibility:me,mapFernGroupToSdkConfig:xe}){if(i.generators.length===0)return n.logger.warn("No generators specified."),null;let Be=[],pe=$??new q8e;$==null&&pe.recordOccurrences(i.generators);let ce=r.generatorsConfiguration?.absolutePathToConfiguration,Pe=p??u!=null,Ee=new Set(ue==null?i.generators.filter(We=>Sjg(r,We)).map(We=>We.name):[]),Fe=await MXt({organization:t,generatorNames:i.generators.filter(We=>!Ee.has(We.name)&&hFe({generatorName:We.name,version:We.version,usesSdkConfig:ue!=null})==null).map(We=>We.name)}),Le=Efp({generators:i.generators,isSdkGenApiEnabled:We=>!Ee.has(We)&&Fe.get(We)===!0,sdkConfigV1:ue,requireEnvVars:x,isPreview:Pe,verify:R,skipIfNoDiff:D,autoMerge:B});for(let We of Le)We.fallbackReason!=null&&n.logger.warn(`${We.generatorInvocation.name} ${We.generatorInvocation.version} will use legacy Fiddle generation instead of sdk-gen-api: ${We.fallbackReason}`);let qe=Le.map(We=>We.route),mt=Le.map(We=>We.generatorInvocation),At=Le.map(We=>We.error);Y==null&&yfp(At,i.generators),Pe||Vgi(Le.flatMap(({sdkConfigTargetIndex:We})=>{let je=We==null?void 0:ue?.targets[We];return je==null?[]:[je]}));let Ht=mt.flatMap((We,je)=>Le[je]?.error==null?[{generatorIndex:je,sdkConfigTargetIndex:Le[je]?.sdkConfigTargetIndex,generatorInvocation:We,sdkGenApiRoute:qe[je]}]:[]),er={sourceArchives:new Map,errors:new Map};if(Ht.length>0)try{er=await se?.(Ht)??er}catch(We){er={sourceArchives:new Map,errors:new Map(Ht.map(je=>[je.generatorIndex,We]))}}let Ce=Rjg({generators:mt,routes:qe,routeErrors:At,sourceResolution:er}),ge=Ce.sourceArchives,nt=Le.map((We,je)=>We.error??Ce.preflightErrors[je]);Y==null&&yfp(nt,i.generators);let ut=kjg(qe,nt);Q7u(ut.size);let Ie=ut.size>1?new Mgi(ut.size):void 0,we=ut.size>0?new Lgi([...ut].map(We=>(Le[We]?.sdkConfigTargetIndex??We).toString())):void 0,pt=await Promise.all(i.generators.map((We,je)=>n.runInteractiveTask({name:Tjg(We,qe[je])},it=>Fjg({generatorInvocation:We,resolvedGeneratorInvocation:mt[je]??We,interactiveTaskContext:it,projectConfig:e,organization:t,workspace:r,context:n,generatorGroup:i,version:o,shouldLogS3Url:s,token:a,whitelabel:c,replay:l,absolutePathToPreview:u,isPreview:p,fiddlePreview:d,pushPreviewBranch:f,mode:m,fernignorePath:g,skipFernignore:A,dynamicIrOnly:y,validateWorkspace:I,retryRateLimited:C,requireEnvVars:x,automationMode:S,autoMerge:B,skipIfNoDiff:D,verify:R,noReplay:O,disableTelemetry:z,automation:Y,generatorsYmlAbsolutePath:ce,occurrenceTracker:pe,loginCommand:ee,specsTarGzArchive:ge[je],sdkGenApiPreflightError:nt[je],sdkGenApiRoute:qe[je],sdkConfigV1:ue,sdkGenApiPreparationBatch:ut.has(je)?we:void 0,sdkGenApiBatch:ut.has(je)?Ie:void 0,sdkGenApiTargetIdSeed:(Le[je]?.sdkConfigTargetIndex??je).toString(),generateFullProject:oe,libraryVisibility:me,mapFernGroupToSdkConfig:xe,onSnippetsProduced:vt=>Be.push(vt)}))));if(Y==null&&pt.some(We=>!We))throw new Za(n.getLastFailureMessage());return{snippetsProducedBy:Be}}function Tjg(e,t){return t?.payloadKind!=="sdk-config-v1"?e.name:xjg[t.language]}function Ojg({resolved:e,sdkConfigV1:t,language:r}){return t!=null?"sdk-config-v1":r!=null&&pSt(e.name)?e.version===LJ?"sdk-config-v1":Lge({generatorId:e.name,language:e.language??r,requestedVersion:e.version}).configKind:"legacy-fern"}function Efp({generators:e,isSdkGenApiEnabled:t,sdkConfigV1:r,requireEnvVars:n,isPreview:i,verify:o,skipIfNoDiff:s,autoMerge:a}){return e.map((c,l)=>{let u=c,p={onError:g=>{if(!i&&n)throw g}},d={substituteAsEmpty:i},f=g=>Hpp(g,p,d),m=Bjg(c,l);try{if(u=Wpp(c,p,d),!i&&r==null&&Pjg(u.outputMode))throw new w({message:`${u.name}: ${zr.DIRECT_RUBYGEMS_PUBLISHING_UNSUPPORTED_MESSAGE}`,code:w.Code.ConfigError});let g=fv(u.name),A=g==null?void 0:r?.targets[m];if(r!=null&&g==null)throw new Error(`SDK Config v1 generation only supports Fern SDK generators routed through sdk-gen-api; the selected group contains ${u.name}`);if(r!=null&&A==null)throw new Error(`SDK Config v1 does not contain a target for ${g}`);if(A!=null&&A.language!==g)throw new Error(`SDK Config v1 target ${m} language ${A.language} does not match ${g}`);if(!i&&A!=null&&Vgi([A]),r==null&&jXt(u.version))throw new Error("The internal unpinned SDK Config generator marker cannot be used without SDK Config v1");A?.generatorVersion!=null&&(u={...u,version:A.generatorVersion});let y=hFe({generatorName:u.name,version:u.version,usesSdkConfig:r!=null});if(!(y??t(c.name))){if(r!=null)throw new Error("SDK Config v1 generation requires the sdk-gen-api generation backend");if(y===!1)throw new w({message:`${u.name} ${u.version} requires sdk-gen-api generation, which ${cSt}=false turns off. Unset ${cSt} to generate it.`,code:w.Code.ConfigError});if(mGe(u.name))throw new w({message:lSt()===!1?`${u.name} requires sdk-gen-api generation, which ${cSt}=false turns off. Unset ${cSt} to generate it.`:`${u.name} requires sdk-gen-api generation, which is not enabled for this generator in this organization (or the feature flag service could not be reached). Retry, or contact Fern support to enable it.`,code:w.Code.ConfigError});return{generatorInvocation:f(u),route:void 0,error:void 0}}let I;if(A!=null&&A.generatorVersion==null){if(!jXt(u.version))throw new Error("An SDK Config target without generatorVersion must use the internal unpinned generator marker");let x=u.language??g;if(x==null)throw new Error(`SDK Config v1 generation does not recognize generator ${u.name}`);I=hCs({generatorId:u.name,language:x})}else if(r==null&&u.version===LJ&&pSt(u.name)){let x=u.language??g;if(x==null)throw new Error(`SDK Config synthesis does not recognize generator ${u.name}`);I=dGe({generatorId:u.name,language:x,configKind:"sdk-config-v1",versionSource:"fern-latest"})}else I=T7u(u,Ojg({resolved:u,sdkConfigV1:r,language:g}));if(I!=null&&r==null)try{R7u(u)}catch(x){if(I.configKind==="legacy-fern")return{generatorInvocation:f(u),route:void 0,error:void 0,fallbackReason:tn(x)};throw x}let C=Djg({generatorInvocation:u,requestedOutput:A?.requestedOutput,verify:o,skipIfNoDiff:s,autoMerge:a});if(I!=null&&C!=null){if(I.configKind==="legacy-fern")return{generatorInvocation:f(u),route:void 0,error:void 0,fallbackReason:C};throw new Error(`Cannot route ${u.name} ${I.requestedVersion??"(unpinned)"} through sdk-gen-api: ${C}. This generator version requires SDK Config v1, so Fern cannot fall back to legacy Fiddle generation.`)}return{generatorInvocation:u,route:I,error:void 0,...r==null?{}:{sdkConfigTargetIndex:m}}}catch(g){let A=g instanceof Ose?new w({message:_Xt(g),code:w.Code.ConfigError}):g;return{generatorInvocation:u,route:void 0,error:A,...r==null?{}:{sdkConfigTargetIndex:m}}}})}function Pjg(e){return e.type==="publishV2"&&e.publishV2.type==="rubyGemsOverride"}function Bjg(e,t){return e.sdkConfigTargetIndex??t}function Djg({generatorInvocation:e,requestedOutput:t,verify:r,skipIfNoDiff:n,autoMerge:i}){let o=t??fSt(e).requestedOutput,s=[];return r===!0&&o.type!=="github"&&s.push("verify=true is not implemented by sdk-gen-api for non-GitHub output"),n===!0&&o.type!=="github"&&s.push("skipIfNoDiff=true is not implemented by sdk-gen-api for non-GitHub output"),(i===!0||zr.isGithubAutoMergeEnabled(e.raw?.github))&&s.push("autoMerge=true is not implemented by sdk-gen-api"),s.length>0?s.join("; "):void 0}function Rjg({generators:e,routes:t,routeErrors:r,sourceResolution:n}){return{sourceArchives:e.map((i,o)=>n.sourceArchives.get(o)),preflightErrors:e.map((i,o)=>{if(r?.[o]!=null)return;let s=t[o];if(s==null)return;let a=n.errors.get(o);if(a!=null)return a;let c=n.sourceArchives.get(o);if(c==null)return new Error(`Resolved source archive is unavailable for ${s.generatorId}`);try{Vpp(s,c);return}catch(l){return l}})}}function kjg(e,t){return new Set(e.flatMap((r,n)=>r!=null&&t[n]==null?[n]:[]))}async function Fjg({generatorInvocation:e,resolvedGeneratorInvocation:t,interactiveTaskContext:r,projectConfig:n,organization:i,workspace:o,context:s,generatorGroup:a,version:c,shouldLogS3Url:l,token:u,whitelabel:p,replay:d,absolutePathToPreview:f,isPreview:m,fiddlePreview:g,pushPreviewBranch:A,mode:y,fernignorePath:I,skipFernignore:C,dynamicIrOnly:x,validateWorkspace:S,retryRateLimited:B,requireEnvVars:D,automationMode:R,autoMerge:O,skipIfNoDiff:z,verify:Y,noReplay:$,disableTelemetry:ee,automation:se,generatorsYmlAbsolutePath:ue,occurrenceTracker:oe,loginCommand:me,specsTarGzArchive:xe,sdkGenApiPreflightError:Be,sdkGenApiRoute:pe,sdkConfigV1:ce,sdkGenApiPreparationBatch:Pe,sdkGenApiBatch:Ee,sdkGenApiTargetIdSeed:Fe,generateFullProject:Le,libraryVisibility:qe,mapFernGroupToSdkConfig:mt,onSnippetsProduced:At}){let Ht=Date.now();try{if(Be!=null)throw Be;let er={...FCe(t),libraryVisibility:qe},Ce=await o.toFernWorkspace({context:s},er,t.apiOverride?.specs);S&&await GJ({workspace:Ce,context:s,logWarnings:!1,ossWorkspace:o instanceof gl?o:void 0});let ge=C?void 0:I??await Kpp({generatorInvocation:t,context:r}),nt=await Afp({projectConfig:n,organization:i,workspace:Ce,interactiveTaskContext:r,generatorInvocation:{...t,outputMode:t.outputMode._visit({downloadFiles:()=>t.outputMode,github:ut=>Gr.OutputMode.github({...ut,makePr:y==="pull-request"}),githubV2:ut=>y==="pull-request"?Gr.OutputMode.githubV2(Gr.GithubOutputModeV2.pullRequest(ut)):t.outputMode,publish:()=>t.outputMode,publishV2:()=>t.outputMode,_other:()=>t.outputMode})},version:c,audiences:ce==null?a.audiences:ce.audiences==null?{type:"all"}:{type:"select",audiences:ce.audiences},shouldLogS3Url:l,token:u,whitelabel:p,replay:d,readme:t.readme,irVersionOverride:t.irVersionOverride,absolutePathToPreview:f,isPreview:m,fiddlePreview:g,pushPreviewBranch:A,fernignorePath:ge,skipFernignore:C,dynamicIrOnly:x,retryRateLimited:B,requireEnvVars:D,automationMode:R,autoMerge:O,skipIfNoDiff:z,verify:Y,noReplay:$,disableTelemetry:ee,loginCommand:me,specsTarGzBuffer:xe?.buffer,sdkGenApiSourceArchive:xe,sdkGenApiRoute:pe,sdkConfigV1:ce,sdkGenApiPreparationBatch:Pe,sdkGenApiBatch:Ee,sdkGenApiTargetIdSeed:Fe,generateFullProject:Le,mapFernGroupToSdkConfig:mt});if(nt?.createdSnippets&&(At(e),e.absolutePathToLocalSnippets!=null&&nt.snippetsS3PreSignedReadUrl!=null&&await Upp({snippetsS3PreSignedReadUrl:nt.snippetsS3PreSignedReadUrl,absolutePathToLocalSnippetJSON:e.absolutePathToLocalSnippets,context:r})),se!=null){let ut=ue!=null?await H8e(ue,e.name,oe.lookup(e)):void 0;se.recorder.recordSuccess({apiName:o.workspaceName,groupName:a.groupName,generatorName:e.name,version:nt?.actualVersion??null,durationMs:Date.now()-Ht,pullRequestUrl:nt?.pullRequestUrl,noChangesDetected:nt?.noChangesDetected,publishTarget:nt?.publishTarget,outputRepoUrl:W8e(e),generatorsYmlAbsolutePath:ue,generatorsYmlLineNumber:ut})}await Njg({pullRequestUrl:nt?.pullRequestUrl,publishTarget:nt?.publishTarget,noChangesDetected:nt?.noChangesDetected,version:nt?.actualVersion,generatorName:e.name,groupName:a.groupName,apiName:o.workspaceName,isAutomation:se!=null})}catch(er){if(Pe?.fail(Fe,er,se!=null),se!=null?Ee?.remove(Fe,er):Ee?.cancel(er),se==null)throw er;if(er instanceof Za){let nt=ue!=null?await H8e(ue,e.name,oe.lookup(e)):void 0;throw se.recorder.recordFailure({apiName:o.workspaceName,groupName:a.groupName,generatorName:e.name,errorMessage:r.getLastFailureMessage()??"Generator failed",durationMs:Date.now()-Ht,outputRepoUrl:W8e(e),generatorsYmlAbsolutePath:ue,generatorsYmlLineNumber:nt}),er}let Ce=tn(er),ge=ue!=null?await H8e(ue,e.name,oe.lookup(e)):void 0;se.recorder.recordFailure({apiName:o.workspaceName,groupName:a.groupName,generatorName:e.name,errorMessage:Ce,durationMs:Date.now()-Ht,outputRepoUrl:W8e(e),generatorsYmlAbsolutePath:ue,generatorsYmlLineNumber:ge}),r.failWithoutThrowing(Ce,er,{code:bpe(er)})}}function yfp(e,t){let r=e.findIndex(i=>i!=null);if(r<0)return;let n=e[r];throw n instanceof w?n:new Error(`Cannot prepare sdk-gen-api target ${t[r]?.name??r.toString()}: ${tn(n)}`,{cause:n})}async function Njg(e){if(!v4e())return;let t=[];if(e.pullRequestUrl!=null&&t.push({event:"PR created",body:e.pullRequestUrl,summaryLine:`\u{1F500} **${e.generatorName}** \u2192 [PR](${e.pullRequestUrl})`}),e.publishTarget!=null){let i=e.publishTarget.url??e.publishTarget.identifier;t.push({event:`Published to ${e.publishTarget.label}`,body:i!=null?`${e.publishTarget.version} \u2192 ${i}`:e.publishTarget.version,summaryLine:e.publishTarget.url!=null?`\u{1F4E6} **${e.generatorName}** \u2192 [${e.publishTarget.label} ${e.publishTarget.version}](${e.publishTarget.url})`:`\u{1F4E6} **${e.generatorName}** \u2192 ${e.publishTarget.label} ${e.publishTarget.version}${e.publishTarget.identifier!=null?` (${e.publishTarget.identifier})`:""}`})}if(e.noChangesDetected&&t.push({event:"No changes detected",body:"SDK repo is already up to date",summaryLine:`\u2705 **${e.generatorName}** \u2192 No changes detected`}),e.version!=null&&e.publishTarget==null&&e.pullRequestUrl==null&&t.push({event:`Version ${e.version}`,body:`Generated version ${e.version}`,summaryLine:`\u{1F3F7}\uFE0F **${e.generatorName}** \u2192 Version ${e.version}`}),t.length===0)return;let r=[`group=${e.groupName}`];e.apiName!=null&&e.apiName.length>0&&r.push(`api=${e.apiName}`);let n=`${e.generatorName} (${r.join(", ")})`;for(let i of t){let o=`${n} \u2192 ${i.event}`,s=C4e("notice",i.body,{title:o});s!=null&&process.stdout.write(s)}if(!e.isAutomation){let i=process.env.GITHUB_STEP_SUMMARY;if(i!=null&&i.length>0){let o=t.map(s=>`${s.summaryLine}
|
|
4121
4122
|
`).join("");try{await(0,bfp.appendFile)(i,o,"utf8")}catch(s){process.stderr.write(`[warn] Failed to append to GITHUB_STEP_SUMMARY: ${s}
|
|
@@ -4133,7 +4134,7 @@ ${pt.stack}`),$&&m?.({event:"reload",ok:!1,durationMs:Date.now()-we,error:tn(pt)
|
|
|
4133
4134
|
|
|
4134
4135
|
`),o.add(u),l.on("close",()=>o.delete(u));return}s.requestStarted(),u.once("close",()=>s.requestFinished());let d=pAp(l.url,i),f=yPs.default.request(d!=null?{host:"127.0.0.1",port:n,method:l.method,path:d,headers:l.headers}:{host:"127.0.0.1",port:t,method:l.method,path:l.url,headers:{...l.headers,[hAp]:r}},m=>{let g={...m.headers};if(!((g["content-type"]??"").includes("text/html")&&g["content-encoding"]==null)){u.writeHead(m.statusCode??502,g),m.pipe(u);return}let y=[];m.on("data",I=>y.push(I)),m.on("end",()=>{let I=Buffer.concat(y).toString("utf-8"),C=I.lastIndexOf("</body>"),x=C>=0?`${I.slice(0,C)}${dAp}${I.slice(C)}`:`${I}${dAp}`,S=Buffer.from(x,"utf-8");delete g["transfer-encoding"],g["content-length"]=S.byteLength.toString(),u.writeHead(m.statusCode??502,g),u.end(S)}),m.on("error",()=>u.destroy())});f.on("error",m=>{u.headersSent||u.writeHead(502,{"content-type":"text/plain"}),u.end(`Astro preview server unavailable: ${m.message}
|
|
4135
4136
|
`)}),l.pipe(f)})}function B_g({req:e,res:t,pathname:r,port:n,serverInfo:i,onShutdownRequest:o}){let s=(c,l,u={})=>{t.writeHead(c,{"content-type":"application/json","cache-control":"no-store",...u}),t.end(`${JSON.stringify(l)}
|
|
4136
|
-
`)},a=_ku({remoteAddress:e.socket.remoteAddress,host:e.headers.host,origin:e.headers.origin,controlHeader:e.headers[vCt],serverPort:n});if(a!=null){s(403,{error:a});return}if(r===ECt){if(e.method!=="GET"){s(405,{error:"use GET"},{allow:"GET"});return}s(200,i);return}if(e.method!=="POST"){s(405,{error:"use POST"},{allow:"POST"});return}t.once("finish",o),s(202,{stopping:!0},{connection:"close"})}function D_g(){return new Promise((e,t)=>{let r=bPs.default.createServer();r.once("error",t),r.listen(0,"127.0.0.1",()=>{let n=r.address(),i=typeof n=="object"&&n!=null?n.port:void 0;r.close(()=>i!=null?e(i):t(new Error("could not allocate a port")))})})}function R_g(e,t,r){let n=Date.now()+r;return new Promise((i,o)=>{let s=!1;t.on("exit",c=>{s=!0,o(new Error(`Astro preview server exited with code ${c} before becoming ready`))});let a=()=>{if(s)return;if(Date.now()>n){o(new Error("timed out waiting for the Astro preview server to become ready"));return}let c=bPs.default.connect(e,"127.0.0.1");c.once("connect",()=>{c.destroy(),i()}),c.once("error",()=>{c.destroy(),setTimeout(a,200)})};a()})}It();Dt();var bAp=/^[a-z0-9-]+-preview-[a-z0-9-]+\.docs\.buildwithfern\.com$/i,AAp="docs.buildwithfern.com",yAp=62;function t9e(e){let t=e.toLowerCase().trim();t.startsWith("https://")?t=t.slice(8):t.startsWith("http://")&&(t=t.slice(7));let r=t.indexOf("/");return r!==-1&&(t=t.slice(0,r)),bAp.test(t)}function v$t({orgId:e,previewId:t}){let r=qY(t),n=`${e}-preview-${r}.${AAp}`;if(n.length<=yAp)return n;let i=`${e}-preview-`,o=yAp-i.length;if(o<8)throw new w({message:`Organization name "${e}" is too long to generate a valid preview URL`,code:w.Code.ValidationError});let a=r.slice(0,o).replace(/-+$/,"");return`${i}${a}.${AAp}`}It();lI();Mm();tr();FE();Dt();cn();var KPs=require("child_process"),Ryp=Ae(IAp(),1),JPs=Ae(zEi(),1),YPs=Ae(require("fs"),1),ZPs=require("fs/promises"),kyp=Ae(require("http"),1),Fyp=Ae(require("os"),1),t0i=Ae(require("path"),1);VPs();lI();tr();var GPs=require("fs/promises");async function qPs(e,t){let r=new Map,{docsDefinition:n,translationPages:i,translationNavigationOverlays:o,translatedApiDefinitions:s,collectedFileIds:a,docsWorkspacePath:c,markdownFilesToPathName:l}=e,u=i!=null&&Object.keys(i).length>0,p=s!=null&&Object.keys(s).length>0;if(!u&&!p)return r;let d=n.config.translations?.defaultLocale,f=new Set([...Object.keys(i??{}),...Object.keys(s??{})]);for(let m of f){if(m===d)continue;let g=i?.[m]??{};try{let A=async ue=>{let oe=mo(c,ue),me=Mn(c,be.of(`translations/${m}/${oe}`));return await Ut(me)?me:ue},y=async ue=>{let oe=await A(ue),me=await(0,GPs.readFile)(oe,"utf-8"),xe=me.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/);return xe!=null?me.slice(xe[0].length):me},I=async ue=>{let oe=await A(ue);return(0,GPs.readFile)(oe,"utf-8")},C={};for(let[ue,oe]of Object.entries(n.pages))oe!=null&&(C[ue]=oe);for(let[ue,oe]of Object.entries(g))try{let me=C[ue],xe=Mn(c,be.of(ue)),{markdown:Be}=await Ck({markdown:oe,absolutePathToFernFolder:c,absolutePathToMarkdownFile:xe,context:t,markdownLoader:y}),pe=await r4({markdown:Be,absolutePathToFernFolder:c,absolutePathToMarkdownFile:xe,context:t,fileLoader:I}),ce=n4({markdown:pe,absolutePathToFernFolder:c,absolutePathToMarkdownFile:xe,context:t}),Pe=sO(ce);Pe=X3(Pe,a,l,{absolutePathToMarkdownFile:xe,absolutePathToFernFolder:c},t),C[ue]={markdown:Pe,rawMarkdown:Pe,editThisPageUrl:me?.editThisPageUrl,editThisPageLaunch:me?.editThisPageLaunch}}catch(me){t.logger.warn(`Failed to process translated page "${ue}" for locale "${m}": ${String(me)}. Falling back to base page.`)}let x=qVe(n.config.root,g,t),S=o?.[m],B=n.config.announcement,D=n.config.navbarLinks;S!=null&&(x=HVe(x,S),B=KVe(S)??B,S.navbarLinks!=null&&(D=S.navbarLinks));let R=n.apis,O=s?.[m],z=O,Y;if(O!=null&&x!=null){let ue=VVe(x,R,O);ue.size>0&&(t.logger.warn(`Translated API definition(s) [${Array.from(ue).join(", ")}] for locale "${m}" diverge from the default-locale spec (e.g. changed OpenAPI tag names, operationIds, or paths, or a missing/added endpoint), so they can't be fully matched to the navigation tree. Serving the default-locale API for those (localized sidebar titles are still applied where they can be matched). For fully localized API reference content, translate only human-readable text and keep tag names/operationIds/paths identical to the base spec.`),z=Object.fromEntries(Object.entries(O).filter(([oe])=>!ue.has(oe)))),Y=new Set(Object.keys(O).filter(oe=>!ue.has(oe)))}let ee=z!=null&&Object.keys(z).length>0?{...n.apis,...z}:n.apis;O!=null&&Object.keys(O).length>0&&x!=null&&(x=GVe(x,R,O,{rewritableApiIds:Y}));let se={...n,apis:ee,pages:C,config:{...n.config,root:x,announcement:B,navbarLinks:D}};r.set(m,se),t.logger.debug(`Computed translated definition for locale "${m}"`+(O!=null?` (with ${Object.keys(O).length} translated API(s))`:""))}catch(A){t.logger.warn(`Failed to compute translation for locale "${m}": ${String(A)}`)}}return r}tr();var Vq=require("fs/promises"),wyp=require("os"),HPs=Ae(require("path"),1),oVg=".fern",sVg="logs",WPs=100*1024*1024;function aVg(){return"cli@5.
|
|
4137
|
+
`)},a=_ku({remoteAddress:e.socket.remoteAddress,host:e.headers.host,origin:e.headers.origin,controlHeader:e.headers[vCt],serverPort:n});if(a!=null){s(403,{error:a});return}if(r===ECt){if(e.method!=="GET"){s(405,{error:"use GET"},{allow:"GET"});return}s(200,i);return}if(e.method!=="POST"){s(405,{error:"use POST"},{allow:"POST"});return}t.once("finish",o),s(202,{stopping:!0},{connection:"close"})}function D_g(){return new Promise((e,t)=>{let r=bPs.default.createServer();r.once("error",t),r.listen(0,"127.0.0.1",()=>{let n=r.address(),i=typeof n=="object"&&n!=null?n.port:void 0;r.close(()=>i!=null?e(i):t(new Error("could not allocate a port")))})})}function R_g(e,t,r){let n=Date.now()+r;return new Promise((i,o)=>{let s=!1;t.on("exit",c=>{s=!0,o(new Error(`Astro preview server exited with code ${c} before becoming ready`))});let a=()=>{if(s)return;if(Date.now()>n){o(new Error("timed out waiting for the Astro preview server to become ready"));return}let c=bPs.default.connect(e,"127.0.0.1");c.once("connect",()=>{c.destroy(),i()}),c.once("error",()=>{c.destroy(),setTimeout(a,200)})};a()})}It();Dt();var bAp=/^[a-z0-9-]+-preview-[a-z0-9-]+\.docs\.buildwithfern\.com$/i,AAp="docs.buildwithfern.com",yAp=62;function t9e(e){let t=e.toLowerCase().trim();t.startsWith("https://")?t=t.slice(8):t.startsWith("http://")&&(t=t.slice(7));let r=t.indexOf("/");return r!==-1&&(t=t.slice(0,r)),bAp.test(t)}function v$t({orgId:e,previewId:t}){let r=qY(t),n=`${e}-preview-${r}.${AAp}`;if(n.length<=yAp)return n;let i=`${e}-preview-`,o=yAp-i.length;if(o<8)throw new w({message:`Organization name "${e}" is too long to generate a valid preview URL`,code:w.Code.ValidationError});let a=r.slice(0,o).replace(/-+$/,"");return`${i}${a}.${AAp}`}It();lI();Mm();tr();FE();Dt();cn();var KPs=require("child_process"),Ryp=Ae(IAp(),1),JPs=Ae(zEi(),1),YPs=Ae(require("fs"),1),ZPs=require("fs/promises"),kyp=Ae(require("http"),1),Fyp=Ae(require("os"),1),t0i=Ae(require("path"),1);VPs();lI();tr();var GPs=require("fs/promises");async function qPs(e,t){let r=new Map,{docsDefinition:n,translationPages:i,translationNavigationOverlays:o,translatedApiDefinitions:s,collectedFileIds:a,docsWorkspacePath:c,markdownFilesToPathName:l}=e,u=i!=null&&Object.keys(i).length>0,p=s!=null&&Object.keys(s).length>0;if(!u&&!p)return r;let d=n.config.translations?.defaultLocale,f=new Set([...Object.keys(i??{}),...Object.keys(s??{})]);for(let m of f){if(m===d)continue;let g=i?.[m]??{};try{let A=async ue=>{let oe=mo(c,ue),me=Mn(c,be.of(`translations/${m}/${oe}`));return await Ut(me)?me:ue},y=async ue=>{let oe=await A(ue),me=await(0,GPs.readFile)(oe,"utf-8"),xe=me.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/);return xe!=null?me.slice(xe[0].length):me},I=async ue=>{let oe=await A(ue);return(0,GPs.readFile)(oe,"utf-8")},C={};for(let[ue,oe]of Object.entries(n.pages))oe!=null&&(C[ue]=oe);for(let[ue,oe]of Object.entries(g))try{let me=C[ue],xe=Mn(c,be.of(ue)),{markdown:Be}=await Ck({markdown:oe,absolutePathToFernFolder:c,absolutePathToMarkdownFile:xe,context:t,markdownLoader:y}),pe=await r4({markdown:Be,absolutePathToFernFolder:c,absolutePathToMarkdownFile:xe,context:t,fileLoader:I}),ce=n4({markdown:pe,absolutePathToFernFolder:c,absolutePathToMarkdownFile:xe,context:t}),Pe=sO(ce);Pe=X3(Pe,a,l,{absolutePathToMarkdownFile:xe,absolutePathToFernFolder:c},t),C[ue]={markdown:Pe,rawMarkdown:Pe,editThisPageUrl:me?.editThisPageUrl,editThisPageLaunch:me?.editThisPageLaunch}}catch(me){t.logger.warn(`Failed to process translated page "${ue}" for locale "${m}": ${String(me)}. Falling back to base page.`)}let x=qVe(n.config.root,g,t),S=o?.[m],B=n.config.announcement,D=n.config.navbarLinks;S!=null&&(x=HVe(x,S),B=KVe(S)??B,S.navbarLinks!=null&&(D=S.navbarLinks));let R=n.apis,O=s?.[m],z=O,Y;if(O!=null&&x!=null){let ue=VVe(x,R,O);ue.size>0&&(t.logger.warn(`Translated API definition(s) [${Array.from(ue).join(", ")}] for locale "${m}" diverge from the default-locale spec (e.g. changed OpenAPI tag names, operationIds, or paths, or a missing/added endpoint), so they can't be fully matched to the navigation tree. Serving the default-locale API for those (localized sidebar titles are still applied where they can be matched). For fully localized API reference content, translate only human-readable text and keep tag names/operationIds/paths identical to the base spec.`),z=Object.fromEntries(Object.entries(O).filter(([oe])=>!ue.has(oe)))),Y=new Set(Object.keys(O).filter(oe=>!ue.has(oe)))}let ee=z!=null&&Object.keys(z).length>0?{...n.apis,...z}:n.apis;O!=null&&Object.keys(O).length>0&&x!=null&&(x=GVe(x,R,O,{rewritableApiIds:Y}));let se={...n,apis:ee,pages:C,config:{...n.config,root:x,announcement:B,navbarLinks:D}};r.set(m,se),t.logger.debug(`Computed translated definition for locale "${m}"`+(O!=null?` (with ${Object.keys(O).length} translated API(s))`:""))}catch(A){t.logger.warn(`Failed to compute translation for locale "${m}": ${String(A)}`)}}return r}tr();var Vq=require("fs/promises"),wyp=require("os"),HPs=Ae(require("path"),1),oVg=".fern",sVg="logs",WPs=100*1024*1024;function aVg(){return"cli@5.198.0"}var a9e=class{logFilePath=null;initialized=!1;sessionStartTime;consoleLogger;constructor(){this.sessionStartTime=Date.now()}async initialize(t,r){if(this.initialized)return;this.consoleLogger=t;let n=r??Re(Re(Zt.of((0,wyp.homedir)()),be.of(oVg)),be.of(sVg));await Ut(n)||await(0,Vq.mkdir)(n,{recursive:!0});let o=`${new Date().toISOString().replace(/[:.]/g,"-")}.debug.log`;this.logFilePath=Re(n,be.of(o));let s=["================================================================================","Fern Docs Dev Debug Log",`Session started: ${new Date().toISOString()}`,`Log file: ${HPs.default.basename(this.logFilePath)}`,"================================================================================",""].join(`
|
|
4137
4138
|
`);await(0,Vq.writeFile)(this.logFilePath,s,"utf-8"),this.initialized=!0,this.enforceLogSizeLimit(n)}getLogFilePath(){return this.logFilePath}async writeEntry(t){if(!this.initialized||!this.logFilePath)return;let r=JSON.stringify(t)+`
|
|
4138
4139
|
`;try{await(0,Vq.appendFile)(this.logFilePath,r,"utf-8")}catch{}}async logFrontendMetrics(t){let r={timestamp:t.timestamp,source:t.source,level:t.level,eventType:this.getEventType(t.payload,t.isAggregate),isAggregate:t.isAggregate,data:t.payload};await this.writeEntry(r)}async logCliMetric(t,r="info"){let n={timestamp:t.timestamp,source:aVg(),level:r,eventType:t.type,data:{durationMs:t.durationMs,metadata:t.metadata}};await this.writeEntry(n)}async logCliMemory(){let t=process.memoryUsage(),r={type:"cli_memory",timestamp:new Date().toISOString(),metadata:{heapUsed:t.heapUsed,heapTotal:t.heapTotal,external:t.external,rss:t.rss,heapUsedMB:Math.round(t.heapUsed/1024/1024*100)/100,heapTotalMB:Math.round(t.heapTotal/1024/1024*100)/100,rssMB:Math.round(t.rss/1024/1024*100)/100}};await this.logCliMetric(r)}async logCliReloadStart(){let t={type:"cli_reload_start",timestamp:new Date().toISOString()};await this.logCliMetric(t)}async logCliReloadFinish(t,r){let n={type:"cli_reload_finish",timestamp:new Date().toISOString(),durationMs:t,metadata:r};await this.logCliMetric(n)}async logCliDocsGeneration(t,r){let n={type:"cli_docs_generation",timestamp:new Date().toISOString(),durationMs:t,metadata:r};await this.logCliMetric(n)}async logCliValidation(t,r){let n={type:"cli_validation",timestamp:new Date().toISOString(),durationMs:t,metadata:{success:r}};await this.logCliMetric(n)}async enforceLogSizeLimit(t){try{let n=(await(0,Vq.readdir)(t)).filter(c=>c.endsWith(".log")),i=[];for(let c of n){let l=HPs.default.join(t,c);try{let u=await(0,Vq.stat)(l);i.push({name:c,fullPath:l,size:u.size,mtimeMs:u.mtimeMs})}catch{}}let o=i.reduce((c,l)=>c+l.size,0),s=Math.round(o/1024/1024*100)/100,a=WPs/1024/1024;if(o<=WPs){this.consoleLogger?.debug(`Log directory size ${s} MB does not exceed ${a} MB cap`);return}this.consoleLogger?.info(`Rotating logs: total size ${s} MB exceeds ${a} MB cap`),i.sort((c,l)=>c.mtimeMs-l.mtimeMs);for(let c of i){if(o<=WPs)break;if(!(this.logFilePath!=null&&c.fullPath===this.logFilePath))try{await(0,Vq.unlink)(c.fullPath),o-=c.size}catch{}}}catch{}}getEventType(t,r){return r?"aggregate_summary":"type"in t&&typeof t.type=="string"?t.type:"unknown"}static isMetricsMessage(t){if(typeof t!="object"||t===null)return!1;let r=t;return r.type==="metrics"&&typeof r.timestamp=="string"&&typeof r.source=="string"}};var e0i={"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET, POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type"};function Typ(e){let t=cVg();if(t==null)return;let{port:r,debugLogger:n,getDocsLoadResponse:i,extractLocaleFromPath:o}=e,s=new Map;function a(l){let u=JSON.stringify(l),p=[];for(let[d]of s)try{d.send(u)}catch{p.push(d)}for(let d of p){let f=s.get(d);f&&(clearInterval(f.pingInterval),s.delete(d))}}let c=t.serve({port:r,async fetch(l,u){if(l.method==="OPTIONS")return new Response(null,{status:204,headers:e0i});let p=new URL(l.url);if(l.headers.get("upgrade")?.toLowerCase()==="websocket"){u.upgrade(l,{data:{connectionId:`${Date.now()}`}});return}if(l.method==="POST"&&p.pathname==="/v2/registry/docs/load-with-url")try{let f=await l.json(),m=o?.(f?.url);return new Response(JSON.stringify(i(m)),{headers:{"Content-Type":"application/json",...e0i}})}catch{return new Response(JSON.stringify(i()),{headers:{"Content-Type":"application/json",...e0i}})}let d=/^\/_local\/(.*)/.exec(p.pathname);return l.method==="GET"&&d!=null?new Response(t.file(`/${d[1]}`),{headers:e0i}):new Response("Not Found",{status:404})},websocket:{open(l){let{connectionId:u}=l.data,p=setInterval(()=>{let d=s.get(l);if(!d)return;let f=Date.now();if(f-d.lastPong>9e4){l.close();return}try{l.send(JSON.stringify({type:"ping",timestamp:f}))}catch{l.close()}},3e4);s.set(l,{pingInterval:p,lastPong:Date.now()});try{l.send(JSON.stringify({type:"connected",connectionId:u}))}catch{}},message(l,u){try{let p=JSON.parse(u.toString());if(p.type==="pong"){let d=s.get(l);d&&(d.lastPong=Date.now())}else a9e.isMetricsMessage(p)&&n.logFrontendMetrics(p)}catch{}},close(l){let u=s.get(l);u&&(clearInterval(u.pingInterval),s.delete(l))}}});return{sendData:a,stop:l=>c.stop(l)}}function cVg(){return globalThis.Bun}var Oyp=require("fs"),Pyp=Ae(require("path"),1),lVg=`"use strict";
|
|
4139
4140
|
|
|
@@ -4471,7 +4472,7 @@ ${A}
|
|
|
4471
4472
|
|
|
4472
4473
|
Add a 'docs:' section to your fern.yml to get started.`,code:w.Code.ConfigError});let i=n.docs.raw.libraries;if(i==null)throw new w({message:`No libraries configured in docs.yml.
|
|
4473
4474
|
|
|
4474
|
-
Add a 'libraries' section to configure library documentation.`,code:w.Code.ConfigError});let o=await t.getTokenOrPrompt();await t.verifyOrgAccess({organization:n.org,token:o});let s=n.docs.absoluteFilePath??n.absoluteFilePath??t.cwd,a=Zt.of(Vr(s)),c=new md({context:t,logLevel:Vn.Info});await Qtr({libraries:i,library:r.library,docsDirectoryPath:a,orgId:n.org,tokenValue:o.value,context:c,wrapStep:DO,docsConfig:n.docs.raw})}};function tQs(e){let t=new eQs;ni(e,"generate","[Beta] Generate MDX documentation from library source code. Requires 'libraries' config in docs.yml.",(r,n)=>t.handle(r,n),r=>r.option("library",{type:"string",description:"Name of a specific library defined in docs.yml to generate docs for"}))}function rQs(e){lA({cli:e,name:"md",subcommands:[tQs,Czs]})}Dt();function Ewi(e,t,r,n,i,o){e.command(t,r,s=>{for(let a of o)a(s);return s.command("$0",!1,a=>{let c=a.version(!1);return i!=null?i(c):c},jen(n)),s.version(!1).usage(r)})}It();lI();Dt();cn();It();Dt();var Iwi=class{context;task;project;docsWorkspace;ossWorkspaces;token;constructor({context:t,task:r,project:n,docsWorkspace:i,ossWorkspaces:o,token:s}){this.context=t,this.task=r,this.project=n,this.docsWorkspace=i,this.ossWorkspaces=o,this.token=s}async publish({instanceUrl:t,preview:r,previewId:n,skipUpload:i}){let o=new md({context:this.context,task:this.task});try{let s=await XZt({organization:this.project.config.organization,apiWorkspaces:this.project.apiWorkspaces,ossWorkspaces:this.ossWorkspaces,docsWorkspace:this.docsWorkspace,context:o,token:this.token,instanceUrl:t,preview:r,previewId:n,disableTemplates:void 0,skipUpload:i,cliVersion:"5.
|
|
4475
|
+
Add a 'libraries' section to configure library documentation.`,code:w.Code.ConfigError});let o=await t.getTokenOrPrompt();await t.verifyOrgAccess({organization:n.org,token:o});let s=n.docs.absoluteFilePath??n.absoluteFilePath??t.cwd,a=Zt.of(Vr(s)),c=new md({context:t,logLevel:Vn.Info});await Qtr({libraries:i,library:r.library,docsDirectoryPath:a,orgId:n.org,tokenValue:o.value,context:c,wrapStep:DO,docsConfig:n.docs.raw})}};function tQs(e){let t=new eQs;ni(e,"generate","[Beta] Generate MDX documentation from library source code. Requires 'libraries' config in docs.yml.",(r,n)=>t.handle(r,n),r=>r.option("library",{type:"string",description:"Name of a specific library defined in docs.yml to generate docs for"}))}function rQs(e){lA({cli:e,name:"md",subcommands:[tQs,Czs]})}Dt();function Ewi(e,t,r,n,i,o){e.command(t,r,s=>{for(let a of o)a(s);return s.command("$0",!1,a=>{let c=a.version(!1);return i!=null?i(c):c},jen(n)),s.version(!1).usage(r)})}It();lI();Dt();cn();It();Dt();var Iwi=class{context;task;project;docsWorkspace;ossWorkspaces;token;constructor({context:t,task:r,project:n,docsWorkspace:i,ossWorkspaces:o,token:s}){this.context=t,this.task=r,this.project=n,this.docsWorkspace=i,this.ossWorkspaces=o,this.token=s}async publish({instanceUrl:t,preview:r,previewId:n,skipUpload:i}){let o=new md({context:this.context,task:this.task});try{let s=await XZt({organization:this.project.config.organization,apiWorkspaces:this.project.apiWorkspaces,ossWorkspaces:this.ossWorkspaces,docsWorkspace:this.docsWorkspace,context:o,token:this.token,instanceUrl:t,preview:r,previewId:n,disableTemplates:void 0,skipUpload:i,cliVersion:"5.198.0",loginCommand:"fern auth login"});return o.getResult()===pf.Failure?{success:!1}:{success:!0,url:s}}catch(s){return{success:!1,error:tn(s)}}}};It();cn();var yOt=class e{static MAX_DISPLAYED_LOGS_TTY=10;static URL_PATTERN=/https?:\/\/[^\s]+/;context;stream;tasks={};taskOrder=[];startTime;isRegistered=!1;constructor(t){this.context=t.context,this.stream=t.stream??process.stderr}addTask(t){let r={...t,status:t.status??"pending"};return this.tasks[t.id]=r,this.taskOrder.push(t.id),this}async start(t){return this.startTime=Date.now(),t!=null&&await this.context.ttyAwareLogger.takeOverTerminal(()=>{this.stream.write(`
|
|
4475
4476
|
`),this.stream.write(`${le.cyan("\u25C6")} ${le.bold(t.title)}
|
|
4476
4477
|
`),t.subtitle!=null&&this.stream.write(` ${le.dim(t.subtitle)}
|
|
4477
4478
|
`),this.stream.write(`
|
|
@@ -5537,7 +5538,7 @@ ${r}`}function zOi(e){let t=this,{emitParseErrors:r,...n}={...t.data("settings")
|
|
|
5537
5538
|
`),g="";return c&&(g=u.style.error(c)),[`${p} ${f} ${s}`,[m,g].filter(Boolean).join(`
|
|
5538
5539
|
`)]});var X9A=HC((e,t)=>{let{validate:r=()=>!0}=e,n=wI(e.theme),[i,o]=nl("idle"),[s,a]=nl(),[c,l]=nl(""),u=qC({status:i,theme:n});WC(async(g,A)=>{if(i==="idle")if(GC(g)){let y=c;o("loading");let I=await r(y);I===!0?(l(y),o("done"),t(y)):(A.write(c),a(I||"You must provide a valid value"),o("idle"))}else l(A.line),a(void 0)});let p=n.style.message(e.message,i),d="",f;e.mask?d=(typeof e.mask=="string"?e.mask:"*").repeat(c.length):i!=="done"&&(f=`${n.style.help("[input is masked]")}${vPt}`),i==="done"&&(d=n.style.answer(d));let m="";return s&&(m=n.style.error(s)),[[u,p,e.mask?d:f].join(" "),m]});var bWe=Ae(pw(),1);var Z9A={icon:{cursor:zx.pointer},style:{disabled:e=>bWe.default.dim(`- ${e}`),searchTerm:e=>bWe.default.cyan(e),description:e=>bWe.default.cyan(e),keysHelpTip:e=>e.map(([t,r])=>`${bWe.default.bold(t)} ${bWe.default.dim(r)}`).join(bWe.default.dim(" \u2022 "))},helpMode:"always"};function THs(e){return!Id.isSeparator(e)&&!e.disabled}function $9A(e){return e.map(t=>{if(Id.isSeparator(t))return t;if(typeof t=="string")return{value:t,name:t,short:t,disabled:!1};let r=t.name??String(t.value),n={value:t.value,name:r,short:t.short??r,disabled:t.disabled??!1};return t.description&&(n.description=t.description),n})}var eqA=HC((e,t)=>{let{pageSize:r=7,validate:n=()=>!0}=e,i=wI(Z9A,e.theme),[o,s]=nl("loading"),[a,c]=nl(""),[l,u]=nl([]),[p,d]=nl(),f=qC({status:o,theme:i}),m=QL(()=>{let z=l.findIndex(THs),Y=l.findLastIndex(THs);return{first:z,last:Y}},[l]),[g=m.first,A]=nl();c_(()=>{let z=new AbortController;return s("loading"),d(void 0),(async()=>{try{let $=await e.source(a||void 0,{signal:z.signal});z.signal.aborted||(A(void 0),d(void 0),u($9A($)),s("idle"))}catch($){!z.signal.aborted&&$ instanceof Error&&d($.message)}})(),()=>{z.abort()}},[a]);let y=l[g];WC(async(z,Y)=>{if(GC(z))if(y){s("loading");let $=await n(y.value);s("idle"),$===!0?(s("done"),t(y.value)):y.name===a?d($||"You must provide a valid value"):(Y.write(y.name),c(y.name))}else Y.write(a);else if(rye(z)&&y)Y.clearLine(0),Y.write(y.name),c(y.name);else if(o!=="loading"&&(LB(z)||zL(z))){if(Y.clearLine(0),LB(z)&&g!==m.first||zL(z)&&g!==m.last){let $=LB(z)?-1:1,ee=g;do ee=(ee+$+l.length)%l.length;while(!THs(l[ee]));A(ee)}}else c(Y.line)});let I=i.style.message(e.message,o),C;if(i.helpMode!=="never")if(e.instructions){let{pager:z,navigation:Y}=e.instructions;C=i.style.help(l.length>r?z:Y)}else C=i.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]);let x=hWe({items:l,active:g,renderItem({item:z,isActive:Y}){if(Id.isSeparator(z))return` ${z.separator}`;if(z.disabled){let se=typeof z.disabled=="string"?z.disabled:"(disabled)";return i.style.disabled(`${z.name} ${se}`)}let $=Y?i.style.highlight:se=>se,ee=Y?i.icon.cursor:" ";return $(`${ee} ${z.name}`)},pageSize:r,loop:!1}),S;p?S=i.style.error(p):l.length===0&&a!==""&&o==="idle"&&(S=i.style.error("No results found"));let B;if(o==="done"&&y)return[f,I,i.style.answer(y.short)].filter(Boolean).join(" ").trimEnd();B=i.style.searchTerm(a);let D=y?.description,R=[f,I,B].filter(Boolean).join(" ").trimEnd(),O=[S??x," ",D?i.style.description(D):"",C].filter(Boolean).join(`
|
|
5539
5540
|
`).trimEnd();return[R,O]});var xPt=Ae(pw(),1);var tqA={icon:{cursor:zx.pointer},style:{disabled:e=>xPt.default.dim(`- ${e}`),description:e=>xPt.default.cyan(e),keysHelpTip:e=>e.map(([t,r])=>`${xPt.default.bold(t)} ${xPt.default.dim(r)}`).join(xPt.default.dim(" \u2022 "))},helpMode:"always",indexMode:"hidden",keybindings:[]};function CPt(e){return!Id.isSeparator(e)&&!e.disabled}function rqA(e){return e.map(t=>{if(Id.isSeparator(t))return t;if(typeof t=="string")return{value:t,name:t,short:t,disabled:!1};let r=t.name??String(t.value),n={value:t.value,name:r,short:t.short??r,disabled:t.disabled??!1};return t.description&&(n.description=t.description),n})}var OHs=HC((e,t)=>{let{loop:r=!0,pageSize:n=7}=e,i=wI(tqA,e.theme),{keybindings:o}=i,[s,a]=nl("idle"),c=qC({status:s,theme:i}),l=mWe(),u=!o.includes("vim"),p=QL(()=>rqA(e.choices),[e.choices]),d=QL(()=>{let D=p.findIndex(CPt),R=p.findLastIndex(CPt);if(D===-1)throw new ple("[select prompt] No selectable choices. All choices are disabled.");return{first:D,last:R}},[p]),f=QL(()=>"default"in e?p.findIndex(D=>CPt(D)&&D.value===e.default):-1,[e.default,p]),[m,g]=nl(f===-1?d.first:f),A=p[m];WC((D,R)=>{if(clearTimeout(l.current),GC(D))a("done"),t(A.value);else if(LB(D,o)||zL(D,o)){if(R.clearLine(0),r||LB(D,o)&&m!==d.first||zL(D,o)&&m!==d.last){let O=LB(D,o)?-1:1,z=m;do z=(z+O+p.length)%p.length;while(!CPt(p[z]));g(z)}}else if(dnr(D)&&!Number.isNaN(Number(R.line))){let O=Number(R.line)-1,z=-1,Y=p.findIndex(ee=>Id.isSeparator(ee)?!1:(z++,z===O)),$=p[Y];$!=null&&CPt($)&&g(Y),l.current=setTimeout(()=>{R.clearLine(0)},700)}else if(pWe(D))R.clearLine(0);else if(u){let O=R.line.toLowerCase(),z=p.findIndex(Y=>Id.isSeparator(Y)||!CPt(Y)?!1:Y.name.toLowerCase().startsWith(O));z!==-1&&g(z),l.current=setTimeout(()=>{R.clearLine(0)},700)}}),c_(()=>()=>{clearTimeout(l.current)},[]);let y=i.style.message(e.message,s),I;if(i.helpMode!=="never")if(e.instructions){let{pager:D,navigation:R}=e.instructions;I=i.style.help(p.length>n?D:R)}else I=i.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]);let C=0,x=hWe({items:p,active:m,renderItem({item:D,isActive:R,index:O}){if(Id.isSeparator(D))return C++,` ${D.separator}`;let z=i.indexMode==="number"?`${O+1-C}. `:"";if(D.disabled){let ee=typeof D.disabled=="string"?D.disabled:"(disabled)";return i.style.disabled(`${z}${D.name} ${ee}`)}let Y=R?i.style.highlight:ee=>ee,$=R?i.icon.cursor:" ";return Y(`${$} ${z}${D.name}`)},pageSize:n,loop:r});if(s==="done")return[c,y,i.style.answer(A.short)].filter(Boolean).join(" ");let{description:S}=A;return`${[[c,y].filter(Boolean).join(" "),x," ",S?i.style.description(S):"",I].filter(Boolean).join(`
|
|
5540
|
-
`).trimEnd()}${vPt}`});cn();Io();var fle={GENERATION_STARTED:"generation_started",GENERATION_COMPLETED:"generation_completed",GENERATION_FAILED:"generation_failed",VERIFICATION_FAILED:"verification_failed",SDK_PR_CREATED:"sdk_pr_created",UPGRADE_APPLIED:"upgrade_applied",MAJOR_VERSION_BUMP:"major_version_bump"},nqA={[fle.GENERATION_STARTED]:!1,[fle.GENERATION_COMPLETED]:!1,[fle.GENERATION_FAILED]:!0,[fle.VERIFICATION_FAILED]:!0,[fle.SDK_PR_CREATED]:!1,[fle.UPGRADE_APPLIED]:!1,[fle.MAJOR_VERSION_BUMP]:!1};function iUp(e){return nqA[e]}function oUp(e,t){return{automation_mode:!0,surface:"cli",action:t.action,run_id:t.run_id,github_run_id:t.github_run_id,github_run_url:t.github_run_url,org:t.org,config_repo:t.config_repo,config_commit_sha:t.config_commit_sha,config_branch:t.config_branch,config_pr_number:t.config_pr_number,trigger:t.trigger,cli_version:t.cli_version,...e.errorCode!==void 0?{error_code:e.errorCode}:{},...e.attributes??{}}}function sUp(e,t){function r(i,o,s){s!=null&&(i[o]=s)}let n={surface:"cli",automation_mode:"true"};return r(n,"event",e.event),r(n,"action",t.action),r(n,"run_id",t.run_id),r(n,"org",t.org),r(n,"config_repo",t.config_repo),r(n,"trigger",t.trigger),r(n,"error_code",e.errorCode??"none"),n}function aUp(e,t){return{github_run_id:t.github_run_id,github_run_url:t.github_run_url,config_commit_sha:t.config_commit_sha,config_branch:t.config_branch,config_pr_number:t.config_pr_number,cli_version:t.cli_version,...e.attributes??{}}}function cUp(e,t){return{event:e.event,timestamp:new Date().toISOString(),surface:"cli",action:t.action,run_id:t.run_id,github_run_id:t.github_run_id,github_run_url:t.github_run_url,org:t.org,config_repo:t.config_repo,config_commit_sha:t.config_commit_sha,config_branch:t.config_branch,config_pr_number:t.config_pr_number,trigger:t.trigger,cli_version:t.cli_version,...e.errorCode!==void 0?{error_code:e.errorCode}:{},...e.attributes??{}}}function lUp(e){let t=e.join(" ");return/\bautomations\s+generate\b/.test(t)?fle.GENERATION_FAILED:/\bautomations\s+preview\b/.test(t)?fle.VERIFICATION_FAILED:fle.GENERATION_FAILED}var iqA="",oqA="FERN_AUTOMATION_EVENTS_ORIGIN",sqA=3e3,bPi=class e{static instance;origin;inflight=[];static getInstance(){return e.instance==null&&(e.instance=new e(process.env[oqA]??iqA)),e.instance}constructor(t){this.origin=t}resolveEndpoint(){if(this.origin.length!==0)return`${this.origin.replace(/\/$/,"")}/v1/automation/events`}post(t,r){this.inflight.push(this.send(t,r))}async shutdown(){let t=this.inflight;this.inflight=[],t.length>0&&await Promise.allSettled(t)}async send(t,r){let n=this.resolveEndpoint();if(n==null)return;let i=new AbortController,o=setTimeout(()=>i.abort(),sqA);try{let s={"content-type":"application/json"},a=await oz();a!=null&&a.value.length>0&&(s.Authorization=`Bearer ${a.value}`);let c=await fetch(n,{method:"POST",headers:s,body:JSON.stringify(cUp(t,r)),signal:i.signal})}catch{return}finally{clearTimeout(o)}}};function uUp(){let{fern_run_id:e,github_run_id:t}=Tpe();return{action:process.env.FERN_ACTION,run_id:e,github_run_id:t,github_run_url:process.env.FERN_GITHUB_RUN_URL,org:void 0,config_repo:process.env.FERN_CONFIG_REPO,config_commit_sha:process.env.FERN_CONFIG_COMMIT_SHA,config_branch:process.env.FERN_CONFIG_BRANCH,config_pr_number:process.env.FERN_CONFIG_PR_NUMBER,trigger:process.env.GITHUB_EVENT_NAME,cli_version:"5.
|
|
5541
|
+
`).trimEnd()}${vPt}`});cn();Io();var fle={GENERATION_STARTED:"generation_started",GENERATION_COMPLETED:"generation_completed",GENERATION_FAILED:"generation_failed",VERIFICATION_FAILED:"verification_failed",SDK_PR_CREATED:"sdk_pr_created",UPGRADE_APPLIED:"upgrade_applied",MAJOR_VERSION_BUMP:"major_version_bump"},nqA={[fle.GENERATION_STARTED]:!1,[fle.GENERATION_COMPLETED]:!1,[fle.GENERATION_FAILED]:!0,[fle.VERIFICATION_FAILED]:!0,[fle.SDK_PR_CREATED]:!1,[fle.UPGRADE_APPLIED]:!1,[fle.MAJOR_VERSION_BUMP]:!1};function iUp(e){return nqA[e]}function oUp(e,t){return{automation_mode:!0,surface:"cli",action:t.action,run_id:t.run_id,github_run_id:t.github_run_id,github_run_url:t.github_run_url,org:t.org,config_repo:t.config_repo,config_commit_sha:t.config_commit_sha,config_branch:t.config_branch,config_pr_number:t.config_pr_number,trigger:t.trigger,cli_version:t.cli_version,...e.errorCode!==void 0?{error_code:e.errorCode}:{},...e.attributes??{}}}function sUp(e,t){function r(i,o,s){s!=null&&(i[o]=s)}let n={surface:"cli",automation_mode:"true"};return r(n,"event",e.event),r(n,"action",t.action),r(n,"run_id",t.run_id),r(n,"org",t.org),r(n,"config_repo",t.config_repo),r(n,"trigger",t.trigger),r(n,"error_code",e.errorCode??"none"),n}function aUp(e,t){return{github_run_id:t.github_run_id,github_run_url:t.github_run_url,config_commit_sha:t.config_commit_sha,config_branch:t.config_branch,config_pr_number:t.config_pr_number,cli_version:t.cli_version,...e.attributes??{}}}function cUp(e,t){return{event:e.event,timestamp:new Date().toISOString(),surface:"cli",action:t.action,run_id:t.run_id,github_run_id:t.github_run_id,github_run_url:t.github_run_url,org:t.org,config_repo:t.config_repo,config_commit_sha:t.config_commit_sha,config_branch:t.config_branch,config_pr_number:t.config_pr_number,trigger:t.trigger,cli_version:t.cli_version,...e.errorCode!==void 0?{error_code:e.errorCode}:{},...e.attributes??{}}}function lUp(e){let t=e.join(" ");return/\bautomations\s+generate\b/.test(t)?fle.GENERATION_FAILED:/\bautomations\s+preview\b/.test(t)?fle.VERIFICATION_FAILED:fle.GENERATION_FAILED}var iqA="",oqA="FERN_AUTOMATION_EVENTS_ORIGIN",sqA=3e3,bPi=class e{static instance;origin;inflight=[];static getInstance(){return e.instance==null&&(e.instance=new e(process.env[oqA]??iqA)),e.instance}constructor(t){this.origin=t}resolveEndpoint(){if(this.origin.length!==0)return`${this.origin.replace(/\/$/,"")}/v1/automation/events`}post(t,r){this.inflight.push(this.send(t,r))}async shutdown(){let t=this.inflight;this.inflight=[],t.length>0&&await Promise.allSettled(t)}async send(t,r){let n=this.resolveEndpoint();if(n==null)return;let i=new AbortController,o=setTimeout(()=>i.abort(),sqA);try{let s={"content-type":"application/json"},a=await oz();a!=null&&a.value.length>0&&(s.Authorization=`Bearer ${a.value}`);let c=await fetch(n,{method:"POST",headers:s,body:JSON.stringify(cUp(t,r)),signal:i.signal})}catch{return}finally{clearTimeout(o)}}};function uUp(){let{fern_run_id:e,github_run_id:t}=Tpe();return{action:process.env.FERN_ACTION,run_id:e,github_run_id:t,github_run_url:process.env.FERN_GITHUB_RUN_URL,org:void 0,config_repo:process.env.FERN_CONFIG_REPO,config_commit_sha:process.env.FERN_CONFIG_COMMIT_SHA,config_branch:process.env.FERN_CONFIG_BRANCH,config_pr_number:process.env.FERN_CONFIG_PR_NUMBER,trigger:process.env.GITHUB_EVENT_NAME,cli_version:"5.198.0"}}function pUp(){return process.env.FERN_AUTOMATION==="true"}var aqA=3e3,EPi=class{constructor(t,r=bPi.getInstance()){this.reporter=t;this.automationEventApiClient=r;this.context=uUp()}reporter;automationEventApiClient;context;setOrganization(t){this.context={...this.context,org:t}}emit(t,r){let n=this.captureSentryForFailure({event:t,context:this.context,error:r?.error}),i=n==null?t:{...t,attributes:{...t.attributes??{},sentry_event_id:n}};this.capturePostHogEvent({event:i,context:this.context}),this.captureAutomationEventApiEvent(i,this.context)}async flush(){let t;try{await Promise.race([this.automationEventApiClient.shutdown(),new Promise(r=>{t=setTimeout(r,aqA)})])}finally{clearTimeout(t)}}capturePostHogEvent({event:t,context:r}){this.reporter.instrumentPostHogAutomationEvent({distinctId:r.run_id??void 0,event:t.event,properties:oUp(t,r)})}captureSentryForFailure({event:t,context:r,error:n}){if(!(!iUp(t.event)||t.errorCode==null))return this.reporter.captureException(n,{tags:sUp(t,r),context:{automation:aUp(t,r)}})}captureAutomationEventApiEvent(t,r){this.automationEventApiClient.post(t,r)}};Dt();function IPi(e,t,r){if(t instanceof Za)return;let n=bpe(t,r?.code),i=r?.argv??process.argv,o=i.join(" "),s=r?.message??(t instanceof Error?t.message:void 0)??"",a=t??new w({message:s,code:n});pUp()?lqA(i,e,n,s,a):cqA(e,o,n,a)}function cqA(e,t,r,n){e.instrumentPostHogEvent({command:t,properties:{failed:!0,errorCode:r}}),pMe(r)&&e.captureException(n,{tags:{"error.code":r}})}function lqA(e,t,r,n,i){let o=lUp(e);t.emitAutomationTelemetryEvent({event:o,errorCode:r,attributes:{error_message:n}},{error:i})}Dt();function EWe(){return process.env.FERN_DISABLE_TELEMETRY==="true"}function vPi({cliName:e,packageVersion:t,isLocal:r}){return EWe()||r?!1:!(t==="0.0.0")&&(e==="fern"&&!0)}var CPi=class{sentry;constructor({release:t,telemetry:r}){let n="https://84f58b5e457f06999d92f11ce4b79158@o4509504076185600.ingest.us.sentry.io/4511021546602496";if(vPi(r)&&n!=null&&n.length>0){let i="production";if(i==null||i.length===0)throw new w({message:"SENTRY_ENVIRONMENT must be set when SENTRY_DSN is configured",code:w.Code.ConfigError});this.sentry=DMt({dsn:n,release:t,environment:i,defaultIntegrations:!1,integrations:[qXe(),Y0e(),X0e(),F0e(),J0e()],tracesSampleRate:0,attachStacktrace:!0,sendClientReports:!1}),RMt()}}captureException(t,r){if(this.sentry!=null)try{let n=r?.tags,i=r?.context,o=n!=null&&Object.keys(n).length>0,s=i!=null&&Object.values(i).some(a=>a!=null);return!o&&!s?this.sentry.captureException(t):bP(a=>{if(o&&a.setTags(n),i!=null)for(let[c,l]of Object.entries(i))l!=null&&a.setContext(c,l);return this.sentry?.captureException(t,void 0,a)})}catch{return}}async flush(){this.sentry!=null&&await Promise.resolve(this.sentry.flush(2e3)).catch(()=>{})}};Dt();var xPi=class{originalWrite;redirected=!1;redirect(){if(this.redirected)throw new w({message:"StdoutRedirector: already redirected \u2014 did you forget to restore()?",code:w.Code.InternalError});this.originalWrite=process.stdout.write,process.stdout.write=process.stderr.write.bind(process.stderr),this.redirected=!0}restore(){!this.redirected||this.originalWrite==null||(process.stdout.write=this.originalWrite,this.originalWrite=void 0,this.redirected=!1)}async withRedirect(t){this.redirect();try{return await t()}finally{this.restore()}}};Ode();It();dy();Dt();cn();var Anr=class{result=pf.Success;lastFailureMessage=void 0;logImmediately;logPrefix;title;subtasks=[];shouldBufferLogs;bufferedLogs=[];status="notStarted";onResult;instrumentPostHogEventImpl;captureExceptionImpl;emitAutomationTelemetryEventImpl;constructor({logImmediately:t,logPrefix:r,title:n,takeOverTerminal:i,onResult:o,shouldBufferLogs:s,instrumentPostHogEvent:a,captureException:c,emitAutomationTelemetryEvent:l}){this.logImmediately=t,this.logPrefix=r??"",this.title=n,this.takeOverTerminal=i,this.onResult=o,this.shouldBufferLogs=s,this.instrumentPostHogEventImpl=a,this.captureExceptionImpl=c,this.emitAutomationTelemetryEventImpl=l}start(){return this.status="running",this}isStarted(){return this.status!=="notStarted"}finish(){this.status!=="finished"&&(this.status="finished",this.flushLogs(),this.onResult?.(this.getResult()))}isFinished(){return this.status==="finished"}takeOverTerminal;failAndThrow(t,r,n){throw this.failWithoutThrowing(t,r,n),this.finish(),new Za(t??(r instanceof Za?r.failureMessage:this.lastFailureMessage))}failWithoutThrowing(t,r,n){this.result=pf.Failure,!(r instanceof Za)&&(t!=null&&(this.lastFailureMessage=t),XUt({message:t,error:r,logger:this.logger}),IPi(this,r,{...n,message:t}))}getLastFailureMessage(){return this.lastFailureMessage}captureException(t,r){return this.captureExceptionImpl?.(t,r)}emitAutomationTelemetryEvent(t,r){this.emitAutomationTelemetryEventImpl(t,r)}getResult(){return this.result}instrumentPostHogEvent(t){this.instrumentPostHogEventImpl(t)}logAtLevel(t,...r){this.logAtLevelWithOverrides(t,r)}logAtLevelWithOverrides(t,r,n={}){this.log({parts:r,level:t,time:new Date,...n})}log(t){this.bufferedLogs.push({...t,prefix:this.logPrefix}),this.shouldBufferLogs||this.flushLogs()}flushLogs(){this.logImmediately(this.bufferedLogs),this.bufferedLogs=[]}logger=D0(this.logAtLevel.bind(this));addInteractiveTask({name:t,subtitle:r}){let n=new PHs({name:t,subtitle:r,logImmediately:i=>this.logImmediately(i),logPrefix:`${this.logPrefix}${le.blackBright(t)} `,takeOverTerminal:this.takeOverTerminal,onResult:this.onResult,shouldBufferLogs:this.shouldBufferLogs,instrumentPostHogEvent:i=>this.instrumentPostHogEventImpl(i),captureException:this.captureExceptionImpl,emitAutomationTelemetryEvent:this.emitAutomationTelemetryEventImpl});return this.subtasks.push(n),n}async runInteractiveTask(t,r){let n=this.addInteractiveTask(t).start();try{await r(n)}catch(o){n.failWithoutThrowing(void 0,o)}finally{n.finish()}let i=n.getResult()===pf.Success;return i||(this.lastFailureMessage=n.getLastFailureMessage()??this.lastFailureMessage),i}printInteractiveTasks({spinner:t}){return this.subtasks.map(r=>r.print({spinner:t})).join(`
|
|
5541
5542
|
`)}},PHs=class extends Anr{name;subtitle;constructor({name:t,subtitle:r,...n}){super(n),this.name=t,this.subtitle=r}start(){return super.start(),this.logAtLevelWithOverrides(Vn.Info,["Started."],{omitOnTTY:!0}),this.flushLogs(),this}isStarted(){return this.status!=="notStarted"}finish(){this.status!=="finished"&&(this.result===pf.Success?this.logAtLevelWithOverrides(Vn.Info,["Finished."],{omitOnTTY:!0}):this.logAtLevelWithOverrides(Vn.Error,["Failed."],{omitOnTTY:!0}),super.finish())}setSubtitle(t){this.subtitle=t}print({spinner:t}){let r=[this.name];return this.subtitle!=null&&r.push(le.dim(this.subtitle)),r.push(...this.subtasks.map(n=>n.print({spinner:t}))),Ej({prefix:this.getIcon({spinner:t}),content:r.join(`
|
|
5542
5543
|
`)})}printInteractiveTasks({spinner:t}){return this.print({spinner:t})}getIcon({spinner:t}){let r=this.subtasks.length>0;switch(this.status){case"notStarted":return r?le.dim("\u25B8 "):le.dim("\u25E6 ");case"running":return r?le.cyan("\u25BE "):t;case"finished":switch(this.getResult()){case pf.Success:return r?le.green("\u25BE "):le.green("\u2713 ");case pf.Failure:return r?le.red("\u25BE "):le.red("x ")}}}getResult(){if(this.result===pf.Failure)return pf.Failure;for(let t of this.subtasks)if(t.getResult()===pf.Failure)return pf.Failure;return pf.Success}};Dt();var fUp=Ae(MQe(),1);cn();function dUp(e){return e.filter(t=>t.isUpgradeAvailable).length>0}function uqA(e){return(e.cliUpgradeInfo?.isUpgradeAvailable??!1)||dUp(e.generatorUpgradeInfo)}async function mUp({cliEnvironment:e,upgradeInfo:t}){if(!uqA(t)||e.packageVersion==t.cliUpgradeInfo?.latestVersion)return;let r=`${le.underline("Upgrades available")}
|
|
5543
5544
|
|
|
@@ -5546,7 +5547,7 @@ ${r}`}function zOi(e){let t=this,{emitParseErrors:r,...n}={...t.data("settings")
|
|
|
5546
5547
|
Run ${le.cyan("fern generator upgrade")} to upgrade your generators.`),i.length>2&&(r+=`
|
|
5547
5548
|
Run ${le.cyan("fern generator upgrade --list")} to see the full list of generator upgrades available.`),ult(r,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"})}async function BHs({generatorUpgradeInfo:e,header:t,limit:r,includeBoxen:n=!0}){if(!dUp(e))return;let i=t??"",o=e.filter(a=>a.isUpgradeAvailable);r!=null&&(o=o.slice(0,r+1));let s=o.sort((a,c)=>a.generatorName.localeCompare(c.generatorName)||a.currentVersion.localeCompare(c.currentVersion));for(let a of s)i+=`
|
|
5548
5549
|
${await pqA(a.generatorName)} (${a.apiName!=null?"API: "+a.apiName+", ":""}Group: ${a.generatorGroup}) `+le.dim(a.currentVersion)+le.reset(" \u2192 ")+le.green(a.latestVersion);return i+=`
|
|
5549
|
-
`,n?ult(i,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"}):i}async function pqA(e){let r=await new fUp.FernRegistryClient({environment:"https://registry.buildwithfern.com"}).generators.getGeneratorByImage({dockerImage:e});if(!r.ok||r.body==null)throw new w({message:`Generator ${e} not found`,code:w.Code.ConfigError});return r.body.displayName}Zn();Pde();Dt();var ynr=Ae(ly(),1);function SPt(e){let t;return()=>(t??=e.runTask(r=>mp(r)),t)}function SPi({generatorId:e,candidateVersion:t,currentVersion:r}){if(!hUp(t)||!hUp(r))throw new w({message:`Cannot compare versions for generator "${e}": configured version "${r}", candidate version "${t}". Use valid semantic versions such as 1.2.3.`,code:w.Code.VersionError});try{return t===r?0:cw(t,r)?1:cw(r,t)?-1:0}catch{let n=ynr.default.valid(t),i=ynr.default.valid(r);if(n!=null&&i!=null)return Math.sign(ynr.default.compare(n,i));throw new w({message:`Cannot compare versions for generator "${e}": configured version "${r}", candidate version "${t}". Use valid semantic versions such as 1.2.3.`,code:w.Code.VersionError})}}function hUp(e){if(e==="latest"||ynr.default.valid(e)!=null)return!0;try{return eK(e),!0}catch{return!1}}async function wPi({generatorId:e,currentVersion:t,includeMajor:r,channel:n,organization:i,getToken:o,context:s}){if(n!=null)throw new Error(`SDK Gen API generator version discovery does not support the requested upgrade channel "${n}". Remove --channel to use executable index versions; FDR channel metadata is used only when the ${QXt} feature flag is off for this organization.`);let a=gFe();if(a==null)throw new Error("FERN_SDK_GEN_API_ORIGIN is required when sdk-gen-api generation is enabled");let c=fv(e);if(c==null)return s.logger.error(`SDK Gen API cannot discover versions for unsupported generator ${e}. Use a canonical first-party SDK generator name.`),{};let l=await o(),u=await Ugs({origin:a,organization:i,token:l,generatorId:e,language:c,currentVersion:t,includeMajor:r});return u.state==="UNAVAILABLE"?(s.logger.error(`SDK Gen API cannot resolve an executable version for ${e}@${t} (${u.reason}). Publish the coordinate to this environment or choose a supported generator version.`),{}):{compatibleVersion:u.compatibleVersion,withheldMajorVersion:u.withheldMajorVersion}}async function fqA({cliContext:e,project:t,generatorFilter:r,groupFilter:n,channel:i,includeMajor:o,skipFeatureFlagRequest:s}){let{apiWorkspaces:a}=t,l=s!==!0||await my().catch(()=>{})!=null?SPt(e):void 0;if(a.length===1){let p={type:"singleApi",versions:{}};return await gUp({cliContext:e,apiWorkspaces:a,perGeneratorAction:async(d,f,m,g)=>{p.versions[f]==null&&(p.versions[f]={});let A=o4e(m.name);if(A==null){g.logger.debug(`Skipping unknown generator: ${m.name}`);return}let y=await yUp({generatorName:m.name,normalizedGeneratorName:A,cliVersion:e.environment.packageVersion,currentGeneratorVersion:m.version,channel:i,includeMajor:o,organization:t.config.organization,skipFeatureFlagRequest:s,getSdkGenApiToken:l,context:g});y!=null&&(p.versions[f][m.name]={previousVersion:m.version,latestVersion:y})},generatorFilter:r,groupFilter:n}),p}let u={type:"multiApi",versions:{}};return await gUp({cliContext:e,apiWorkspaces:a,perGeneratorAction:async(p,d,f,m)=>{if(p==null)return;u.versions[p]==null&&(u.versions[p]={}),u.versions[p][d]==null&&(u.versions[p][d]={});let g=o4e(f.name);if(g==null){m.logger.debug(`Skipping unknown generator: ${f.name}`);return}let A=await yUp({generatorName:f.name,normalizedGeneratorName:g,cliVersion:e.environment.packageVersion,currentGeneratorVersion:f.version,channel:i,includeMajor:o,organization:t.config.organization,skipFeatureFlagRequest:s,getSdkGenApiToken:l,context:m});A!=null&&(u.versions[p][d][f.name]={previousVersion:f.version,latestVersion:A})},generatorFilter:r,groupFilter:n}),u}async function gUp({cliContext:e,apiWorkspaces:t,perGeneratorAction:r,generatorFilter:n,groupFilter:i}){await Promise.all(t.map(async o=>{await e.runTaskForWorkspace(o,async s=>{let a=await u3({absolutePathToWorkspace:o.absoluteFilePath,context:s});if(a==null||a.groups==null)return;let c=n!=null?Ym(n):void 0;for(let l of a.groups)if(!(i!=null&&l.groupName!==i))for(let u of l.generators)c!=null&&u.name!==c||await r(o.workspaceName,l.groupName,u,s)})}))}function AUp(e,t,r){let n=[];for(let[i,o]of Object.entries(e))for(let[s,a]of Object.entries(o)){r.debug(`Checking if ${s} in group ${i} has an upgrade available...`);let c=SPi({generatorId:s,candidateVersion:a.latestVersion,currentVersion:a.previousVersion})===1;r.debug(`Latest version: ${a.latestVersion}. `+(c?"Upgrade available.":"No upgrade available.")),n.push({generatorName:s,generatorGroup:i,apiName:t,isUpgradeAvailable:c,currentVersion:a.previousVersion,latestVersion:a.latestVersion})}return n}async function yUp({generatorName:e,normalizedGeneratorName:t,cliVersion:r,currentGeneratorVersion:n,channel:i,includeMajor:o,organization:s,skipFeatureFlagRequest:a,getSdkGenApiToken:c,context:l}){return n==="latest"?"latest":await dqA({organization:s,generatorName:Ym(e),skipFeatureFlagRequest:a})?c==null?void 0:(await wPi({generatorId:Ym(e),currentVersion:n,includeMajor:o??!1,channel:i,organization:s,getToken:c,context:l})).compatibleVersion:KP({generatorName:t,cliVersion:r,currentGeneratorVersion:n,channel:i,includeMajor:o,context:l})}async function TPi({project:e,cliContext:t,generatorFilter:r,groupFilter:n,channel:i,includeMajor:o,skipFeatureFlagRequest:s}){let a=[];if(e!=null){let c=await fqA({cliContext:t,project:e,generatorFilter:r,groupFilter:n,channel:i,includeMajor:o,skipFeatureFlagRequest:s});if(c.type==="multiApi")for(let[l,u]of Object.entries(c.versions))a.push(...AUp(u,l,t.logger));else a.push(...AUp(c.versions,void 0,t.logger))}return a}async function dqA({organization:e,generatorName:t,skipFeatureFlagRequest:r}){return r===!0?ECs({organization:e,generatorName:t})??!1:uSt({organization:e,generatorName:t})}It();Dt();wMr();async function nye({cliEnvironment:e,includePreReleases:t=!1}){if(e.packageName!=="fern-api"||e.packageVersion==="0.0.0")return e.packageVersion;try{return await i3e(e.packageName,{version:t?"prerelease":"latest"})}catch(r){throw new w({message:`Failed to resolve latest CLI version: ${oi(r)}`,code:w.Code.NetworkError})}}var bUp=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],OPi=class e{environment;sentryClient;posthogManager;automationTelemetryManager;didSucceed=!0;numTasks=0;ttyAwareLogger;logLevel=Vn.Info;isLocal;stdoutRedirector=new xPi;jsonMode=!1;linesAfterTasks=[];static async create(t,r,{isLocal:n}){let i=await v9t();return new e(t,r,{isLocal:n,posthogManager:i})}constructor(t,r,{isLocal:n,posthogManager:i}){this.ttyAwareLogger=new dVt(t,r),this.isLocal=n??!1,this.posthogManager=i;let o=this.getPackageName(),s=this.getPackageVersion(),a=this.getCliName();(o==null||s==null||a==null)&&this.exitProgram(),this.environment={packageName:o,packageVersion:s,cliName:a},this.sentryClient=new CPi({release:`cli@${this.environment.packageVersion}`,telemetry:{cliName:this.environment.cliName,packageVersion:this.environment.packageVersion,isLocal:this.isLocal}}),this.automationTelemetryManager=new EPi(this)}getPackageName(){return"fern-api"}getPackageVersion(){return"5.
|
|
5550
|
+
`,n?ult(i,{padding:1,float:"center",textAlignment:"center",borderColor:"yellow",borderStyle:"round"}):i}async function pqA(e){let r=await new fUp.FernRegistryClient({environment:"https://registry.buildwithfern.com"}).generators.getGeneratorByImage({dockerImage:e});if(!r.ok||r.body==null)throw new w({message:`Generator ${e} not found`,code:w.Code.ConfigError});return r.body.displayName}Zn();Pde();Dt();var ynr=Ae(ly(),1);function SPt(e){let t;return()=>(t??=e.runTask(r=>mp(r)),t)}function SPi({generatorId:e,candidateVersion:t,currentVersion:r}){if(!hUp(t)||!hUp(r))throw new w({message:`Cannot compare versions for generator "${e}": configured version "${r}", candidate version "${t}". Use valid semantic versions such as 1.2.3.`,code:w.Code.VersionError});try{return t===r?0:cw(t,r)?1:cw(r,t)?-1:0}catch{let n=ynr.default.valid(t),i=ynr.default.valid(r);if(n!=null&&i!=null)return Math.sign(ynr.default.compare(n,i));throw new w({message:`Cannot compare versions for generator "${e}": configured version "${r}", candidate version "${t}". Use valid semantic versions such as 1.2.3.`,code:w.Code.VersionError})}}function hUp(e){if(e==="latest"||ynr.default.valid(e)!=null)return!0;try{return eK(e),!0}catch{return!1}}async function wPi({generatorId:e,currentVersion:t,includeMajor:r,channel:n,organization:i,getToken:o,context:s}){if(n!=null)throw new Error(`SDK Gen API generator version discovery does not support the requested upgrade channel "${n}". Remove --channel to use executable index versions; FDR channel metadata is used only when the ${QXt} feature flag is off for this organization.`);let a=gFe();if(a==null)throw new Error("FERN_SDK_GEN_API_ORIGIN is required when sdk-gen-api generation is enabled");let c=fv(e);if(c==null)return s.logger.error(`SDK Gen API cannot discover versions for unsupported generator ${e}. Use a canonical first-party SDK generator name.`),{};let l=await o(),u=await Ugs({origin:a,organization:i,token:l,generatorId:e,language:c,currentVersion:t,includeMajor:r});return u.state==="UNAVAILABLE"?(s.logger.error(`SDK Gen API cannot resolve an executable version for ${e}@${t} (${u.reason}). Publish the coordinate to this environment or choose a supported generator version.`),{}):{compatibleVersion:u.compatibleVersion,withheldMajorVersion:u.withheldMajorVersion}}async function fqA({cliContext:e,project:t,generatorFilter:r,groupFilter:n,channel:i,includeMajor:o,skipFeatureFlagRequest:s}){let{apiWorkspaces:a}=t,l=s!==!0||await my().catch(()=>{})!=null?SPt(e):void 0;if(a.length===1){let p={type:"singleApi",versions:{}};return await gUp({cliContext:e,apiWorkspaces:a,perGeneratorAction:async(d,f,m,g)=>{p.versions[f]==null&&(p.versions[f]={});let A=o4e(m.name);if(A==null){g.logger.debug(`Skipping unknown generator: ${m.name}`);return}let y=await yUp({generatorName:m.name,normalizedGeneratorName:A,cliVersion:e.environment.packageVersion,currentGeneratorVersion:m.version,channel:i,includeMajor:o,organization:t.config.organization,skipFeatureFlagRequest:s,getSdkGenApiToken:l,context:g});y!=null&&(p.versions[f][m.name]={previousVersion:m.version,latestVersion:y})},generatorFilter:r,groupFilter:n}),p}let u={type:"multiApi",versions:{}};return await gUp({cliContext:e,apiWorkspaces:a,perGeneratorAction:async(p,d,f,m)=>{if(p==null)return;u.versions[p]==null&&(u.versions[p]={}),u.versions[p][d]==null&&(u.versions[p][d]={});let g=o4e(f.name);if(g==null){m.logger.debug(`Skipping unknown generator: ${f.name}`);return}let A=await yUp({generatorName:f.name,normalizedGeneratorName:g,cliVersion:e.environment.packageVersion,currentGeneratorVersion:f.version,channel:i,includeMajor:o,organization:t.config.organization,skipFeatureFlagRequest:s,getSdkGenApiToken:l,context:m});A!=null&&(u.versions[p][d][f.name]={previousVersion:f.version,latestVersion:A})},generatorFilter:r,groupFilter:n}),u}async function gUp({cliContext:e,apiWorkspaces:t,perGeneratorAction:r,generatorFilter:n,groupFilter:i}){await Promise.all(t.map(async o=>{await e.runTaskForWorkspace(o,async s=>{let a=await u3({absolutePathToWorkspace:o.absoluteFilePath,context:s});if(a==null||a.groups==null)return;let c=n!=null?Ym(n):void 0;for(let l of a.groups)if(!(i!=null&&l.groupName!==i))for(let u of l.generators)c!=null&&u.name!==c||await r(o.workspaceName,l.groupName,u,s)})}))}function AUp(e,t,r){let n=[];for(let[i,o]of Object.entries(e))for(let[s,a]of Object.entries(o)){r.debug(`Checking if ${s} in group ${i} has an upgrade available...`);let c=SPi({generatorId:s,candidateVersion:a.latestVersion,currentVersion:a.previousVersion})===1;r.debug(`Latest version: ${a.latestVersion}. `+(c?"Upgrade available.":"No upgrade available.")),n.push({generatorName:s,generatorGroup:i,apiName:t,isUpgradeAvailable:c,currentVersion:a.previousVersion,latestVersion:a.latestVersion})}return n}async function yUp({generatorName:e,normalizedGeneratorName:t,cliVersion:r,currentGeneratorVersion:n,channel:i,includeMajor:o,organization:s,skipFeatureFlagRequest:a,getSdkGenApiToken:c,context:l}){return n==="latest"?"latest":await dqA({organization:s,generatorName:Ym(e),skipFeatureFlagRequest:a})?c==null?void 0:(await wPi({generatorId:Ym(e),currentVersion:n,includeMajor:o??!1,channel:i,organization:s,getToken:c,context:l})).compatibleVersion:KP({generatorName:t,cliVersion:r,currentGeneratorVersion:n,channel:i,includeMajor:o,context:l})}async function TPi({project:e,cliContext:t,generatorFilter:r,groupFilter:n,channel:i,includeMajor:o,skipFeatureFlagRequest:s}){let a=[];if(e!=null){let c=await fqA({cliContext:t,project:e,generatorFilter:r,groupFilter:n,channel:i,includeMajor:o,skipFeatureFlagRequest:s});if(c.type==="multiApi")for(let[l,u]of Object.entries(c.versions))a.push(...AUp(u,l,t.logger));else a.push(...AUp(c.versions,void 0,t.logger))}return a}async function dqA({organization:e,generatorName:t,skipFeatureFlagRequest:r}){return r===!0?ECs({organization:e,generatorName:t})??!1:uSt({organization:e,generatorName:t})}It();Dt();wMr();async function nye({cliEnvironment:e,includePreReleases:t=!1}){if(e.packageName!=="fern-api"||e.packageVersion==="0.0.0")return e.packageVersion;try{return await i3e(e.packageName,{version:t?"prerelease":"latest"})}catch(r){throw new w({message:`Failed to resolve latest CLI version: ${oi(r)}`,code:w.Code.NetworkError})}}var bUp=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],OPi=class e{environment;sentryClient;posthogManager;automationTelemetryManager;didSucceed=!0;numTasks=0;ttyAwareLogger;logLevel=Vn.Info;isLocal;stdoutRedirector=new xPi;jsonMode=!1;linesAfterTasks=[];static async create(t,r,{isLocal:n}){let i=await v9t();return new e(t,r,{isLocal:n,posthogManager:i})}constructor(t,r,{isLocal:n,posthogManager:i}){this.ttyAwareLogger=new dVt(t,r),this.isLocal=n??!1,this.posthogManager=i;let o=this.getPackageName(),s=this.getPackageVersion(),a=this.getCliName();(o==null||s==null||a==null)&&this.exitProgram(),this.environment={packageName:o,packageVersion:s,cliName:a},this.sentryClient=new CPi({release:`cli@${this.environment.packageVersion}`,telemetry:{cliName:this.environment.cliName,packageVersion:this.environment.packageVersion,isLocal:this.isLocal}}),this.automationTelemetryManager=new EPi(this)}getPackageName(){return"fern-api"}getPackageVersion(){return"5.198.0"}getCliName(){return"fern"}setLogLevel(t){this.logLevel=t}logFernVersionDebug(){this.logger.debug(`Running ${le.bold(`${this.environment.cliName}`)} (${this.environment.packageName}@${this.environment.packageVersion})`)}failAndThrow(t,r,n){throw this.failWithoutThrowing(t,r,n),new Za(t??(r instanceof Za?r.failureMessage:r!=null?tn(r):void 0))}failWithoutThrowing(t,r,n){this.didSucceed=!1,!(r instanceof Za)&&(XUt({message:t,error:r,logger:this.logger}),IPi(this,r,{...n,message:t}))}enableJsonMode(){this.jsonMode||(this.jsonMode=!0,this.stdoutRedirector.redirect())}get isJsonMode(){return this.jsonMode}get isTTY(){return this.ttyAwareLogger.isTTY}writeJsonToStdout(t){this.writeTextToStdout(JSON.stringify(t,null,2)+`
|
|
5550
5551
|
`)}writeTextToStdout(t){this.stdoutRedirector.restore(),process.stdout.write(t),this.jsonMode&&this.stdoutRedirector.redirect()}logAfterTasks(t){this.isTTY?this.linesAfterTasks.push(t):this.logger.info(t)}async exit({code:t}={}){!this._suppressUpgradeMessage&&!this.isLocal&&await this.nudgeUpgradeIfAvailable(),this.ttyAwareLogger.finish();for(let r of this.linesAfterTasks)process.stdout.write(`${r}
|
|
5551
5552
|
`);try{await Promise.all([this.posthogManager.flush(),rWo()])}catch{}await this.sentryClient.flush(),await this.automationTelemetryManager.flush(),this.exitProgram({code:t})}async nudgeUpgradeIfAvailable(){try{let t=await Promise.race([this.isUpgradeAvailable({skipFeatureFlagRequest:!0}),new Promise((n,i)=>setTimeout(()=>i("Request timed out"),300))]),r=await mUp({cliEnvironment:this.environment,upgradeInfo:t});r!=null&&(r.endsWith(`
|
|
5552
5553
|
`)||(r+=`
|