@anthropic-ai/claude-agent-sdk
Version:
SDK for building AI agents with Claude Code's capabilities. Programmatically interact with Claude to build autonomous agents that can understand codebases, edit files, and execute workflows.
158 lines • 1.39 MB
JavaScript
#!/usr/bin/env node
// (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance.
// Version: 0.3.239
// Want to see the unminified source? We're hiring!
// https://job-boards.greenhouse.io/anthropic/jobs/4816199008
import{createRequire as k8}from"node:module";var y8=Object.create;var{getPrototypeOf:b8,defineProperty:Nb,getOwnPropertyNames:S8}=Object;var E8=Object.prototype.hasOwnProperty;function x8(e){return this[e]}var v8,w8,$a=(e,t,n)=>{var r=e!=null&&typeof e==="object";if(r){var o=t?v8??=new WeakMap:w8??=new WeakMap,s=o.get(e);if(s)return s}n=e!=null?y8(b8(e)):{};let i=t||!e||!e.__esModule?Nb(n,"default",{value:e,enumerable:!0}):n;if(e&&typeof e==="object"||typeof e==="function"){for(let a of S8(e))if(!E8.call(i,a))Nb(i,a,{get:x8.bind(e,a),enumerable:!0})}if(r)o.set(e,i);return i};var k=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var A8=(e)=>e;function T8(e,t){this[e]=A8.bind(null,t)}var Xt=(e,t)=>{for(var n in t)Nb(e,n,{get:t[n],enumerable:!0,configurable:!0,set:T8.bind(t,n)})};var O=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ne=k8(import.meta.url),C8=Symbol.dispose||Symbol.for("Symbol.dispose"),R8=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),Dt=(e,t,n)=>{if(t!=null){if(typeof t!=="object"&&typeof t!=="function")throw TypeError('Object expected to be assigned to "using" declaration');var r;if(n)r=t[R8];if(r===void 0)r=t[C8];if(typeof r!=="function")throw TypeError("Object not disposable");e.push([n,r,t])}else if(n)e.push([n]);return t},Lt=(e,t,n)=>{var r=typeof SuppressedError==="function"?SuppressedError:function(i,a,c,l){return l=Error(c),l.name="SuppressedError",l.error=i,l.suppressed=a,l},o=(i)=>t=n?new r(i,t,"An error was suppressed during disposal"):(n=!0,i),s=(i)=>{while(i=e.pop())try{var a=i[1]&&i[1].call(i[2]);if(i[0])return Promise.resolve(a).then(s,(c)=>(o(c),s()))}catch(c){o(c)}if(n)throw t};return s()};var OI,cS;var lS=O(()=>{OI=globalThis.process?.getBuiltinModule?.("async_hooks"),cS=OI?(e)=>OI.AsyncResource.bind(e):(e)=>e});function Re(e){if(!e)return!1;if(typeof e==="boolean")return e;let t=String(e).toLowerCase().trim();return["1","true","yes","on"].includes(t)}function Tm(e){if(e===void 0)return!1;if(typeof e==="boolean")return!e;let t=String(e).toLowerCase().trim();return["0","false","no","off"].includes(t)}function zt(){let e=new Set;return{subscribe(t){let n=cS(t);return e.add(n),()=>{e.delete(n)}},emit(...t){let n;for(let r of e)try{r(...t)}catch(o){(n??=[]).push(o)}if(n)throw n.length===1?n[0]:AggregateError(n,"Signal listener(s) threw")},clear(){e.clear()}}}var PI=O(()=>{lS()});var II=()=>{};var Iu=O(()=>{lS();PI();II()});function L(e,t,n,r,o){if(r==="m")throw TypeError("Private method is not writable");if(r==="a"&&!o)throw TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?o.call(e,n):o?o.value=n:t.set(e,n),n}function E(e,t,n,r){if(n==="a"&&!r)throw TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!r:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}var Nn=()=>{};var rc=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return rc=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(r)=>(+r^n()&15>>+r/4).toString(16))};function wr(e){return typeof e==="object"&&e!==null&&(("name"in e)&&e.name==="AbortError"||("message"in e)&&String(e.message).includes("FetchRequestCanceledException"))}var Oi=(e)=>{if(e instanceof Error)return e;if(typeof e==="object"&&e!==null){try{if(Object.prototype.toString.call(e)==="[object Error]"){let t=Error(e.message,e.cause?{cause:e.cause}:{});if(e.stack)t.stack=e.stack;if(e.cause&&!t.cause)t.cause=e.cause;if(e.name)t.name=e.name;return t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)};var j,kt,on,Zo,Zu,Jm,Yu,Ju,Xu,Qu,ed,td,nd,rd;var dt=O(()=>{j=class j extends Error{};kt=class kt extends j{constructor(e,t,n,r,o){super(`${kt.makeMessage(e,t,n)}`);this.status=e,this.headers=r,this.requestID=r?.get("request-id"),this.error=t,this.type=o??null}static makeMessage(e,t,n){let r=t?.message?typeof t.message==="string"?t.message:JSON.stringify(t.message):t?JSON.stringify(t):n;if(e&&r)return`${e} ${r}`;if(e)return`${e} status code (no body)`;if(r)return r;return"(no status code or body)"}static generate(e,t,n,r){if(!e||!r)return new Zo({message:n,cause:Oi(t)});let o=t,s=o?.error?.type;if(e===400)return new Yu(e,o,n,r,s);if(e===401)return new Ju(e,o,n,r,s);if(e===403)return new Xu(e,o,n,r,s);if(e===404)return new Qu(e,o,n,r,s);if(e===409)return new ed(e,o,n,r,s);if(e===422)return new td(e,o,n,r,s);if(e===429)return new nd(e,o,n,r,s);if(e>=500)return new rd(e,o,n,r,s);return new kt(e,o,n,r,s)}};on=class on extends kt{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}};Zo=class Zo extends kt{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0);if(t)this.cause=t}};Zu=class Zu extends Zo{constructor({message:e}={}){super({message:e??"Request timed out."})}};Jm=class Jm extends j{constructor(e,{cause:t}={}){super(e??"Retryable error.");if(t!==void 0)this.cause=t}};Yu=class Yu extends kt{};Ju=class Ju extends kt{};Xu=class Xu extends kt{};Qu=class Qu extends kt{};ed=class ed extends kt{};td=class td extends kt{};nd=class nd extends kt{};rd=class rd extends kt{}});function od(e){if(typeof e!=="object")return{};return e??{}}function Ox(e){if(!e)return!0;for(let t in e)return!1;return!0}function hL(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var wte,mL=(e)=>wte.test(e),hn=(e)=>(hn=Array.isArray,hn(e)),Rx,gL=(e,t)=>{if(typeof t!=="number"||!Number.isInteger(t))throw new j(`${e} must be an integer`);if(t<0)throw new j(`${e} must be a positive integer`);return t},sd=(e)=>{try{return JSON.parse(e)}catch(t){return}};var Wr=O(()=>{dt();wte=/^[a-z][a-z0-9+.-]*:/i,Rx=hn});var qr=(e,t)=>new Promise((n)=>{if(t?.aborted)return n();let r=()=>{clearTimeout(o),n()},o=setTimeout(()=>{t?.removeEventListener("abort",r),n()},e);t?.addEventListener("abort",r,{once:!0})});var Ar="0.112.1";function Ate(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}function kte(){if(typeof navigator>"u"||!navigator)return null;let e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:t,pattern:n}of e){let r=n.exec(navigator.userAgent);if(r){let o=r[1]||0,s=r[2]||0,i=r[3]||0;return{browser:t,version:`${o}.${s}.${i}`}}}return null}var SL=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u",Tte=()=>{let e=Ate();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ar,"X-Stainless-OS":yL(Deno.build.os),"X-Stainless-Arch":_L(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ar,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(e==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ar,"X-Stainless-OS":yL(globalThis.process.platform??"unknown"),"X-Stainless-Arch":_L(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=kte();if(t)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ar,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ar,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},_L=(e)=>{if(e==="x32")return"x32";if(e==="x86_64"||e==="x64")return"x64";if(e==="arm")return"arm";if(e==="aarch64"||e==="arm64")return"arm64";if(e)return`other:${e}`;return"unknown"},yL=(e)=>{if(e=e.toLowerCase(),e.includes("ios"))return"iOS";if(e==="android")return"Android";if(e==="darwin")return"MacOS";if(e==="win32")return"Windows";if(e==="freebsd")return"FreeBSD";if(e==="openbsd")return"OpenBSD";if(e==="linux")return"Linux";if(e)return`Other:${e}`;return"Unknown"},bL,id=()=>bL??(bL=Tte());var Xm=()=>{};function EL(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function Px(...e){let t=globalThis.ReadableStream;if(typeof t>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function Qm(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return Px({start(){},async pull(n){let{done:r,value:o}=await t.next();if(r)n.close();else n.enqueue(o)},async cancel(){await t.return?.()}})}function ad(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let n=await t.read();if(n?.done)t.releaseLock();return n}catch(n){throw t.releaseLock(),n}},async return(){let n=t.cancel();return t.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function xL(e){if(e===null||typeof e!=="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}var vL=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)});var Ix="RFC3986",Dx=(e)=>String(e),Lx,wL="RFC1738";var Mx=O(()=>{Lx={RFC1738:(e)=>String(e).replace(/%20/g,"+"),RFC3986:Dx}});function TL(e){if(!e||typeof e!=="object")return!1;return!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}function Ux(e,t){if(hn(e)){let n=[];for(let r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)}var eh=(e,t)=>(eh=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),eh(e,t)),wo,Nx=1024,AL=(e,t,n,r,o)=>{if(e.length===0)return e;let s=e;if(typeof e==="symbol")s=Symbol.prototype.toString.call(e);else if(typeof e!=="string")s=String(e);if(n==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(a){return"%26%23"+parseInt(a.slice(2),16)+"%3B"});let i="";for(let a=0;a<s.length;a+=Nx){let c=s.length>=Nx?s.slice(a,a+Nx):s,l=[];for(let u=0;u<c.length;++u){let p=c.charCodeAt(u);if(p===45||p===46||p===95||p===126||p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||o===wL&&(p===40||p===41)){l[l.length]=c.charAt(u);continue}if(p<128){l[l.length]=wo[p];continue}if(p<2048){l[l.length]=wo[192|p>>6]+wo[128|p&63];continue}if(p<55296||p>=57344){l[l.length]=wo[224|p>>12]+wo[128|p>>6&63]+wo[128|p&63];continue}u+=1,p=65536+((p&1023)<<10|c.charCodeAt(u)&1023),l[l.length]=wo[240|p>>18]+wo[128|p>>12&63]+wo[128|p>>6&63]+wo[128|p&63]}i+=l.join("")}return i};var kL=O(()=>{Mx();Wr();wo=(()=>{let e=[];for(let t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e})()});function Ote(e){return typeof e==="string"||typeof e==="number"||typeof e==="boolean"||typeof e==="symbol"||typeof e==="bigint"}function PL(e,t,n,r,o,s,i,a,c,l,u,p,f,m,h,_,y,S){let b=e,x=S,v=0,T=!1;while((x=x.get(Fx))!==void 0&&!T){let ce=x.get(e);if(v+=1,typeof ce<"u")if(ce===v)throw RangeError("Cyclic object value");else T=!0;if(typeof x.get(Fx)>"u")v=0}if(typeof l==="function")b=l(t,b);else if(b instanceof Date)b=f?.(b);else if(n==="comma"&&hn(b))b=Ux(b,function(ce){if(ce instanceof Date)return f?.(ce);return ce});if(b===null){if(s)return c&&!_?c(t,Wt.encoder,y,"key",m):t;b=""}if(Ote(b)||TL(b)){if(c){let ce=_?t:c(t,Wt.encoder,y,"key",m);return[h?.(ce)+"="+h?.(c(b,Wt.encoder,y,"value",m))]}return[h?.(t)+"="+h?.(String(b))]}let U=[];if(typeof b>"u")return U;let M;if(n==="comma"&&hn(b)){if(_&&c)b=Ux(b,c);M=[{value:b.length>0?b.join(",")||null:void 0}]}else if(hn(l))M=l;else{let ce=Object.keys(b);M=u?ce.sort(u):ce}let F=a?String(t).replace(/\./g,"%2E"):String(t),W=r&&hn(b)&&b.length===1?F+"[]":F;if(o&&hn(b)&&b.length===0)return W+"[]";for(let ce=0;ce<M.length;++ce){let ne=M[ce],se=typeof ne==="object"&&typeof ne.value<"u"?ne.value:b[ne];if(i&&se===null)continue;let Se=p&&a?ne.replace(/\./g,"%2E"):ne,Te=hn(b)?typeof n==="function"?n(W,Se):W:W+(p?"."+Se:"["+Se+"]");S.set(e,v);let St=new WeakMap;St.set(Fx,S),OL(U,PL(se,Te,n,r,o,s,i,a,n==="comma"&&_&&hn(b)?null:c,l,u,p,f,m,h,_,y,St))}return U}function Pte(e=Wt){if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!=="boolean")throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!=="boolean")throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!=="function")throw TypeError("Encoder has to be a function.");let t=e.charset||Wt.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let n=Ix;if(typeof e.format<"u"){if(!eh(Lx,e.format))throw TypeError("Unknown format option provided.");n=e.format}let r=Lx[n],o=Wt.filter;if(typeof e.filter==="function"||hn(e.filter))o=e.filter;let s;if(e.arrayFormat&&e.arrayFormat in RL)s=e.arrayFormat;else if("indices"in e)s=e.indices?"indices":"repeat";else s=Wt.arrayFormat;if("commaRoundTrip"in e&&typeof e.commaRoundTrip!=="boolean")throw TypeError("`commaRoundTrip` must be a boolean, or absent");let i=typeof e.allowDots>"u"?!!e.encodeDotInKeys===!0?!0:Wt.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix==="boolean"?e.addQueryPrefix:Wt.addQueryPrefix,allowDots:i,allowEmptyArrays:typeof e.allowEmptyArrays==="boolean"?!!e.allowEmptyArrays:Wt.allowEmptyArrays,arrayFormat:s,charset:t,charsetSentinel:typeof e.charsetSentinel==="boolean"?e.charsetSentinel:Wt.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?Wt.delimiter:e.delimiter,encode:typeof e.encode==="boolean"?e.encode:Wt.encode,encodeDotInKeys:typeof e.encodeDotInKeys==="boolean"?e.encodeDotInKeys:Wt.encodeDotInKeys,encoder:typeof e.encoder==="function"?e.encoder:Wt.encoder,encodeValuesOnly:typeof e.encodeValuesOnly==="boolean"?e.encodeValuesOnly:Wt.encodeValuesOnly,filter:o,format:n,formatter:r,serializeDate:typeof e.serializeDate==="function"?e.serializeDate:Wt.serializeDate,skipNulls:typeof e.skipNulls==="boolean"?e.skipNulls:Wt.skipNulls,sort:typeof e.sort==="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling==="boolean"?e.strictNullHandling:Wt.strictNullHandling}}function IL(e,t={}){let n=e,r=Pte(t),o,s;if(typeof r.filter==="function")s=r.filter,n=s("",n);else if(hn(r.filter))s=r.filter,o=s;let i=[];if(typeof n!=="object"||n===null)return"";let a=RL[r.arrayFormat],c=a==="comma"&&r.commaRoundTrip;if(!o)o=Object.keys(n);if(r.sort)o.sort(r.sort);let l=new WeakMap;for(let f=0;f<o.length;++f){let m=o[f];if(r.skipNulls&&n[m]===null)continue;OL(i,PL(n[m],m,a,c,r.allowEmptyArrays,r.strictNullHandling,r.skipNulls,r.encodeDotInKeys,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,l))}let u=i.join(r.delimiter),p=r.addQueryPrefix===!0?"?":"";if(r.charsetSentinel)if(r.charset==="iso-8859-1")p+="utf8=%26%2310003%3B&";else p+="utf8=%E2%9C%93&";return u.length>0?p+u:""}var RL,OL=function(e,t){Array.prototype.push.apply(e,hn(t)?t:[t])},CL,Wt,Fx;var DL=O(()=>{kL();Mx();Wr();RL={brackets(e){return String(e)+"[]"},comma:"comma",indices(e,t){return String(e)+"["+t+"]"},repeat(e){return String(e)}},Wt={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:AL,encodeValuesOnly:!1,format:Ix,formatter:Dx,indices:!1,serializeDate(e){return(CL??(CL=Function.prototype.call.bind(Date.prototype.toISOString)))(e)},skipNulls:!1,strictNullHandling:!1};Fx={}});function LL(e){return IL(e,{arrayFormat:"brackets"})}var zx=O(()=>{DL()});function nh(e){if(!e)return;let t;try{t=new URL(e)}catch(r){throw new et(`Invalid token endpoint base URL "${e}": ${r}`)}if(t.protocol==="https:")return;let n=t.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(t.protocol==="http:"&&(n==="localhost"||n==="127.0.0.1"||n==="::1"))return;throw new et(`Refusing to send credential over non-https token endpoint "${e}"`)}async function rh(e,t){let n=await Lte(e),r;try{r=JSON.parse(n)}catch{throw new et(`Token endpoint returned non-JSON response (status ${e.status})`,e.status,Un(n),t)}if(!r.access_token)throw new et(`Token endpoint response missing access_token: ${JSON.stringify(Un(r))}`,e.status,Un(r),t);if(r.token_type&&r.token_type.toLowerCase()!=="bearer")throw new et(`Token endpoint response: unsupported token_type "${r.token_type}" (want Bearer)`,e.status,Un(r),t);return r}function Un(e){if(e==null)return e;if(typeof e==="string"){let t;try{t=JSON.parse(e)}catch{if(e.length<=$x)return e;return e.slice(0,$x)+`... <${e.length-$x} more chars>`}return JSON.stringify(Un(t))}if(typeof e==="object"&&!Array.isArray(e)){let t={};for(let[n,r]of Object.entries(e))if(Dte.has(n))t[n]=r;return t}return null}async function oh(e,t=(n)=>console.warn(`anthropic-sdk: ${n}`)){if(typeof process>"u"||process.platform==="win32")return;let n=await import("node:fs"),r=e,o;try{r=await n.promises.realpath(e),o=await n.promises.stat(r)}catch{return}let s=o.mode&511;if(s&18)throw new et(`Credentials file at ${r} is group/world-writable (mode 0o${s.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${r}\`.`);if(s&36)throw new et(`Credentials file at ${r} is group/world-readable (mode 0o${s.toString(8)}); run \`chmod 600 ${r}\` before retrying.`);if(typeof process.getuid==="function"&&o.uid!==process.getuid())t(`credentials file at ${r} is owned by uid ${o.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function sh(e,t){let n=await import("node:fs"),o=(await import("node:path")).dirname(e);await n.promises.mkdir(o,{recursive:!0,mode:448});let s=`${e}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let i=await n.promises.open(s,"w",384);try{await i.writeFile(JSON.stringify(t,null,2)),await i.sync()}finally{await i.close()}await n.promises.rename(s,e)}catch(i){throw await n.promises.unlink(s).catch(()=>{}),i}try{let i=await n.promises.open(o,"r");try{await i.sync()}finally{await i.close()}}catch{}}async function Lte(e){if(!e.body)return"";let t=e.body.getReader(),n=[],r=0;for(;;){let{done:s,value:i}=await t.read();if(s)break;if(r+i.length>ML){let a=ML-r;if(a>0)n.push(i.subarray(0,a));await t.cancel();break}n.push(i),r+=i.length}let o;if(n.length===1)o=n[0];else{o=new Uint8Array(n.reduce((i,a)=>i+a.length,0));let s=0;for(let i of n)o.set(i,s),s+=i.length}return new TextDecoder("utf-8").decode(o)}var NL="urn:ietf:params:oauth:grant-type:jwt-bearer",UL="refresh_token",th="/v1/oauth/token",Pi="oauth-2025-04-20",FL="oidc-federation-2026-04-01",zL=120,oc=30,$L=5,ML=1048576,$x=2000,Dte,et;var sc=O(()=>{dt();Dte=new Set(["error","error_description","error_uri"]);et=class et extends j{constructor(e,t=null,n=null,r=null){super(e);this.statusCode=t,this.body=n,this.requestId=r}}});function Vr(){return Math.floor(Date.now()/1000)}class jx{constructor(e,t){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=t}async getToken(){let e=this.nextForce;this.nextForce=!1;let t=this.cached;if(e||t==null)return(await this.refresh(e)).token;if(t.expiresAt==null)return t.token;let n=t.expiresAt-Vr();if(n>zL)return t.token;if(n>oc)return this.backgroundRefresh(),t.token;return(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){if(this.pendingRefresh&&!e)return this.pendingRefresh;return this.doRefresh(e)}backgroundRefresh(){if(this.pendingRefresh)return;if(Vr()-this.lastAdvisoryError<$L)return;this.doRefresh().catch((e)=>{this.lastAdvisoryError=Vr(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then((t)=>(this.cached=t,this.pendingRefresh=null,t),(t)=>{throw this.pendingRefresh=null,t}),this.pendingRefresh}}var jL=O(()=>{sc()});var Pe=(e)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[e]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()||void 0;return};function KL(e){let t=0;for(let o of e)t+=o.length;let n=new Uint8Array(t),r=0;for(let o of e)n.set(o,r),r+=o.length;return n}function ic(e){let t;return(HL??(t=new globalThis.TextEncoder,HL=t.encode.bind(t)))(e)}function Hx(e){let t;return(BL??(t=new globalThis.TextDecoder,BL=t.decode.bind(t)))(e)}var HL,BL;var GL=O(()=>{dt()});function cd(){}function ih(e,t,n){if(!t||ah[e]>ah[n])return cd;else return t[e].bind(t)}function Kx(e,t){let n=WL.get(e);if(n&&n[0]===t)return n[1];let r={error:ih("error",e,t),warn:ih("warn",e,t),info:ih("info",e,t),debug:ih("debug",e,t)};return WL.set(e,[t,r]),r}function je(e){let t=e.logger,n=e.logLevel??"off";if(!t)return Mte;return Kx(t,n)}function VL(){let e=Pe("ANTHROPIC_LOG");if(!Bx||e!==qL)qL=e,Bx=Kx(console,ch(e,"process.env['ANTHROPIC_LOG']",Kx(console,ld))??ld);return Bx}var ld="warn",ah,ch=(e,t,n)=>{if(!e)return;if(hL(ah,e))return e;n.warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(ah))}`);return},Mte,WL,qL,Bx,Ao=(e)=>{if(e.options)e.options={...e.options},delete e.options.headers;if(e.headers)e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([t,n])=>[t,t.toLowerCase()==="authorization"||t.toLowerCase()==="api-key"||t.toLowerCase()==="x-api-key"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":n]));if("retryOfRequestLogID"in e){if(e.retryOfRequestLogID)e.retryOf=e.retryOfRequestLogID;delete e.retryOfRequestLogID}return e};var To=O(()=>{Wr();ah={off:0,error:200,warn:300,info:400,debug:500};Mte={error:cd,warn:cd,info:cd,debug:cd},WL=new WeakMap});var Gx=O(()=>{Wr();GL();To();zx()});function ZL(e){if(!e)throw Error("profile name is empty");if(e==="."||e==="..")throw Error(`profile name "${e}" is not allowed`);if(e.includes("/")||e.includes("\\"))throw Error(`profile name "${e}" must not contain path separators`);if(!Nte.test(e))throw Error(`profile name "${e}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var lh="1.0",Nte,YL=async(e)=>{var t,n;let r=await Wx();if(r===null)return null;let o=e??await XL();if(o===null)return null;ZL(o);let s=await import("node:fs"),a=(await import("node:path")).join(r,"configs",`${o}.json`),c;try{c=await s.promises.readFile(a,"utf-8")}catch(p){if(p?.code!=="ENOENT")throw Error(`failed to read config file ${a}: ${p}`);c=null}if(c===null){let p=Pe("ANTHROPIC_ORGANIZATION_ID"),f=Pe("ANTHROPIC_IDENTITY_TOKEN_FILE"),m=Pe("ANTHROPIC_FEDERATION_RULE_ID");if(m&&p)return{fromFile:!1,config:{organization_id:p,workspace_id:Pe("ANTHROPIC_WORKSPACE_ID"),base_url:Pe("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:m,service_account_id:Pe("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:f?{source:"file",path:f}:void 0,scope:Pe("ANTHROPIC_SCOPE")}}};return null}let l;try{l=JSON.parse(c)}catch(p){throw Error(`failed to parse config file ${a}: ${p}`)}if(!l.authentication)throw Error(`config file ${a} is missing "authentication"`);let u=l.authentication.type;if(u!=="oidc_federation"&&u!=="user_oauth")throw Error(`authentication.type "${u}" is not a known authentication type`);if(l.organization_id??(l.organization_id=Pe("ANTHROPIC_ORGANIZATION_ID")),l.workspace_id??(l.workspace_id=Pe("ANTHROPIC_WORKSPACE_ID")),l.base_url??(l.base_url=Pe("ANTHROPIC_BASE_URL")),(t=l.authentication).scope??(t.scope=Pe("ANTHROPIC_SCOPE")),l.authentication.type==="oidc_federation"){if(!l.authentication.identity_token){let p=Pe("ANTHROPIC_IDENTITY_TOKEN_FILE");if(p)l.authentication.identity_token={source:"file",path:p}}if(!l.authentication.federation_rule_id)l.authentication.federation_rule_id=Pe("ANTHROPIC_FEDERATION_RULE_ID")??"";(n=l.authentication).service_account_id??(n.service_account_id=Pe("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:l,fromFile:!0}},JL=async(e,t)=>{if(e?.authentication.credentials_path)return e.authentication.credentials_path;let n=await Wx();if(!n)return null;let r=t??await XL();if(!r)return null;return ZL(r),(await import("node:path")).join(n,"credentials",`${r}.json`)},Wx=async()=>{if(!Ute())return null;let e=await import("node:path"),t=Pe("ANTHROPIC_CONFIG_DIR");if(t)return t;if(id()["X-Stainless-OS"]==="Windows"){let s=Pe("APPDATA");if(s)return e.join(s,"Anthropic");let i=Pe("USERPROFILE");if(i)return e.join(i,"AppData","Roaming","Anthropic");return null}let r=Pe("XDG_CONFIG_HOME");if(r)return e.join(r,"anthropic");let o=Pe("HOME");if(o)return e.join(o,".config","anthropic");return null},Ute=()=>{let e=id()["X-Stainless-Runtime"];return e==="node"||e==="deno"},XL=async()=>{let e=await Wx();if(!e)return null;let t=Pe("ANTHROPIC_PROFILE");if(t)return t;let n=await import("node:fs"),o=(await import("node:path")).join(e,"active_config");try{return(await n.promises.readFile(o,"utf-8")).trim()||"default"}catch(s){if(s?.code!=="ENOENT")throw Error(`failed to read ${o}: ${s}`);return"default"}};var qx=O(()=>{Xm();Gx();Nte=/^[A-Za-z0-9_.-]+$/});function Vx(e){if(!e)throw new j("Identity token file path is empty");return async()=>{let t=await import("node:fs"),n;try{n=await t.promises.readFile(e,"utf-8")}catch(o){throw new j(`Failed to read identity token file at ${e}: ${o}`)}let r=n.trim();if(!r)throw new j(`Identity token file at ${e} is empty`);return r}}function QL(e){if(!e)throw new j("Identity token value is empty");return()=>e}var eM=O(()=>{dt()});function tM(e){return async()=>{nh(e.baseURL);let t=await e.identityTokenProvider();if(t.length>16384)throw new et(`Identity token is ${Math.ceil(t.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let n={grant_type:NL,assertion:t,federation_rule_id:e.federationRuleId,organization_id:e.organizationId};if(e.serviceAccountId)n.service_account_id=e.serviceAccountId;if(e.workspaceId)n.workspace_id=e.workspaceId;let r=`${e.baseURL}${th}`,o;try{o=await e.fetch(r,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${Pi},${FL}`,"User-Agent":e.userAgent||`anthropic-sdk-typescript/${Ar} oidcFederationProvider`},body:JSON.stringify(n)})}catch(c){throw new et(`Failed to reach token endpoint ${r}: ${c}`)}let s=o.headers.get("Request-Id");if(!o.ok){let c=await o.text().catch(()=>""),l=Un(c),u="";if(o.status===401)u=` Ensure your federation rule matches your identity token. ${e.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`;throw new et(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${l}${u}`,o.status,l,s)}let i=await rh(o,s),a=Number(i.expires_in);if(!Number.isFinite(a))throw new et(`Token endpoint response missing required fields: ${JSON.stringify(Un(i))}`,o.status,Un(i),s);return{token:i.access_token,expiresAt:Vr()+a}}}var nM=O(()=>{sc()});function rM(e){return async(t)=>{let n=await import("node:fs");await oh(e.credentialsPath,e.onSafetyWarning);let r;try{r=await n.promises.readFile(e.credentialsPath,"utf-8")}catch(y){throw new et(`Credentials file not found at ${e.credentialsPath}: ${y}`)}let o;try{o=JSON.parse(r)}catch(y){throw new et(`Credentials file at ${e.credentialsPath} is not valid JSON: ${y}`)}let s=o.access_token;if(!s)throw new et(`Credentials file at ${e.credentialsPath} must include 'access_token'`);let i=o.expires_at;if(!t?.forceRefresh&&(i==null||Vr()<i-oc))return{token:s,expiresAt:i??null};let a=o.refresh_token;if(!e.clientId||!a)throw new et(`Access token at ${e.credentialsPath} has expired and no refresh is available (client_id ${e.clientId?"set":"empty"}, refresh_token ${a?"set":"empty"})`);nh(e.baseURL);let c={grant_type:UL,refresh_token:a,client_id:e.clientId},l=`${e.baseURL}${th}`,u;try{u=await e.fetch(l,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":Pi,"User-Agent":e.userAgent||`anthropic-sdk-typescript/${Ar} userOAuthProvider`},body:JSON.stringify(c)})}catch(y){throw new et(`User OAuth refresh failed to reach token endpoint: ${y}`)}let p=u.headers.get("Request-Id");if(!u.ok){let y=await u.text().catch(()=>"");throw new et(`User OAuth refresh failed (HTTP ${u.status}): ${Un(y)}`,u.status,Un(y),p)}let f=await rh(u,p),m=Number(f.expires_in);if(!Number.isFinite(m))throw new et(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(Un(f))}`,u.status,Un(f),p);let h=Vr()+m,_=f.refresh_token||a;return await sh(e.credentialsPath,{...o,version:lh,type:"oauth_token",access_token:f.access_token,expires_at:h,refresh_token:_}),{token:f.access_token,expiresAt:h}}}var oM=O(()=>{qx();sc()});function Zx(e,t){let n=e.authentication.credentials_path??null,r=(e.base_url||t.baseURL).replace(/\/+$/,""),o=Fte(e,n,r,t),s={};if(e.workspace_id&&e.authentication.type==="user_oauth")s["anthropic-workspace-id"]=e.workspace_id;return{provider:o,extraHeaders:s,baseURL:e.base_url||void 0}}async function sM(e,t){let n=await YL(t);if(!n)return null;let{config:r,fromFile:o}=n,s=r.authentication.credentials_path||!o?r:{...r,authentication:{...r.authentication,credentials_path:await JL(r,t)??void 0}};return Zx(s,e)}function Fte(e,t,n,r){switch(e.authentication.type){case"oidc_federation":{let o=e.authentication,s=zte(o);if(!s)throw new et("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!o.federation_rule_id)throw new et("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!e.organization_id)throw new et("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let i=tM({identityTokenProvider:s,federationRuleId:o.federation_rule_id,organizationId:e.organization_id,serviceAccountId:o.service_account_id,workspaceId:e.workspace_id,baseURL:n,fetch:r.fetch,userAgent:r.userAgent});if(t)return $te(i,t,r.onCacheWriteError,r.onSafetyWarning);return i}case"user_oauth":{if(!t)throw new et("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to <config_dir>/credentials/<profile>.json)");return rM({credentialsPath:t,clientId:e.authentication.client_id,baseURL:n,fetch:r.fetch,userAgent:r.userAgent,onSafetyWarning:r.onSafetyWarning})}default:{let o=e.authentication.type;throw new et(`authentication.type "${o}" is not a known authentication type`)}}}function zte(e){if(e.identity_token){let r=e.identity_token.source;if(r!=="file")throw new et(`identity_token.source "${r}" is not supported by this SDK version (only "file")`);if(!e.identity_token.path)throw new et('identity_token.source "file" requires a non-empty path');return Vx(e.identity_token.path)}let t=Pe("ANTHROPIC_IDENTITY_TOKEN_FILE");if(t)return Vx(t);let n=Pe("ANTHROPIC_IDENTITY_TOKEN");if(n)return QL(n);return null}function $te(e,t,n,r){return async(o)=>{let s=await import("node:fs");await oh(t,r);let i;try{let c=await s.promises.readFile(t,"utf-8");i=JSON.parse(c);let l=i?.access_token;if(l&&!o?.forceRefresh){let u=i?.expires_at;if(u==null||Vr()<u-oc)return{token:l,expiresAt:u??null}}}catch(c){if(c?.code!=="ENOENT"&&!(c instanceof SyntaxError))n?.(c)}let a=await e(o);try{await sh(t,{...i??{},version:lh,type:"oauth_token",access_token:a.token,expires_at:a.expiresAt})}catch(c){n?.(c)}return a}}var iM=O(()=>{qx();sc();eM();nM();oM()});class ks{constructor(){ir.set(this,void 0),ar.set(this,void 0),L(this,ir,new Uint8Array,"f"),L(this,ar,null,"f")}decode(e){if(e==null)return[];let t=e instanceof ArrayBuffer?new Uint8Array(e):typeof e==="string"?ic(e):e;L(this,ir,KL([E(this,ir,"f"),t]),"f");let n=[],r;while((r=jte(E(this,ir,"f"),E(this,ar,"f")))!=null){if(r.carriage&&E(this,ar,"f")==null){L(this,ar,r.index,"f");continue}if(E(this,ar,"f")!=null&&(r.index!==E(this,ar,"f")+1||r.carriage)){n.push(Hx(E(this,ir,"f").subarray(0,E(this,ar,"f")-1))),L(this,ir,E(this,ir,"f").subarray(E(this,ar,"f")),"f"),L(this,ar,null,"f");continue}let o=E(this,ar,"f")!==null?r.preceding-1:r.preceding,s=Hx(E(this,ir,"f").subarray(0,o));n.push(s),L(this,ir,E(this,ir,"f").subarray(r.index),"f"),L(this,ar,null,"f")}return n}flush(){if(!E(this,ir,"f").length)return[];return this.decode(`
`)}}function jte(e,t){for(let o=t??0;o<e.length;o++){if(e[o]===10)return{preceding:o,index:o+1,carriage:!1};if(e[o]===13)return{preceding:o,index:o+1,carriage:!0}}return null}function aM(e){for(let r=0;r<e.length-1;r++){if(e[r]===10&&e[r+1]===10)return r+2;if(e[r]===13&&e[r+1]===13)return r+2;if(e[r]===13&&e[r+1]===10&&r+3<e.length&&e[r+2]===13&&e[r+3]===10)return r+4}return-1}var ir,ar;var Yx=O(()=>{Nn();ir=new WeakMap,ar=new WeakMap;ks.NEWLINE_CHARS=new Set([`
`,"\r"]);ks.NEWLINE_REGEXP=/\r\n|[\n\r]/g});async function*cM(e,t){if(!e.body){if(t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new j("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new j("Attempted to iterate over a response with no body")}let n=new lM,r=new ks,o=ad(e.body);for await(let s of Hte(o))for(let i of r.decode(s)){let a=n.decode(i);if(a)yield a}for(let s of r.flush()){let i=n.decode(s);if(i)yield i}}async function*Hte(e){let t=new Uint8Array;for await(let n of e){if(n==null)continue;let r=n instanceof ArrayBuffer?new Uint8Array(n):typeof n==="string"?ic(n):n,o=new Uint8Array(t.length+r.length);o.set(t),o.set(r,t.length),t=o;let s;while((s=aM(t))!==-1)yield t.slice(0,s),t=t.slice(s)}if(t.length>0)yield t}class lM{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r"))e=e.substring(0,e.length-1);if(!e){if(!this.event&&!this.data.length)return null;let o={event:this.event,data:this.data.join(`
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],o}if(this.chunks.push(e),e.startsWith(":"))return null;let[t,n,r]=Bte(e,":");if(r.startsWith(" "))r=r.substring(1);if(t==="event")this.event=r;else if(t==="data")this.data.push(r);return null}}function Bte(e,t){let n=e.indexOf(t);if(n!==-1)return[e.substring(0,n),t,e.substring(n+t.length)];return[e,"",""]}var ud,gn;var dd=O(()=>{Nn();dt();Yx();Wr();To();dt();gn=class gn{constructor(e,t,n){this.iterator=e,ud.set(this,void 0),this.controller=t,L(this,ud,n,"f")}static rawEvents(e,t=new AbortController){return cM(e,t)}static fromSSEResponse(e,t,n){let r=!1,o=n?je(n):console;async function*s(){if(r)throw new j("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let i=!1;try{for await(let a of cM(e,t)){if(a.event==="completion")try{yield JSON.parse(a.data)}catch(c){throw o.error("Could not parse message into JSON:",a.data),o.error("From chunk:",a.raw),c}if(a.event==="message_start"||a.event==="message_delta"||a.event==="message_stop"||a.event==="content_block_start"||a.event==="content_block_delta"||a.event==="content_block_stop"||a.event==="message"||a.event==="user.message"||a.event==="user.interrupt"||a.event==="user.tool_confirmation"||a.event==="user.custom_tool_result"||a.event==="user.tool_result"||a.event==="agent.message"||a.event==="agent.thinking"||a.event==="agent.tool_use"||a.event==="agent.tool_result"||a.event==="agent.mcp_tool_use"||a.event==="agent.mcp_tool_result"||a.event==="agent.custom_tool_use"||a.event==="agent.thread_context_compacted"||a.event==="session.status_running"||a.event==="session.status_idle"||a.event==="session.status_rescheduled"||a.event==="session.status_terminated"||a.event==="session.error"||a.event==="session.deleted"||a.event==="session.updated"||a.event==="span.model_request_start"||a.event==="span.model_request_end"||a.event==="span.outcome_evaluation_start"||a.event==="span.outcome_evaluation_ongoing"||a.event==="span.outcome_evaluation_end"||a.event==="user.define_outcome"||a.event==="agent.thread_message_received"||a.event==="agent.thread_message_sent"||a.event==="agent.session_thread_message_received"||a.event==="agent.session_thread_message_sent"||a.event==="session.thread_created"||a.event==="session.thread_status_created"||a.event==="session.thread_status_running"||a.event==="session.thread_status_idle"||a.event==="session.thread_status_rescheduled"||a.event==="session.thread_status_terminated"||a.event==="event_start"||a.event==="event_delta"||a.event==="system.message")try{yield JSON.parse(a.data)}catch(c){throw o.error("Could not parse message into JSON:",a.data),o.error("From chunk:",a.raw),c}if(a.event==="ping")continue;if(a.event==="error"){let c=sd(a.data)??a.data,l=c?.error?.type;throw new kt(void 0,c,void 0,e.headers,l)}}i=!0}catch(a){if(wr(a))return;throw a}finally{if(!i)t.abort()}}return new gn(s,t,n)}static fromReadableStream(e,t,n){let r=!1;async function*o(){let i=new ks,a=ad(e);for await(let c of a)for(let l of i.decode(c))yield l;for(let c of i.flush())yield c}async function*s(){if(r)throw new j("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");r=!0;let i=!1;try{for await(let a of o()){if(i)continue;if(a)yield JSON.parse(a)}i=!0}catch(a){if(wr(a))return;throw a}finally{if(!i)t.abort()}}return new gn(s,t,n)}[(ud=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],t=[],n=this.iterator(),r=(o)=>({next:()=>{if(o.length===0){let s=n.next();e.push(s),t.push(s)}return o.shift()}});return[new gn(()=>r(e),this.controller,E(this,ud,"f")),new gn(()=>r(t),this.controller,E(this,ud,"f"))]}toReadableStream(){let e=this,t;return Px({async start(){t=e[Symbol.asyncIterator]()},async pull(n){try{let{value:r,done:o}=await t.next();if(o)return n.close();let s=ic(JSON.stringify(r)+`
`);n.enqueue(s)}catch(r){n.error(r)}},async cancel(){await t.return?.()}})}}});async function uh(e,t){let{response:n,requestLogID:r,retryOfRequestLogID:o,startTime:s}=t,i=await(async()=>{if(t.options.stream)return je(e).debug("response",n.status,n.url,n.headers,n.body),gn.fromSSEResponse(n,t.controller);if(n.status===204)return null;if(t.options.__binaryResponse)return n;let c=n.headers.get("content-type")?.split(";")[0]?.trim();if(c?.includes("application/json")||c?.endsWith("+json")){if(n.headers.get("content-length")==="0")return;let f=await n.json();return pd(f,n)}return await n.text()})();return je(e).debug(`[${r}] response parsed`,Ao({retryOfRequestLogID:o,url:n.url,status:n.status,body:i,durationMs:Date.now()-s})),i}function pd(e,t){if(!e||typeof e!=="object"||Array.isArray(e))return e;return Object.defineProperty(e,"_request_id",{value:t.headers.get("request-id"),enumerable:!1})}var dh=O(()=>{dd();To()});function Jx(e){return typeof e==="object"&&e!==null&&dM.has(e)}function pM(e){let t=new Set;while(typeof e==="object"&&e!==null&&!t.has(e)){if(t.add(e),Jx(e)||wr(e)||e instanceof Zo||e instanceof Jm)return!0;e=e.cause}return!1}function Xx(e,t,n,r){return async(o,s={})=>{if(t.length===0)return e.call(void 0,o,s);let i=s.headers instanceof Headers?s.headers:new Headers(s.headers),a=await Gte(e,t,n,r)({...s,headers:i,url:typeof o==="string"?o:o instanceof URL?o.href:o.url});if(a.bodyUsed||a.body?.locked)throw new j("middleware consumed the response body; use response.clone() to inspect it, or return new Response(body, response) to consume and replace it");return a}}function Kte(e,t){let n=new WeakMap;return{options:e,logger:t?je(t):VL(),parse(r){if(e?.stream&&r.ok)return uM(r,e);let o=n.get(r);if(!o)o=uM(r,e),n.set(r,o);return o}}}async function uM(e,t){if(e.bodyUsed||e.body?.locked)throw new j("cannot ctx.parse() a response whose body was already consumed; call ctx.parse() instead of reading the body, or read via response.clone()");if(t?.stream&&e.ok)return gn.fromSSEResponse(e.clone(),new AbortController);if(e.status===204)return null;if(t?.__binaryResponse)return e;let r=e.headers.get("content-type")?.split(";")[0]?.trim();if(r?.includes("application/json")||r?.endsWith("+json")){if(e.headers.get("content-length")==="0")return;return pd(await e.clone().json(),e)}return await e.clone().text()}function Gte(e,t,n,r){let o=async({url:i,...a})=>{try{return await e.call(void 0,i,a)}catch(c){let l=Oi(c);throw dM.add(l),l}},s=Kte(n,r);for(let i=t.length-1;i>=0;i--){let a=t[i],c=o;o=async(l)=>a(l,c,s)}return o}var dM;var fM=O(()=>{dh();To();dt();dd();dM=new WeakSet});var fd,Ii;var ph=O(()=>{Nn();dh();Ii=class Ii extends Promise{constructor(e,t,n=uh){super((r)=>{r(null)});this.responsePromise=t,this.parseResponse=n,fd.set(this,void 0),L(this,fd,e,"f")}_thenUnwrap(e){return new Ii(E(this,fd,"f"),this.responsePromise,async(t,n)=>pd(e(await this.parseResponse(t,n),n),n.response))}asResponse(){return this.responsePromise.then((e)=>e.response)}async withResponse(){let[e,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:t,request_id:t.headers.get("request-id")}}parse(){if(!this.parsedPromise)this.parsedPromise=this.responsePromise.then((e)=>this.parseResponse(E(this,fd,"f"),e));return this.parsedPromise}then(e,t){return this.parse().then(e,t)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};fd=new WeakMap});var fh,mh,hh,Zr,Ee,Qx;var Je=O(()=>{Nn();dt();dh();ph();Wr();mh=class mh{constructor(e,t,n,r){fh.set(this,void 0),L(this,fh,e,"f"),this.options=r,this.response=t,this.body=n}hasNextPage(){if(!this.getPaginatedItems().length)return!1;return this.nextPageRequestOptions()!=null}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new j("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await E(this,fh,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;yield e;while(e.hasNextPage())e=await e.getNextPage(),yield e}async*[(fh=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let t of e.getPaginatedItems())yield t}};hh=class hh extends Ii{constructor(e,t,n){super(e,t,async(r,o)=>new n(r,o.response,await uh(r,o),o.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let t of e)yield t}};Zr=class Zr extends mh{constructor(e,t,n,r){super(e,t,n,r);this.data=n.data||[],this.has_more=n.has_more||!1,this.first_id=n.first_id||null,this.last_id=n.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let t=this.first_id;if(!t)return null;return{...this.options,query:{...od(this.options.query),before_id:t}}}let e=this.last_id;if(!e)return null;return{...this.options,query:{...od(this.options.query),after_id:e}}}};Ee=class Ee extends mh{constructor(e,t,n,r){super(e,t,n,r);this.data=n.data||[],this.next_page=n.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let e=this.next_page;if(!e)return null;return{...this.options,query:{...od(this.options.query),page:e}}}};Qx=class Qx extends mh{constructor(e,t,n,r){super(e,t,n,r);this.data=n.data||[],this.next_page=n.next_page||null,this.prev_page=n.prev_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let e=this.next_page;if(!e)return null;return{...this.options,query:{...od(this.options.query),page:e}}}}});function Di(e,t,n){return tv(),new File(e,t??"unknown_file",n)}function md(e,t){let n=typeof e==="object"&&e!==null&&(("name"in e)&&e.name&&String(e.name)||("url"in e)&&e.url&&String(e.url)||("filename"in e)&&e.filename&&String(e.filename)||("path"in e)&&e.path&&String(e.path))||"";return t?n.split(/[\\/]/).pop()||void 0:n}function qte(e){let t=typeof e==="function"?e:e.fetch,n=mM.get(t);if(n)return n;let r=(async()=>{try{let o="Response"in t?t.Response:(await t("data:,")).constructor,s=new FormData;if(s.toString()===await new o(s).text())return!1;return!0}catch{return!0}})();return mM.set(t,r),r}var tv=()=>{if(typeof File>"u"){let{process:e}=globalThis,t=typeof e?.versions?.node==="string"&&parseInt(e.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(t?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}},nv=(e)=>e!=null&&typeof e==="object"&&typeof e[Symbol.asyncIterator]==="function",ac=async(e,t,n=!0)=>({...e,body:await Vte(e.body,t,n)}),mM,Vte=async(e,t,n=!0)=>{if(!await qte(t))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let r=new FormData;return await Promise.all(Object.entries(e||{}).map(([o,s])=>ev(r,o,s,n))),r},Zte=(e)=>e instanceof Blob&&("name"in e),ev=async(e,t,n,r)=>{if(n===void 0)return;if(n==null)throw TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if(typeof n==="string"||typeof n==="number"||typeof n==="boolean")e.append(t,String(n));else if(n instanceof Response){let o={},s=n.headers.get("Content-Type");if(s)o={type:s};e.append(t,Di([await n.blob()],md(n,r),o))}else if(nv(n))e.append(t,Di([await new Response(Qm(n)).blob()],md(n,r)));else if(Zte(n))e.append(t,Di([n],md(n,r),{type:n.type}));else if(Array.isArray(n))await Promise.all(n.map((o)=>ev(e,t+"[]",o,r)));else if(typeof n==="object")await Promise.all(Object.entries(n).map(([o,s])=>ev(e,`${t}[${o}]`,s,r)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)};var cc=O(()=>{mM=new WeakMap});async function gh(e,t,n){if(tv(),e=await e,t||(t=md(e,!0)),Yte(e)){if(e instanceof File&&t==null&&n==null)return e;return Di([await e.arrayBuffer()],t??e.name,{type:e.type,lastModified:e.lastModified,...n})}if(Jte(e)){let o=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),Di(await rv(o),t,n)}let r=await rv(e);if(!n?.type){let o=r.find((s)=>typeof s==="object"&&("type"in s)&&s.type);if(typeof o==="string")n={...n,type:o}}return Di(r,t,n)}async function rv(e){let t=[];if(typeof e==="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(hM(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(nv(e))for await(let n of e)t.push(...await rv(n));else{let n=e?.constructor?.name;throw Error(`Unexpected data type: ${typeof e}${n?`; constructor: ${n}`:""}${Xte(e)}`)}return t}function Xte(e){if(typeof e!=="object"||e===null)return"";return`; props: [${Object.getOwnPropertyNames(e).map((n)=>`"${n}"`).join(", ")}]`}var hM=(e)=>e!=null&&typeof e==="object"&&typeof e.size==="number"&&typeof e.type==="string"&&typeof e.text==="function"&&typeof e.slice==="function"&&typeof e.arrayBuffer==="function",Yte=(e)=>e!=null&&typeof e==="object"&&typeof e.name==="string"&&typeof e.lastModified==="number"&&hM(e),Jte=(e)=>e!=null&&typeof e==="object"&&typeof e.url==="string"&&typeof e.blob==="function";var gM=O(()=>{cc();cc()});var ov=O(()=>{gM()});var _M=()=>{};class te{constructor(e){this._client=e}}function*ene(e){if(!e)return;if(yM in e){let{values:r,nulls:o}=e;yield*r.entries();for(let s of o)yield[s,null];return}let t=!1,n;if(e instanceof Headers)n=e.entries();else if(Rx(e))n=e;else t=!0,n=Object.entries(e??{});for(let r of n){let o=r[0];if(typeof o!=="string")throw TypeError("expected header name to be a string");let s=Rx(r[1])?r[1]:[r[1]],i=!1;for(let a of s){if(a===void 0)continue;if(t&&!i)i=!0,yield[o,_h];yield[o,a]}}}var yM,_h,tne,bM=(e,t)=>{let n=e?e.split(",").map((r)=>r.trim()).filter(Boolean):[];for(let r of t.split(",").map((o)=>o.trim()))if(r&&!n.includes(r))n.push(r);return n.join(", ")},C=(e)=>{let t=new Headers,n=new Set;for(let r of e){let o=new Set;for(let[s,i]of ene(r)){let a=s.toLowerCase();if(tne.has(a)){if(i===_h)continue;if(i===null)t.delete(s),n.add(a);else t.set(s,bM(t.get(s),i)),n.delete(a);continue}if(i===_h||!o.has(a)){if(t.delete(s),o.add(a),i===_h)continue}if(i===null)t.delete(s),n.add(a);else t.append(s,i),n.delete(a)}}return{[yM]:!0,values:t,nulls:n}};var Ie=O(()=>{Wr();yM=Symbol.for("brand.privateNullableHeaders");_h=Symbol("clear"),tne=new Set(["x-stainless-helper"])});function EM(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var SM,nne=(e=EM)=>function(n,...r){if(n.length===1)return n[0];let o=!1,s=[],i=n.reduce((u,p,f)=>{if(/[?#]/.test(p))o=!0;let m=r[f],h=(o?encodeURIComponent:e)(""+m);if(f!==r.length&&(m==null||typeof m==="object"&&m.toString===Object.getPrototypeOf(Object.getPrototypeOf(m.hasOwnProperty??SM)??SM)?.toString))h=m+"",s.push({start:u.length+p.length,length:h.length,error:`Value of type ${Object.prototype.toString.call(m).slice(8,-1)} is not a valid path parameter`});return u+p+(f===r.length?"":h)},""),a=i.split(/[?#]/,1)[0],c=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,l;while((l=c.exec(a))!==null)s.push({start:l.index,length:l[0].length,error:`Value "${l[0]}" can't be safely passed as a path parameter`});if(s.sort((u,p)=>u.start-p.start),s.length>0){let u=0,p=s.reduce((f,m)=>{let h=" ".repeat(m.start-u),_="^".repeat(m.length);return u=m.start+m.length,f+h+_},"");throw new j(`Path parameters result in path with invalid segments:
${s.map((f)=>f.error).join(`
`)}
${i}
${p}`)}return i},N;var st=O(()=>{dt();SM=Object.freeze(Object.create(null)),N=nne(EM)});var hd;var sv=O(()=>{Je();Ie();st();hd=class hd extends te{retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(N`/v1/deployment_runs/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/deployment_runs?beta=true",Ee,{query:r,...t,headers:C([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}}});var gd;var iv=O(()=>{Je();Ie();st();gd=class gd extends te{create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/deployments?beta=true",{body:r,...t,headers:C([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(N`/v1/deployments/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,t,n){let{betas:r,...o}=t;return this._client.post(N`/v1/deployments/${e}?beta=true`,{body:o,...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/deployments?beta=true",Ee,{query:r,...t,headers:C([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}archive(e,t={},n){let{betas:r}=t??{};return this._client.post(N`/v1/deployments/${e}/archive?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}pause(e,t={},n){let{betas:r}=t??{};return this._client.post(N`/v1/deployments/${e}/pause?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}run(e,t={},n){let{betas:r}=t??{};return this._client.post(N`/v1/deployments/${e}/run?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}unpause(e,t={},n){let{betas:r}=t??{};return this._client.post(N`/v1/deployments/${e}/unpause?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var _d;var av=O(()=>{Je();Ie();st();_d=class _d extends te{create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/dreams?beta=true",{body:r,...t,headers:C([{"anthropic-beta":[...n??[],"dreaming-2026-04-21"].toString()},t?.headers])})}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(N`/v1/dreams/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/dreams?beta=true",Ee,{query:r,...t,headers:C([{"anthropic-beta":[...n??[],"dreaming-2026-04-21"].toString()},t?.headers])})}archive(e,t={},n){let{betas:r}=t??{};return this._client.post(N`/v1/dreams/${e}/archive?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString()},n?.headers])})}cancel(e,t={},n){let{betas:r}=t??{};return this._client.post(N`/v1/dreams/${e}/cancel?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"dreaming-2026-04-21"].toString()},n?.headers])})}}});function Sd(e){return{["x-stainless-helper"]:e}}function yh(e){return typeof e==="object"&&e!==null&&yd in e}function cv(e,t){let n=new Set;if(e){for(let r of e)if(yh(r))n.add(r[yd])}if(t)for(let r of t){if(yh(r))n.add(r[yd]);let o=r.content;if(Array.isArray(o)){for(let s of o)if(yh(s))n.add(s[yd])}}return Array.from(n)}function Sh(e,t){let n=cv(e,t);if(n.length===0)return{};return{["x-stainless-helper"]:n.join(", ")}}function xM(e){if(yh(e))return{["x-stainless-helper"]:e[yd]};return{}}var bd="x-stainless-helper",bh="x-stainless-helper-method",yd;var ko=O(()=>{yd=Symbol("anthropic.sdk.stainlessHelper")});var Ed;var lv=O(()=>{Je();Ie();ko();cc();st();Ed=class Ed extends te{list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/files?beta=true",Zr,{query:r,...t,headers:C([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(N`/v1/files/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,t={},n){let{betas:r}=t??{};return this._client.get(N`/v1/files/${e}/content?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}retrieveMetadata(e,t={},n){let{betas:r}=t??{};return this._client.get(N`/v1/files/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},n?.headers])})}upload(e,t){let{betas:n,...r}=e;return this._client.post("/v1/files?beta=true",ac({body:r,...t,headers:C([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},xM(r.file),t?.headers])},this._client))}}});var xd;var uv=O(()=>{Je();Ie();st();xd=class xd extends te{retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(N`/v1/models/${e}?beta=true`,{...n,headers:C([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/models?beta=true",Zr,{query:r,...t,headers:C([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},t?.headers])})}}});var vd;var dv=O(()=>{Je();Ie();st();vd=class vd extends te{create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/user_profiles?beta=true",{body:r,...t,headers:C([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},t?.headers])})}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(N`/v1/user_profiles/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,t,n){let{betas:r,...o}=t;return this._client.post(N`/v1/user_profiles/${e}?beta=true`,{body:o,...n,headers:C([{"anthropic-beta":[...r??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/user_profiles?beta=true",Ee,{query:r,...t,headers:C([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},t?.headers])})}createEnrollmentURL(e,t={},n){let{betas:r}=t??{};return this._client.post(N`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}}});var TM=k(function(wM){Object.defineProperty(wM,"__esModule",{value:!0});wM.timingSafeEqual=void 0;function vM(e,t=""){if(!e)throw Error(t)}function lne(e,t){if(e.byteLength!==t.byteLength)return!1;if(!(e instanceof DataView))e=new DataView(ArrayBuffer.isView(e)?e.buffer:e);if(!(t instanceof DataView))t=new DataView(ArrayBuffer.isView(t)?t.buffer:t);vM(e instanceof DataView),vM(t instanceof DataView);let n=e.byteLength,r=0,o=-1;while(++o<n)r|=e.getUint8(o)^t.getUint8(o);return r===0}wM.timingSafeEqual=lne});var RM=k(function(cr){var une=cr&&cr.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var s in o)if(o.hasOwnProperty(s))r[s]=o[s]},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(cr,"__esModule",{value:!0});var Ht=256,pv=function(){function e(t){if(t===void 0)t="=";this._paddingCharacter=t}return e.prototype.encodedLength=function(t){if(!this._paddingCharacter)return(t*8+5)/6|0;return(t+2)/3*4|0},e.prototype.encode=function(t){var n="",r=0;for(;r<t.length-2;r+=3){var o=t[r]<<16|t[r+1]<<8|t[r+2];n+=this._encodeByte(o>>>18&63),n+=this._encodeByte(o>>>12&63),n+=this._encodeByte(o>>>6&63),n+=this._encodeByte(o>>>0&63)}var s=t.length-r;if(s>0){var o=t[r]<<16|(s===2?t[r+1]<<8:0);if(n+=this._encodeByte(o>>>18&63),n+=this._encodeByte(o>>>12&63),s===2)n+=this._encodeByte(o>>>6&63);else n+=this._paddingCharacter||"";n+=this._paddingCharacter||""}return n},e.prototype.maxDecodedLength=function(t){if(!this._paddingCharacter)return(t*6+7)/8|0;return t/4*3|0},e.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},e.prototype.decode=function(t){if(t.length===0)return new Uint8Array(0);var n=this._getPaddingLength(t),r=t.length-n,o=new Uint8Array(this.maxDecodedLength(r)),s=0,i=0,a=0,c=0,l=0,u=0,p=0;for(;i<r-4;i+=4)c=this._decodeChar(t.charCodeAt(i+0)),l=this._decodeChar(t.charCodeAt(i+1)),u=this._decodeChar(t.charCodeAt(i+2)),p=this._decodeChar(t.charCodeAt(i+3)),o[s++]=c<<2|l>>>4,o[s++]=l<<4|u>>>2,o[s++]=u<<6|p,a|=c&Ht,a|=l&Ht,a|=u&Ht,a|=p&Ht;if(i<r-1)c=this._decodeChar(t.charCodeAt(i)),l=this._decodeChar(t.charCodeAt(i+1)),o[s++]=c<<2|l>>>4,a|=c&Ht,a|=l&Ht;if(i<r-2)u=this._decodeChar(t.charCodeAt(i+2)),o[s++]=l<<4|u>>>2,a|=u&Ht;if(i<r-3)p=this._decodeChar(t.charCodeAt(i+3)),o[s++]=u<<6|p,a|=p&Ht;if(a!==0)throw Error("Base64Coder: incorrect characters for decoding");return o},e.prototype._encodeByte=function(t){var n=t;return n+=65,n+=25-t>>>8&6,n+=51-t>>>8&-75,n+=61-t>>>8&-15,n+=62-t>>>8&3,String.fromCharCode(n)},e.prototype._decodeChar=function(t){var n=Ht;return n+=(42-t&t-44)>>>8&-Ht+t-43+62,n+=(46-t&t-48)>>>8&-Ht+t-47+63,n+=(47-t&t-58)>>>8&-Ht+t-48+52,n+=(64-t&t-91)>>>8&-Ht+t-65+0,n+=(96-t&t-123)>>>8&-Ht+t-97+26,n},e.prototype._getPaddingLength=function(t){var n=0;if(this._paddingCharacter){for(var r=t.length-1;r>=0;r--){if(t[r]!==this._paddingCharacter)break;n++}if(t.length<4||n>2)throw Error("Base64Coder: incorrect padding")}return n},e}();cr.Coder=pv;var wd=new pv;function dne(e){return wd.encode(e)}cr.encode=dne;function pne(e){return wd.decode(e)}cr.decode=pne;var kM=function(e){une(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._encodeByte=function(n){var r=n;return r+=65,r+=25-n>>>8&6,r+=51-n>>>8&-75,r+=61-n>>>8&-13,r+=62-n>>>8&49,String.fromCharCode(r)},t.prototype._decodeChar=function(n){var r=Ht;return r+=(44-n&n-46)>>>8&-Ht+n-45+62,r+=(94-n&n-96)>>>8&-Ht+n-95+63,r+=(47-n&n-58)>>>8&-Ht+n-48+52,r+=(64-n&n-91)>>>8&-Ht+n-65+0,r+=(96-n&n-123)>>>8&-Ht+n-97+26,r},t}(pv);cr.URLSafeCoder=kM;var CM=new kM;function fne(e){return CM.encode(e)}cr.encodeURLSafe=fne;function mne(e){return CM.decode(e)}cr.decodeURLSafe=mne;cr.encodedLength=function(e){return wd.encodedLength(e)};cr.maxDecodedLength=function(e){return wd.maxDecodedLength(e)};cr.decodedLength=function(e){return wd.decodedLength(e)}});var PM=k(function(OM,Eh){(function(e,t){var n={};t(n);var r=n.default;for(var o in n)r[o]=n[o];if(typeof Eh==="object"&&typeof Eh.exports==="object")Eh.exports=r;else if(typeof define==="function"&&define.amd)define(function(){return r});else e.sha256=r})(OM,function(e){e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function n(p,f,m,h,_){var y,S,b,x,v,T,U,M,F,W,ce,ne,se;while(_>=64){y=f[0],S=f[1],b=f[2],x=f[3],v=f[4],T=f[5],U=f[6],M=f[7];for(W=0;W<16;W++)ce=h+W*4,p[W]=(m[ce]&255)<<24|(m[ce+1]&255)<<16|(m[ce+2]&255)<<8|m[ce+3]&255;for(W=16;W<64;W++)F=p[W-2],ne=(F>>>17|F<<15)^(F>>>19|F<<13)^F>>>10,F=p[W-15],se=(F>>>7|F<<25)^(F>>>18|F<<14)^F>>>3,p[W]=(ne+p[W-7]|0)+(se+p[W-16]|0);for(W=0;W<64;W++)ne=(((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&T^~v&U)|0)+(M+(t[W]+p[W]|0)|0)|0,se=((y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10))+(y&S^y&b^S&b)|0,M=U,U=T,T=v,v=x+ne|0,x=b,b=S,S=y,y=ne+se|0;f[0]+=y,f[1]+=S,f[2]+=b,f[3]+=x,f[4]+=v,f[5]+=T,f[6]+=U,f[7]+=M,h+=64,_-=64}return h}var r=function(){function p(){this.digestLength=e.digestLength,this.blockSize=e.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return p.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},p.prototype.clean=function(){for(var f=0;f<this.buffer.length;f++)this.buffer[f]=0;for(var f=0;f<this.temp.length;f++)this.temp[f]=0;this.reset()},p.prototype.update=function(f,m){if(m===void 0)m=f.length;if(this.finished)throw Error("SHA256: can't update because hash was finished.");var h=0;if(this.bytesHashed+=m,this.bufferLength>0){while(this.bufferLength<64&&m>0)this.buffer[this.bufferLength++]=f[h++],m--;if(this.bufferLength===64)n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0}if(m>=64)h=n(this.temp,this.state,f,h,m),m%=64;while(m>0)this.buffer[this.bufferLength++]=f[h++],m--;return this},p.prototype.finish=function(f){if(!this.finished){var m=this.bytesHashed,h=this.bufferLength,_=m/536870912|0,y=m<<3,S=m%64<56?64:128;this.buffer[h]=128;for(var b=h+1;b<S-8;b++)this.buffer[b]=0;this.buffer[S-8]=_>>>24&255,this.buffer[S-7]=_>>>16&255,this.buffer[S-6]=_>>>8&255,this.buffer[S-5]=_>>>0&255,this.buffer[S-4]=y>>>24&255,this.buffer[S-3]=y>>>16&255,this.buffer[S-2]=y>>>8&255,this.buffer[S-1]=y>>>0&255,n(this.temp,this.state,this.buffer,0,S),this.finished=!0}for(var b=0;b<8;b++)f[b*4+0]=this.state[b]>>>24&255,f[b*4+1]=this.state[b]>>>16&255,f[b*4+2]=this.state[b]>>>8&255,f[b*4+3]=this.state[b]>>>0&255;return this},p.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},p.prototype._saveState=function(f){for(var m=0;m<this.state.length;m++)f[m]=this.state[m]},p.prototype._restoreState=function(f,m){for(var h=0;h<this.state.length;h++)this.state[h]=f[h];this.bytesHashed=m,this.finished=!1,this.bufferLength=0},p}();e.Hash=r;var o=function(){function p(f){this.inner=new r,this.outer=new r,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var m=new Uint8Array(this.blockSize);if(f.length>this.blockSize)new r().update(f).finish(m).clean();else for(var h=0;h<f.length;h++)m[h]=f[h];for(var h=0;h<m.length;h++)m[h]^=54;this.inner.update(m);for(var h=0;h<m.length;h++)m[h]^=106;this.outer.update(m),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var h=0;h<m.length;h++)m[h]=0}return p.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},p.prototype.clean=function(){for(var f=0;f<this.istate.length;f++)this.ostate[f]=this.istate[f]=0;this.inner.clean(),this.outer.clean()},p.prototype.update=function(f){return this.inner.update(f),this},p.prototype.finish=function(f){if(this.outer.finished)this.outer.finish(f);else this.inner.finish(f),this.outer.update(f,this.digestLength).finish(f);return this},p.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},p}();e.HMAC=o;function s(p){var f=new r().update(p),m=f.digest();return f.clean(),m}e.hash=s,e.default=s;function i(p,f){var m=new o(p).update(f),h=m.digest();return m.clean(),h}e.hmac=i;function a(p,f,m,h){var _=h[0];if(_===0)throw Error("hkdf: cannot expand more");if(f.reset(),_>1)f.update(p);if(m)f.update(m);f.update(h),f.finish(p),h[0]++}var c=new Uint8Array(e.digestLength);function l(p,f,m,h){if(f===void 0)f=c;if(h===void 0)h=32;var _=new Uint8Array([1]),y=i(f,p),S=new o(y),b=new Uint8Array(S.digestLength),x=b.length,v=new Uint8Array(h);for(var T=0;T<h;T++){if(x===b.length)a(b,S,m,_),x=0;v[T]=b[x++]}return S.clean(),b.fill(0),_.fill(0),v}e.hkdf=l;function u(p,f,m,h){var _=new o(p),y=_.digestLength,S=new Uint8Array(4),b=new Uint8Array(y),x=new Uint8Array(y),v=new Uint8Array(h);for(var T=0;T*y<h;T++){var U=T+1;S[0]=U>>>24&255,S[1]=U>>>16&255,S[2]=U>>>8&255,S[3]=U>>>0&255,_.reset(),_.update(f),_.update(S),_.finish(x);for(var M=0;M<y;M++)b[M]=x[M];for(var M=2;M<=m;M++){_.reset(),_.update(x).finish(x);for(var F=0;F<y;F++)b[F]^=x[F]}for(var M=0;M<y&&T*y+M<h;M++)v[T*y+M]=b[M]}for(var T=0;T<y;T++)b[T]=x[T]=0;for(var T=0;T<4;T++)S[T]=0;return _.clean(),v}e.pbkdf2=u})});var NM=k(function(LM){Object.defineProperty(LM,"__esModule",{value:!0});LM.Webhook=LM.WebhookVerificationError=void 0;var hne=TM(),IM=RM(),gne=PM(),DM=300;class fv extends Error{constructor(e){super(e);Object.setPrototypeOf(this,fv.prototype),this.name="ExtendableError",this.stack=Error(e).stack}}class Cs extends fv{constructor(e){super(e);Object.setPrototypeOf(this,Cs.prototype),this.name="WebhookVerificationError"}}LM.WebhookVerificationError=Cs;class Ad{constructor(e,t){if(!e)throw Error("Secret can't be empty.");if((t===null||t===void 0?void 0:t.format)==="raw")if(e instanceof Uint8Array)this.key=e;else this.key=Uint8Array.from(e,(n)=>n.charCodeAt(0));else{if(typeof e!=="string")throw Error("Expected secret to be of type string");if(e.startsWith(Ad.prefix))e=e.substring(Ad.prefix.length);this.key=IM.decode(e)}}verify(e,t){let n={};for(let p of Object.keys(t))n[p.toLowerCase()]=t[p];let r=n["webhook-id"],o=n["webhook-signature"],s=n["webhook-timestamp"];if(!o||!r||!s)throw new Cs("Missing required headers");let i=this.verifyTimestamp(s),c=this.sign(r,i,e).split(",")[1],l=o.split(" "),u=new globalThis.TextEncoder;for(let p of l){let[f,m]=p.split(",");if(f!=="v1")continue;if((0,hne.timingSafeEqual)(u.encode(m),u.encode(c)))return JSON.parse(e.toString())}throw new Cs("No matching signature found")}sign(e,t,n){if(typeof n==="string");else if(n.constructor.name==="Buffer")n=n.toString();else throw Error("Expected payload to be of type string or Buffer.");let r=new TextEncoder,o=Math.floor(t.getTime()/1000),s=r.encode(`${e}.${o}.${n}`);return`v1,${IM.encode(gne.hmac(this.key,s))}`}verifyTimestamp(e){let t=Math.floor(Date.now()/1000),n=parseInt(e,10);if(isNaN(n))throw new Cs("Invalid Signature Headers");if(t-n>DM)throw new Cs("Message timestamp too old");if(n>t+DM)throw new Cs("Message timestamp too new");return new Date(n*1000)}}LM.Webhook=Ad;Ad.prefix="whsec_"});var UM,Td;var mv=O(()=>{UM=$a(NM(),1);Td=class Td extends te{unwrap(e,{headers:t,key:n}){if(t!==void 0){let r=n===void 0?this._client.webhookKey:n;if(r===null)throw Error("Webhook key must not be null in order to unwrap");new UM.Webhook(r).verify(e,t)}return JSON.parse(e)}}});var kd;var hv=O(()=>{Je();Ie();st();kd=class kd extends te{list(e,t={},n){let{betas:r,...o}=t??{};return this._client.getAPIList(N`/v1/agents/${e}/versions?beta=true`,Ee,{query:o,...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var lc;var gv=O(()=>{hv();hv();Je();Ie();st();lc=class lc extends te{constructor(){super(...arguments);this.versions=new kd(this._client)}create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/agents?beta=true",{body:r,...t,headers:C([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}retrieve(e,t={},n){let{betas:r,...o}=t??{};return this._client.get(N`/v1/agents/${e}?beta=true`,{query:o,...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,t,n){let{betas:r,...o}=t;return this._client.post(N`/v1/agents/${e}?beta=true`,{body:o,...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/agents?beta=true",Ee,{query:r,...t,headers:C([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}archive(e,t={},n){let{betas:r}=t??{};return this._client.post(N`/v1/agents/${e}/archive?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};lc.Versions=kd});function Li(e,t){if(!e)return()=>{};if(e.aborted)return t.abort(),()=>{};let n=()=>t.abort();return e.addEventListener("abort",n),()=>e.removeEventListener("abort",n)}function Rs(e,t){return e instanceof kt&&e.status===t}function FM(e){return e instanceof kt&&typeof e.status==="number"&&e.status>=400&&e.status<500}function Os(e){return FM(e)&&!Rs(e,408)&&!Rs(e,409)&&!Rs(e,429)}function zM(e,t,n){return Math.min(t*2**e,n)}function _v(e,t){return e+Math.random()*(t-e)}function $M(e){return e*(1-Math.random()*0.25)}var Cd=O(()=>{dt()});function xh(e,{authToken:t,helper:n}){if(!t)throw new j(`copyClientForHelper: expected a non-empty authToken but received ${JSON.stringify(t)}`);let r=e,o=r._options.defaultHeaders,s=r._authState?.extraHeaders,i=s?Object.fromEntries(Object.entries(s).filter(([c])=>{let l=c.toLowerCase();return l!=="authorization"&&l!=="x-api-key"})):void 0,a=C([i,o,{[bd]:n}]);return e.withOptions({apiKey:null,authToken:t,baseURL:e.baseURL,credentials:void 0,defaultHeaders:a})}var yv=O(()=>{dt();Ie();ko()});function wne(e){return zM(e,xne,vne)}function Ane(){let t=globalThis.process?.env?.HOSTNAME;return t?`${t}-${rc()}`:rc()}var uc,vh,Tr,wh,Ah,Th,Rd,Od,dc,Ene=999,xne=1000,vne=60000,Mi;var kh=O(()=>{Nn();dt();To();Ie();Cd();yv();Cd();Mi=class Mi{constructor(e){uc.set(this,void 0),vh.set(this,!1),Tr.set(this,void 0),wh.set(this,void 0),Ah.set(this,void 0),Th.set(this,void 0),Rd.set(this,void 0),Od.set(this,void 0),dc.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.workerId=e.workerId??Ane(),L(this,uc,xh(e.client,{authToken:e.environmentKey,helper:"environments-work-poller"}),"f"),L(this,Ah,e.autoStop??!0,"f"),L(this,Th,e.drain??!1,"f"),L(this,Rd,e.blockMs===void 0?Ene:e.blockMs,"f"),L(this,Od,e.reclaimOlderThanMs??null,"f"),L(this,dc,e.requestOptions,"f"),L(this,Tr,new AbortController,"f"),L(this,wh,Li(e.signal,E(this,Tr,"f")),"f")}get signal(){return E(this,Tr,"f").signal}abort(){E(this,Tr,"f").abort()}async*[(uc=new WeakMap,vh=new WeakMap,Tr=new WeakMap,wh=new WeakMap,Ah=new WeakMap,Th=new WeakMap,Rd=new WeakMap,Od=new WeakMap,dc=new WeakMap,Symbol.asyncIterator)](){if(E(this,vh,"f"))throw new j("Cannot iterate over a consumed WorkPoller");L(this,vh,!0,"f");let e=je(this.client);e.info("poller starting",{component:"work-poller",environment_id:this.environmentId});try{let t=0;while(!E(this,Tr,"f").signal.aborted){let n;try{n=await E(this,uc,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...E(this,Rd,"f")!==null?{block_ms:E(this,Rd,"f")}:{},...E(this,Od,"f")!==null?{reclaim_older_than_ms:E(this,Od,"f")}:{}},{headers:C([E(this,dc,"f")?.headers]),signal:E(this,Tr,"f").signal})}catch(r){if(E(this,Tr,"f").signal.aborted)return;if(Os(r))throw e.error("poll failed permanently, stopping poller",{error:String(r)}),r;let o=$M(wne(t));e.warn("poll failed, backing off",{error:String(r),backoff_ms:o}),t++,await qr(o,E(this,Tr,"f").signal);continue}if(t=0,n==null){if(E(this,Th,"f"))return;await qr(_v(1000,3000),E(this,Tr,"f").signal);continue}e.info("claimed work",{component:"work-poller",environment_id:this.environmentId,work_id:n.id,work_type:n.data.type});try{await E(this,uc,"f").beta.environments.work.ack(n.id,{environment_id:n.environment_id},{headers:C([E(this,dc,"f")?.headers]),signal:E(this,Tr,"f").signal})}catch(r){e.error("ack failed",{work_id:n.id,error:String(r)});continue}try{yield n}finally{if(E(this,Ah,"f"))try{await E(this,uc,"f").beta.environments.work.stop(n.id,{environment_id:n.environment_id},{headers:C([E(this,dc,"f")?.headers])})}catch(r){if(!Rs(r,409))e.warn("stop failed",{work_id:n.id,error:String(r)})}}}}finally{E(this,wh,"f").call(this)}}}});class bv{constructor(){pc.set(this,[]),Ps.set(this,[]),fc.set(this,!1)}push(e){if(E(this,fc,"f"))return!1;let t=E(this,Ps,"f").shift();if(t)t({done:!1,value:e});else E(this,pc,"f").push(e);return!0}close(){if(E(this,fc,"f"))return;L(this,fc,!0,"f");while(E(this,Ps,"f").length>0)E(this,Ps,"f").shift()({done:!0,value:void 0})}next(e){if(E(this,pc,"f").length>0)return Promise.resolve({done:!1,value:E(this,pc,"f").shift()});if(E(this,fc,"f")||e?.aborted)return Promise.resolve({done:!0,value:void 0});return new Promise((t)=>{let n=(o)=>{e?.removeEventListener("abort",r),t(o)},r=()=>{let o=E(this,Ps,"f").indexOf(n);if(o>=0)E(this,Ps,"f").splice(o,1);t({done:!0,value:void 0})};E(this,Ps,"f").push(n),e?.addEventListener("abort",r,{once:!0})})}tryShift(){return E(this,pc,"f").shift()}}var pc,Ps,fc;var jM=O(()=>{Nn();pc=new WeakMap,Ps=new WeakMap,fc=new WeakMap});var be;var Ni=O(()=>{be=class be extends Error{constructor(e){let t=typeof e==="string"?e:e.map((n)=>{if(n.type==="text")return n.text;return`[${n.type}]`}).join(" ");super(t);this.name="ToolError",this.content=e}}});function Sv(e){return"name"in e?e.name:e.mcp_server_name}function Tne(e){return e instanceof be?e.content:`Error: ${e instanceof Error?e.message:String(e)}`}async function HM(e,t,n){try{let r=e.parse?e.parse(t):t;return{content:await e.run(r,n),isError:!1}}catch(r){return{content:Tne(r),isError:!0}}}var BM=O(()=>{Ni()});function QM(e){return e.type==="session.status_idle"&&e.stop_reason?.type==="end_turn"}class eN{constructor(e,t){Pd.set(this,void 0),Dh.set(this,void 0),mc.set(this,new Set),Ui.set(this,!1),Yr.set(this,void 0),L(this,Pd,e,"f"),L(this,Dh,t,"f")}noteEvent(e){if(e.type==="user.tool_confirmation")return;if(QM(e))this.arm();else this.disarm()}block(e){if(E(this,mc,"f").add(e),E(this,Yr,"f")!==void 0)L(this,Ui,!0,"f"),clearTimeout(E(this,Yr,"f")),L(this,Yr,void 0,"f")}unblock(e){if(E(this,mc,"f").delete(e),E(this,mc,"f").size===0&&E(this,Ui,"f"))this.arm()}arm(){if(E(this,Pd,"f")<=0)return;if(E(this,mc,"f").size>0){L(this,Ui,!0,"f");return}if(L(this,Ui,!1,"f"),E(this,Yr,"f")!==void 0)clearTimeout(E(this,Yr,"f"));L(this,Yr,setTimeout(E(this,Dh,"f"),E(this,Pd,"f")),"f")}disarm(){if(L(this,Ui,!1,"f"),E(this,Yr,"f")!==void 0)clearTimeout(E(this,Yr,"f")),L(this,Yr,void 0,"f")}}function Pne(e,t,n){if(e.type==="agent.custom_tool_use")return{type:"user.custom_tool_result",custom_tool_use_id:e.id,is_error:t,content:n};return{type:"user.tool_result",tool_use_id:e.id,is_error:t,content:n}}function Ine(e){if(typeof e==="string")return[{type:"text",text:e||"(no output)"}];let t=e.map((n)=>{if(n.type==="text")return{type:"text",text:n.text||"(no output)"};if(n.type==="image"||n.type==="document")return n;if(n.type==="search_result")return{type:"search_result",source:n.source,title:n.title,content:n.content.map((r)=>({type:"text",text:r.text})),citations:{enabled:n.citations?.enabled??!1}};return{type:"text",text:JSON.stringify(n)}});return t.length>0?t:[{type:"text",text:"(no output)"}]}var Pd,Dh,mc,Ui,Yr,Ct,Ch,sn,Rh,Id,Lh,qt,gc,lr,_c,Is,hc,Yo,Dd,kr,Oh,JM,KM,GM,WM,Ev,qM,Ph,Ih,xv,VM,XM,ZM=500,kne=1e4,Cne=120000,Rne=30000,YM=3,One=60000,Fi;var Mh=O(()=>{Nn();dt();To();Cd();jM();Ie();ko();BM();Pd=new WeakMap,Dh=new WeakMap,mc=new WeakMap,Ui=new WeakMap,Yr=new WeakMap;Fi=class Fi{constructor(e,t){Ct.add(this),Ch.set(this,!1),sn.set(this,void 0),Rh.set(this,void 0),Id.set(this,void 0),Lh.set(this,void 0),qt.set(this,void 0),gc.set(this,new Set),lr.set(this,new Set),_c.set(this,new Map),Is.set(this,new Map),hc.set(this,new bv),Yo.set(this,0),Dd.set(this,null),kr.set(this,void 0),this.client=t.client,this.sessionId=e,this.tools=t.tools,this.maxIdleMs=t.maxIdleMs??One,L(this,qt,je(t.client),"f"),L(this,Lh,new Map(t.tools.map((n)=>[Sv(n),n])),"f"),L(this,sn,new AbortController,"f"),L(this,Rh,Li(t.signal,E(this,sn,"f")),"f"),L(this,Id,t.requestOptions,"f"),L(this,kr,new eN(this.maxIdleMs,()=>{E(this,qt,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),E(this,sn,"f").abort()}),"f")}get signal(){return E(this,sn,"f").signal}abort(){E(this,sn,"f").abort()}async*[(Ch=new WeakMap,sn=new WeakMap,Rh=new WeakMap,Id=new WeakMap,Lh=new WeakMap,qt=new WeakMap,gc=new WeakMap,lr=new WeakMap,_c=new WeakMap,Is=new WeakMap,hc=new WeakMap,Yo=new WeakMap,Dd=new WeakMap,kr=new WeakMap,Ct=new WeakSet,Symbol.asyncIterator)](){if(E(this,Ch,"f"))throw new j("Cannot iterate over a consumed SessionToolRunner");L(this,Ch,!0,"f"),E(this,qt,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let e=E(this,Ct,"m",JM).call(this).catch((t)=>{if(!E(this,sn,"f").signal.aborted)E(this,qt,"f").error("stream loop failed",{error:String(t)});E(this,sn,"f").abort()});try{while(!0){let n=await E(this,hc,"f").next(E(this,sn,"f").signal);if(n.done)break;yield n.value}await e;let t;while((t=E(this,hc,"f").tryShift())!==void 0)yield t}finally{E(this,sn,"f").abort(),E(this,kr,"f").disarm(),await e;try{await E(this,Ct,"m",XM).call(this)}catch(t){E(this,qt,"f").warn("drain failed",{error:String(t)})}E(this,hc,"f").close();for(let t of this.tools)try{await t.close?.()}catch(n){E(this,qt,"f").warn("tool.close failed",{tool:Sv(t),error:String(n)})}E(this,Rh,"f").call(this)}}};Oh=function(){return{...E(this,Id,"f"),headers:C([Sd("session-tool-runner"),E(this,Id,"f")?.headers]),signal:E(this,sn,"f").signal}},JM=async function(){let t=E(this,sn,"f"),n=ZM;while(!t.signal.aborted){try{let r=await this.client.beta.sessions.events.stream(this.sessionId,{},E(this,Ct,"m",Oh).call(this));await E(this,Ct,"m",KM).call(this);for await(let o of r)if(n=ZM,await E(this,Ct,"m",WM).call(this,o))return}catch(r){if(t.signal.throwIfAborted(),Os(r))throw E(this,qt,"f").error("permanent stream failure, shutting down",{error:String(r)}),t.abort(),r;E(this,qt,"f").warn("stream disconnected, reconnecting",{error:String(r),backoff_ms:n})}t.signal.throwIfAborted(),await qr(n,t.signal),n=Math.min(n*2,kne)}},KM=async function(){let t=E(this,sn,"f"),n=[],r=!1;try{for await(let i of this.client.beta.sessions.events.list(this.sessionId,{limit:1000},E(this,Ct,"m",Oh).call(this)))E(this,Ct,"m",GM).call(this,i,n),r=QM(i)}catch(i){t.signal.throwIfAborted(),E(this,qt,"f").warn("reconcile list failed",{error:String(i)});for(let a of n)E(this,gc,"f").delete(a.id);return}let o=n.filter((i)=>!E(this,lr,"f").has(i.id));E(this,kr,"f").disarm();for(let i of o)await E(this,Ct,"m",Ev).call(this,i);for(let i of[...E(this,Is,"f").values()]){let a=E(this,_c,"f").get(i.id);if(a!==void 0)await E(this,Ct,"m",Ph).call(this,i,a)}let s=o.filter((i)=>!E(this,lr,"f").has(i.id)&&!E(this,Is,"f").has(i.id));if(r&&s.length===0)E(this,kr,"f").arm();else E(this,kr,"f").disarm()},GM=function(t,n){if(t.type==="agent.tool_use"||t.type==="agent.custom_tool_use"){if(E(this,gc,"f").add(t.id),!E(this,lr,"f").has(t.id))n.push(t)}else if(t.type==="user.tool_result")E(this,lr,"f").add(t.tool_use_id);else if(t.type==="user.custom_tool_result")E(this,lr,"f").add(t.custom_tool_use_id);else if(t.type==="user.tool_confirmation"){if(!E(this,lr,"f").has(t.tool_use_id))E(this,_c,"f").set(t.tool_use_id,t.result)}},WM=async function(t){switch(E(this,kr,"f").noteEvent(t),t.type){case"agent.tool_use":case"agent.custom_tool_use":if(!E(this,gc,"f").has(t.id))E(this,gc,"f").add(t.id),await E(this,Ct,"m",Ev).call(this,t);return!1;case"user.tool_confirmation":return await E(this,Ct,"m",qM).call(this,t),!1;case"user.tool_result":return E(this,lr,"f").add(t.tool_use_id),!1;case"user.custom_tool_result":return E(this,lr,"f").add(t.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return E(this,qt,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),E(this,sn,"f").abort(),!0;default:return!1}},Ev=async function(t){let n=t.evaluated_permission,r=n==="deny"?"deny":E(this,_c,"f").get(t.id);if(r===void 0){if(n===void 0||n==="allow")await E(this,Ct,"m",xv).call(this,t,void 0);else if(!E(this,Is,"f").has(t.id))E(this,qt,"f").info("tool call awaiting confirmation; holding",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),E(this,Is,"f").set(t.id,t),E(this,kr,"f").block(t.id);return}await E(this,Ct,"m",Ph).call(this,t,r)},qM=async function(t){E(this,_c,"f").set(t.tool_use_id,t.result);let n=E(this,Is,"f").get(t.tool_use_id);if(n===void 0)return;await E(this,Ct,"m",Ph).call(this,n,t.result)},Ph=async function(t,n){let r=E(this,Is,"f").delete(t.id);if(n==="allow"){if(E(this,qt,"f").info("tool call confirmed",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),!r)E(this,kr,"f").block(t.id);try{await E(this,Ct,"m",xv).call(this,t,"allow")}finally{E(this,kr,"f").unblock(t.id)}return}if(r)E(this,kr,"f").unblock(t.id);E(this,lr,"f").add(t.id),E(this,qt,"f").info("tool call denied; not executing",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),E(this,Ct,"m",Ih).call(this,{event:t,toolUseId:t.id,name:t.name,isError:!1,posted:!1,confirmation:"deny"})},Ih=function(t){E(this,hc,"f").push(t)},xv=async function(t,n){var r,o;if(E(this,lr,"f").has(t.id))return;E(this,qt,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),L(this,Yo,(r=E(this,Yo,"f"),r++,r),"f");try{let s=E(this,Lh,"f").get(t.name);if(!s){E(this,qt,"f").info("tool not owned by this runner; leaving the tool_use_id pending for its owner",{component:"session-tool-runner",session_id:this.sessionId,tool:t.name,tool_use_id:t.id}),E(this,Ct,"m",Ih).call(this,{event:t,toolUseId:t.id,name:t.name,isError:!1,posted:!1,confirmation:n});return}let i,a,c=new AbortController,l=Li(E(this,sn,"f").signal,c),u=setTimeout(()=>c.abort(),Cne);try{let m=await HM(s,t.input,{toolUse:t,toolUseBlock:t,signal:c.signal});i=m.content,a=m.isError}finally{clearTimeout(u),l()}let p=Pne(t,a,Ine(i)),f=await E(this,Ct,"m",VM).call(this,p,t.id);E(this,Ct,"m",Ih).call(this,{event:t,result:p,toolUseId:t.id,name:t.name,isError:a,posted:f,confirmation:n})}finally{if(L(this,Yo,(o=E(this,Yo,"f"),o--,o),"f"),E(this,Yo,"f")===0)E(this,Dd,"f")?.call(this)}},VM=async function(t,n){let r=E(this,sn,"f"),o;for(let s=0;s<YM;s++){r.signal.throwIfAborted();try{return await this.client.beta.sessions.events.send(this.sessionId,{events:[t]},E(this,Ct,"m",Oh).call(this)),E(this,lr,"f").add(n),!0}catch(i){if(o=i,Os(i))break;if(s<YM-1)await qr((s+1)*1000,r.signal)}}return E(this,qt,"f").error("failed to send tool result",{tool_use_id:n,error:String(o)}),!1},XM=async function(){if(E(this,Yo,"f")===0)return;if(await Promise.race([new Promise((t)=>L(this,Dd,t,"f")),qr(Rne)]),L(this,Dd,null,"f"),E(this,Yo,"f")>0)E(this,qt,"f").warn("drain timeout exceeded")}});var tN=O(()=>{Gx()});function zi(e){if(e.inputSchema.type!=="object")throw Error(`JSON schema for tool "${e.name}" must be an object, but got ${e.inputSchema.type}`);return{type:"custom",name:e.name,input_schema:e.inputSchema,description:e.description,run:e.run,parse:(t)=>t,...e.close?{close:e.close}:{}}}var nN=O(()=>{vv();tN()});function yc(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}import*as ur from"node:fs/promises";import*as An from"node:path";import{randomUUID as Dne}from"node:crypto";async function Mne(e){try{return await ur.realpath(e)}catch{return e}}async function Nne(e){let t=[],n=e,r=0;for(;;){let o;try{o=await ur.realpath(n)}catch{let s=!1;try{s=(await ur.lstat(n)).isSymbolicLink()}catch{}if(s){if(++r>40)throw new be(`path ${JSON.stringify(e)} has too many levels of symbolic links`);n=An.resolve(An.dirname(n),await ur.readlink(n));continue}let i=An.dirname(n);if(i===n)return e;t.push(An.basename(n)),n=i;continue}return t.length?An.join(o,...t.reverse()):o}}async function rN(e,t,n){let r=n?.allowOutside??!1,o=await Mne(An.resolve(e)),s=An.resolve(o,t);if(r)return s;let i=await Nne(s);if(i!==o&&!i.startsWith(o+An.sep))throw new be(`path ${JSON.stringify(t)} escapes workdir`);return i}async function wv(e,t){let n=An.dirname(e),r=An.join(n,`.tmp-${process.pid}-${Dne()}`),o;try{o=await ur.open(r,"wx",Lne),await o.writeFile(t,"utf-8"),await o.sync(),await o.close(),o=void 0,await ur.rename(r,e)}catch(s){if(o)await o.close().catch(()=>{});throw await ur.unlink(r).catch(()=>{}),s}}function Md(e,t){switch(e?.code){case"ENOENT":return`${t}: no such file or directory`;case"EACCES":case"EPERM":return`${t}: permission denied`;case"ENOTDIR":return`${t}: not a directory`;case"EISDIR":return`${t}: is a directory`;case"ELOOP":return`${t}: too many levels of symbolic links`;case"ENAMETOOLONG":return`${t}: file name too long`;case"ENOSPC":return`${t}: no space left on device`;case"EMFILE":case"ENFILE":return`${t}: too many open files`;default:return`${t}: ${e instanceof Error?e.message:String(e)}`}}var Ld=493,Lne=420;var Av=O(()=>{Ni()});import*as Fn from"node:fs/promises";import*as oN from"node:fs";import*as an from"node:path";import{execFile as Une}from"node:child_process";import{promisify as Fne}from"node:util";import{Readable as zne}from"node:stream";import{pipeline as $ne}from"node:stream/promises";async function sN(e){let{client:t,sessionId:n}=e;if(!t||!n)return async()=>{};let r=je(t),o=await t.beta.sessions.retrieve(n),s=an.resolve(e.workdir,"skills"),i=[];for(let a of o.agent.skills)try{let c=await kv(t,a.skill_id,a.version),l=await t.beta.skills.versions.retrieve(c,{skill_id:a.skill_id}),u=an.basename(l.name.trim());if(u===""||u==="."||u==="..")u=a.skill_id;let p=an.resolve(s,u);if(p!==s&&!p.startsWith(s+an.sep)){r.warn("skill name escapes the skills dir; skipping",{component:"agent-tool-context",name:l.name});continue}let f=await t.beta.skills.versions.download(c,{skill_id:a.skill_id});await Fn.rm(p,{recursive:!0,force:!0}),await Fn.mkdir(p,{recursive:!0,mode:Ld}),i.push(p),await Cv(f,p),r.info("downloaded skill",{component:"agent-tool-context",skill_id:a.skill_id,version:c,dest:p})}catch(c){r.warn("failed to download skill",{component:"agent-tool-context",skill_id:a.skill_id,error:String(c)})}return async()=>{for(let a of i)await Fn.rm(a,{recursive:!0,force:!0}).catch((c)=>{r.warn("failed to clean up skill",{component:"agent-tool-context",dest:a,error:String(c)})})}}async function kv(e,t,n){if(/^\d+$/.test(n))return n;let r;for await(let o of e.beta.skills.versions.list(t))if(/^\d+$/.test(o.version)&&(r===void 0||BigInt(o.version)>BigInt(r)))r=o.version;if(r===void 0)throw new j(`skill ${JSON.stringify(t)} has no concrete version to resolve ${JSON.stringify(n)} against`);return r}function Hne(e){for(let t of e.split(`
`)){let n=t.trim();if(!n)continue;if(an.isAbsolute(n)||n.split(/[\\/]/).includes(".."))throw new j(`refusing to extract unsafe archive member: ${n}`)}}function Bne(e){for(let t of e.split(`
`)){let n=t.trimStart()[0];if(n==="l"||n==="h"||n==="b"||n==="c"||n==="p"||n==="s")throw new j("refusing to extract archive with symlink/hardlink/device member")}}async function Tv(e,t){try{let{stdout:n}=await jne(e,t);return n}catch(n){if(n!=null&&typeof n==="object"&&n.code==="ENOENT")throw new j(`skill extraction requires the \`${e}\` command, but it was not found on PATH`);throw n}}function Kne(e){let t,n=!1;for(let r of e.split(`
`)){let o=r.trim().split("/").filter((i)=>i!==""&&i!==".");if(o.length===0)continue;let s=o[0];if(t===void 0)t=s;else if(s!==t)return"";if(o.length>1)n=!0}return t!==void 0&&n?t:""}async function Cv(e,t){let n=an.join(t,`.skill-archive-${process.pid}-${Date.now()}`);if(!e.body)throw new j("skill download response had no body");await $ne(zne.fromWeb(e.body),oN.createWriteStream(n));let r=an.join(an.dirname(t),`.skill-stage-${process.pid}-${Date.now()}`);try{let o=await Gne(n,4),s=o.length>=4&&o[0]===80&&o[1]===75&&o[2]===3&&o[3]===4,i=s?"unzip":"tar",a=await Tv(i,s?["-Z1",n]:["-tf",n]);Hne(a),Bne(await Tv(i,s?["-Z",n]:["-tvf",n]));let c=Kne(a);await Fn.mkdir(r,{recursive:!0,mode:Ld}),await Tv(i,s?["-oq",n,"-d",r]:["-xf",n,"-C",r]);let l=c?an.join(r,c):r;for(let u of await Fn.readdir(l))await Fn.rename(an.join(l,u),an.join(t,u))}finally{await Fn.rm(n,{force:!0}),await Fn.rm(r,{recursive:!0,force:!0})}}async function Gne(e,t){let n=await Fn.open(e,"r");try{let r=Buffer.alloc(t),{bytesRead:o}=await n.read(r,0,t,0);return r.subarray(0,o)}finally{await n.close()}}var jne;var iN=O(()=>{dt();To();Av();jne=Fne(Une)});var bN={};Xt(bN,{BashSession:()=>Pv,betaAgentToolset20260401:()=>Jne,betaBashTool:()=>fN,betaEditTool:()=>gN,betaGlobTool:()=>_N,betaGrepTool:()=>yN,betaReadTool:()=>mN,betaWriteTool:()=>hN,extractSkillArchive:()=>Cv,resolvePath:()=>bc,resolveSkillVersion:()=>kv,setupSkills:()=>sN});import*as Vt from"node:fs/promises";import*as Uh from"node:fs";import*as xt from"node:path";import*as Ov from"node:child_process";import*as lN from"node:crypto";import*as uN from"node:readline";function pN(e){return e===void 0?Wne:e}function Jne(e){return[fN(e),mN(e),hN(e),gN(e),_N(e),yN(e)]}function bc(e,t){return rN(e.workdir,t,{allowOutside:e.unrestrictedPaths??!1})}function Xne(){let e={};for(let[t,n]of Object.entries(process.env)){if(t.startsWith("ANTHROPIC_"))continue;e[t]=n}return e}class Pv{constructor(e,t=Xne()){Nh.add(this),Tn.set(this,void 0),zn.set(this,""),Nd.set(this,!1),$i.set(this,!1),Cr.set(this,null),L(this,Tn,Ov.spawn("/bin/bash",["--noprofile","--norc"],{cwd:e,env:{...t,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),E(this,Tn,"f").stdout.setEncoding("utf8"),E(this,Tn,"f").stderr.setEncoding("utf8"),E(this,Tn,"f").stdout.on("data",(n)=>E(this,Nh,"m",Rv).call(this,n)),E(this,Tn,"f").stderr.on("data",(n)=>E(this,Nh,"m",Rv).call(this,n)),E(this,Tn,"f").once("close",()=>{L(this,$i,!0,"f");let n=E(this,Cr,"f");L(this,Cr,null,"f"),n?.resolve()})}get closed(){return E(this,$i,"f")}async exec(e,t={}){if(E(this,$i,"f"))throw new j("bash session terminated");let n=t.timeoutMs??dN,r=t.signal;if(r?.aborted)throw new j("bash command aborted");L(this,zn,"","f"),L(this,Nd,!1,"f");let o=`__ANT_CMD_${lN.randomUUID()}_DONE__`,s=`${o.slice(0,8)}''${o.slice(8)}`,i=`{ ${e}
} </dev/null 2>&1; printf '\\n${s}%d\\n' $?
`;if(E(this,Tn,"f").stdin.write(i),E(this,zn,"f").indexOf(o)<0){let{promise:f,resolve:m}=yc();L(this,Cr,{sentinel:o,resolve:m},"f");let h,_;try{await Promise.race([f,new Promise((y,S)=>{h=setTimeout(()=>S(new j(`bash command timed out after ${n}ms`)),n)}),new Promise((y,S)=>{if(!r)return;_=()=>S(new j("bash command aborted")),r.addEventListener("abort",_,{once:!0})})])}finally{if(h)clearTimeout(h);if(_&&r)r.removeEventListener("abort",_);L(this,Cr,null,"f")}}let a=E(this,zn,"f").indexOf(o);if(a<0)throw new j("bash session terminated");let l=E(this,zn,"f").slice(a+o.length).match(/^(-?\d+)/),u=l?parseInt(l[1],10):-1,p=E(this,zn,"f").slice(0,a).replace(Zne,"").replace(/\n+$/,"");if(E(this,Nd,"f"))p=`[output truncated]
${p}`;return{output:p,exitCode:u}}close(){if(E(this,$i,"f"))return;L(this,$i,!0,"f");let e=E(this,Cr,"f");L(this,Cr,null,"f"),e?.resolve(),E(this,Tn,"f").stdout.destroy(),E(this,Tn,"f").stderr.destroy(),E(this,Tn,"f").stdin.destroy();try{process.kill(-E(this,Tn,"f").pid,"SIGKILL")}catch{E(this,Tn,"f").kill("SIGKILL")}E(this,Tn,"f").unref()}}function fN(e){let t,n=Promise.resolve();return zi({name:"bash",description:"Run a bash command in a persistent shell. State (cwd, env vars) persists across calls.",inputSchema:{type:"object",properties:{command:{type:"string",description:"The command to run"},restart:{type:"boolean",description:"Restart the persistent shell before running"},timeout_ms:{type:"integer",description:"Per-call timeout in milliseconds"}}},run:async({command:r,restart:o,timeout_ms:s},i)=>{let a=n,c=yc();n=c.promise;try{await a}catch{}try{if(o)t?.close(),t=void 0;if(!r){if(o)return"bash session restarted";throw new be("bash: command is required")}t??(t=new Pv(e.workdir,e.env));try{let{output:l,exitCode:u}=await t.exec(r,{timeoutMs:s??dN,signal:i?.signal});if(u!==0)throw new be(l||`exit ${u}`);return l}catch(l){if(l instanceof be)throw l;throw t.close(),t=void 0,new be(`bash: ${l instanceof Error?l.message:String(l)}`)}}finally{c.resolve()}},close:()=>{t?.close(),t=void 0}})}function mN(e){return zi({name:"read",description:"Read a UTF-8 text file relative to the workdir.",inputSchema:{type:"object",properties:{file_path:{type:"string"},view_range:{type:"array",items:{type:"integer"},description:"[start_line, end_line] 1-indexed inclusive"}},required:["file_path"]},run:async({file_path:t,view_range:n})=>{if(!t)throw new be("read: file_path is required");let r=await bc(e,t),o;try{let u=await Vt.stat(r);if(!u.isFile())throw new be(`read: ${t} is not a regular file`);let p=pN(e.maxFileBytes);if(p!==null&&u.size>p)throw new be(`read: ${t} is ${u.size} bytes, exceeds ${p}-byte limit. Use bash (head/tail/sed) to read a slice.`);o=await Vt.readFile(r,"utf8")}catch(u){if(u instanceof be)throw u;throw new be(`read: ${Md(u,t)}`)}if(!n)return o;if(n.length!==2)throw new be("read: view_range must be [start_line, end_line]");let[s,i]=n,a=o.split(`
`),c=Math.max(0,s-1),l=i>0?i:a.length;return a.slice(c,l).join(`
`)}})}function hN(e){return zi({name:"write",description:"Write a UTF-8 text file relative to the workdir, creating parent directories as needed.",inputSchema:{type:"object",properties:{file_path:{type:"string"},content:{type:"string"}},required:["file_path","content"]},run:async({file_path:t,content:n})=>{if(!t)throw new be("write: file_path is required");let r=await bc(e,t);try{await Vt.mkdir(xt.dirname(r),{recursive:!0,mode:Ld}),await wv(r,n??"")}catch(o){throw new be(`write: ${Md(o,t)}`)}return`wrote ${Buffer.byteLength(n??"")} bytes to ${t}`}})}function gN(e){return zi({name:"edit",description:"Replace old_string with new_string in a file. old_string must be unique unless replace_all.",inputSchema:{type:"object",properties:{file_path:{type:"string"},old_string:{type:"string"},new_string:{type:"string"},replace_all:{type:"boolean"}},required:["file_path","old_string","new_string"]},run:async({file_path:t,old_string:n,new_string:r,replace_all:o})=>{if(!t)throw new be("edit: file_path is required");if(!n)throw new be("edit: old_string is required");let s=await bc(e,t),i;try{let l=await Vt.stat(s);if(!l.isFile())throw new be(`edit: ${t} is not a regular file`);let u=pN(e.maxFileBytes);if(u!==null&&l.size>u)throw new be(`edit: ${t} is ${l.size} bytes, exceeds ${u}-byte limit. Use bash (sed/awk) to edit a large file.`);i=await Vt.readFile(s,"utf8")}catch(l){if(l instanceof be)throw l;throw new be(`edit: ${Md(l,t)}`)}let a=i.split(n).length-1;if(a===0)throw new be(`edit: old_string not found in ${t}`);let c;if(o)c=i.split(n).join(r);else{if(a>1)throw new be(`edit: old_string appears ${a} times in ${t} (must be unique)`);c=i.replace(n,()=>r)}try{await wv(s,c)}catch(l){throw new be(`edit: write: ${Md(l,t)}`)}return`edited ${t} (${o?a:1} replacement(s))`}})}function _N(e){return zi({name:"glob",description:"Match files under the workdir against a glob pattern. Results are mtime-sorted, newest first.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string",description:"Directory to search in. Defaults to the workdir."}},required:["pattern"]},run:async({pattern:t,path:n})=>{if(!t)throw new be("glob: pattern is required");let r=xt.resolve(e.workdir),o=t;if(xt.isAbsolute(t)){if(!e.unrestrictedPaths)throw new be("glob: absolute pattern not permitted");r=xt.parse(t).root,o=xt.relative(r,t)}else if(n)r=await bc(e,n);if(!e.unrestrictedPaths&&o.split(/[\\/]/).includes(".."))throw new be('glob: ".." is not permitted in the pattern');let s=e.unrestrictedPaths?r:await Vt.realpath(r).catch(()=>r),i=[];try{for await(let a of Yne(o,{cwd:r,withFileTypes:!0,exclude:(c)=>c.name===".git"||c.name==="node_modules"})){if(!a.isFile())continue;let c=xt.join(a.parentPath,a.name);if(!e.unrestrictedPaths){let u;try{u=await Vt.realpath(c)}catch{continue}if(!tre(s,u))continue}let l=0;try{l=(await Vt.stat(c)).mtimeMs}catch{}i.push({path:c,mtime:l})}}catch(a){throw new be(`glob: ${a instanceof Error?a.message:String(a)}`)}if(i.length===0)return"no matches";return i.sort((a,c)=>c.mtime-a.mtime),i.slice(0,Vne).map((a)=>a.path).join(`
`)}})}function yN(e){return zi({name:"grep",description:"Search file contents for a regex. Uses ripgrep if available, otherwise a built-in walker.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string"}},required:["pattern"]},run:async({pattern:t,path:n},r)=>{if(!t)throw new be("grep: pattern is required");let o=xt.resolve(e.workdir);if(n)o=await bc(e,n);let s=await sre();return s?Qne(s,t,o,r?.signal):ere(t,o,r?.signal)}})}function Qne(e,t,n,r){return new Promise((o,s)=>{let i=Ov.spawn(e,["-n","--no-heading","-e",t,"--",n],{...r?{signal:r}:{}}),a="",c="",l=!1;i.stdout.on("data",(u)=>{if(l)return;if(a+=u,a.length>Ud)l=!0,a=a.slice(0,Ud),i.kill("SIGKILL")}),i.stderr.on("data",(u)=>c+=u),i.on("close",(u)=>{if(r?.aborted)return s(new be("grep: aborted"));if(l)return o(a+`
[output truncated at ${Ud} bytes]`);if(u===0)return o(a);if(u===1)return o("no matches");s(new be(`grep: rg failed: ${c||`exit ${u}`}`))}),i.on("error",(u)=>{if(r?.aborted)return s(new be("grep: aborted"));s(new be(`grep: rg failed: ${u.message}`))})})}async function ere(e,t,n){let r;try{r=new RegExp(e)}catch(c){throw new be(`grep: invalid regex: ${c instanceof Error?c.message:String(c)}`)}let o=[],s=Ud,i=(c)=>{if(s-=c.length+1,s<0)return o.push(`[output truncated at ${Ud} bytes]`),!1;return o.push(c),!0};if((await Vt.stat(t).catch(()=>null))?.isFile())await cN(t,r,i);else await ore(t,"",(c)=>cN(xt.join(t,c),r,i),n);if(n?.aborted)throw new be("grep: aborted");if(o.length===0)return"no matches";return o.join(`
`)}async function cN(e,t,n){let r=Uh.createReadStream(e,{encoding:"utf8"}),o=uN.createInterface({input:r,crlfDelay:1/0}),s=0;try{for await(let i of o){if(s++,i.length>qne)continue;if(t.test(i)&&!n(`${e}:${s}:${i}`))return!1}}catch{}finally{r.destroy()}return!0}function tre(e,t){let n=xt.relative(e,t);return n===""||!n.startsWith(".."+xt.sep)&&n!==".."&&!xt.isAbsolute(n)}async function ore(e,t,n,r){let o=rre;async function s(i,a){if(a>nre)return!0;if(r?.aborted)return!1;let c;try{c=await Vt.readdir(xt.join(e,i),{withFileTypes:!0})}catch{return!0}for(let l of c){if(l.name===".git"||l.name==="node_modules")continue;if(o--<=0)return!1;if(r?.aborted)return!1;let u=i?xt.join(i,l.name):l.name;if(l.isDirectory()){if(!await s(u,a+1))return!1}else if(l.isFile()){if(await n(u)===!1)return!1}}return!0}await s(t,0)}async function sre(){let e=(process.env.PATH??"").split(xt.delimiter);for(let t of e){let n=xt.join(t,"rg");try{return await Vt.access(n,Uh.constants.X_OK),n}catch{}}return null}var Nh,Tn,zn,Nd,$i,Cr,Rv,aN=102400,dN=120000,Wne=262144,Ud=102400,qne=2000,Vne=200,Zne,Yne,nre=40,rre=50000;var SN=O(()=>{Nn();dt();Ni();nN();Av();iN();Zne=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,Yne=Vt.glob;Tn=new WeakMap,zn=new WeakMap,Nd=new WeakMap,$i=new WeakMap,Cr=new WeakMap,Nh=new WeakSet,Rv=function(t){if(L(this,zn,E(this,zn,"f")+t,"f"),E(this,zn,"f").length>aN)L(this,zn,E(this,zn,"f").slice(E(this,zn,"f").length-aN),"f"),L(this,Nd,!0,"f");if(E(this,Cr,"f")&&E(this,zn,"f").indexOf(E(this,Cr,"f").sentinel)>=0){let n=E(this,Cr,"f");L(this,Cr,null,"f"),n.resolve()}}});class zd{constructor(e){Fh.add(this),Fd.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.tools=e.tools,this.workdir=e.workdir??process.cwd(),this.unrestrictedPaths=e.unrestrictedPaths,this.maxFileBytes=e.maxFileBytes,this.maxIdleMs=e.maxIdleMs,this.workerId=e.workerId,this.requestOptions=e.requestOptions,L(this,Fd,e.signal,"f")}async run(e){let{environmentId:t,environmentKey:n}=this;if(t===void 0||n===void 0)throw new j("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work");let r=e??E(this,Fd,"f"),o=new Mi({client:this.client,environmentId:t,environmentKey:n,...this.workerId!==void 0?{workerId:this.workerId}:{},...r?{signal:r}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},autoStop:!1});for await(let s of o)await E(this,Fh,"m",Iv).call(this,s,n,o.signal)}async handleItem(e){let t=e?.workId??Pe("ANTHROPIC_WORK_ID"),n=e?.environmentId??Pe("ANTHROPIC_ENVIRONMENT_ID"),r=e?.sessionId??Pe("ANTHROPIC_SESSION_ID"),o=e?.environmentKey??this.environmentKey??Pe("ANTHROPIC_ENVIRONMENT_KEY");if(!t)throw new j("handleItem: workId is required — pass it or set ANTHROPIC_WORK_ID");if(!n)throw new j("handleItem: environmentId is required — pass it or set ANTHROPIC_ENVIRONMENT_ID");if(!r)throw new j("handleItem: sessionId is required — pass it or set ANTHROPIC_SESSION_ID");if(!o)throw new j("handleItem: environmentKey is required — pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY");let s={id:t,environment_id:n,data:{type:"session",id:r}};await E(this,Fh,"m",Iv).call(this,s,o,e?.signal??E(this,Fd,"f"))}}async function are(e,t,n,r){try{await e.beta.environments.work.stop(t.id,{environment_id:t.environment_id,force:!0},{...r,headers:C([r?.headers])})}catch(o){if(!Rs(o,409))n.error("force-stop on exit failed",{work_id:t.id,error:String(o)})}}async function cre(e,t,n,r,o){let s=EN,i=ire,a=async()=>{try{let c=await e.beta.environments.work.heartbeat(t.id,{environment_id:t.environment_id,expected_last_heartbeat:i},{...o,headers:C([o?.headers]),signal:n.signal});if(i=c.last_heartbeat,c.ttl_seconds>0)s=Math.max(1000,Math.min(c.ttl_seconds*1000/2,EN));if(c.state==="stopping"||c.state==="stopped")r.info("heartbeat signals shutdown",{work_id:t.id,state:c.state}),n.abort();if(!c.lease_extended)r.warn("lease not extended, shutting down",{work_id:t.id}),n.abort()}catch(c){if(n.signal.throwIfAborted(),Os(c))throw r.error("permanent heartbeat failure",{work_id:t.id,error:String(c)}),n.abort(),c;r.warn("transient heartbeat failure",{work_id:t.id,error:String(c)})}};await a();while(!n.signal.aborted)await qr(s,n.signal),n.signal.throwIfAborted(),await a()}var Fh,Fd,Iv,EN=30000,ire="NO_HEARTBEAT";var Dv=O(()=>{Nn();dt();To();Cd();Ie();Mh();kh();yv();Fd=new WeakMap,Fh=new WeakSet,Iv=async function(t,n,r){let o=je(this.client),s=xh(this.client,{authToken:n,helper:"environments-worker"}),i=t.data.id,a={workdir:this.workdir,client:this.client,sessionId:i,...this.unrestrictedPaths!==void 0?{unrestrictedPaths:this.unrestrictedPaths}:{},...this.maxFileBytes!==void 0?{maxFileBytes:this.maxFileBytes}:{}},c=await Promise.resolve().then(() => (SN(),bN)),l=async()=>{};try{l=await c.setupSkills(a)}catch(h){o.warn("skill setup failed",{session_id:i,work_id:t.id,error:String(h)})}let u=typeof this.tools==="function"?this.tools(a):this.tools??c.betaAgentToolset20260401(a),p=new AbortController,f=Li(r,p),m=cre(s,t,p,o,this.requestOptions).catch((h)=>{if(!p.signal.aborted)o.error("heartbeat loop failed",{work_id:t.id,error:String(h)});p.abort()});try{let h=new Fi(i,{client:s,tools:u,...this.maxIdleMs!==void 0?{maxIdleMs:this.maxIdleMs}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},signal:p.signal});for await(let _ of h);}finally{p.abort(),f(),await m,await l().catch((h)=>{o.warn("skill cleanup failed",{session_id:i,work_id:t.id,error:String(h)})}),await are(s,t,o,this.requestOptions)}}});var ji;var Lv=O(()=>{Je();Ie();st();kh();Dv();kh();Dv();ji=class ji extends te{retrieve(e,t,n){let{environment_id:r,betas:o}=t;return this._client.get(N`/v1/environments/${r}/work/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,t,n){let{environment_id:r,betas:o,...s}=t;return this._client.post(N`/v1/environments/${r}/work/${e}?beta=true`,{body:s,...n,headers:C([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,t={},n){let{betas:r,...o}=t??{};return this._client.getAPIList(N`/v1/environments/${e}/work?beta=true`,Ee,{query:o,...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}ack(e,t,n){let{environment_id:r,betas:o}=t;return this._client.post(N`/v1/environments/${r}/work/${e}/ack?beta=true`,{...n,headers:C([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}heartbeat(e,t,n){let{environment_id:r,desired_ttl_seconds:o,expected_last_heartbeat:s,betas:i}=t;return this._client.post(N`/v1/environments/${r}/work/${e}/heartbeat?beta=true`,{query:{desired_ttl_seconds:o,expected_last_heartbeat:s},...n,headers:C([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}poll(e,t={},n){let{betas:r,"Anthropic-Worker-ID":o,...s}=t??{};return this._client.get(N`/v1/environments/${e}/work/poll?beta=true`,{query:s,...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString(),...o!=null?{"Anthropic-Worker-ID":o}:void 0},n?.headers])})}stats(e,t={},n){let{betas:r}=t??{};return this._client.get(N`/v1/environments/${e}/work/stats?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stop(e,t,n){let{environment_id:r,betas:o,...s}=t;return this._client.post(N`/v1/environments/${r}/work/${e}/stop?beta=true`,{body:s,...n,headers:C([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}poller(e){return new Mi({...e,client:this._client})}worker(e){return new zd({...e,client:this._client})}};ji.WorkPoller=Mi;ji.EnvironmentWorker=zd});var Sc;var Mv=O(()=>{Lv();Lv();Je();Ie();st();Sc=class Sc extends te{constructor(){super(...arguments);this.work=new ji(this._client)}create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/environments?beta=true",{body:r,...t,headers:C([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(N`/v1/environments/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,t,n){let{betas:r,...o}=t;return this._client.post(N`/v1/environments/${e}?beta=true`,{body:o,...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/environments?beta=true",Ee,{query:r,...t,headers:C([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(N`/v1/environments/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,t={},n){let{betas:r}=t??{};return this._client.post(N`/v1/environments/${e}/archive?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Sc.Work=ji});var $d;var Nv=O(()=>{Je();Ie();st();$d=class $d extends te{create(e,t,n){let{view:r,betas:o,...s}=t;return this._client.post(N`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:r},body:s,...n,headers:C([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}retrieve(e,t,n){let{memory_store_id:r,betas:o,...s}=t;return this._client.get(N`/v1/memory_stores/${r}/memories/${e}?beta=true`,{query:s,...n,headers:C([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}update(e,t,n){let{memory_store_id:r,view:o,betas:s,...i}=t;return this._client.post(N`/v1/memory_stores/${r}/memories/${e}?beta=true`,{query:{view:o},body:i,...n,headers:C([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}list(e,t={},n){let{betas:r,...o}=t??{};return this._client.getAPIList(N`/v1/memory_stores/${e}/memories?beta=true`,Ee,{query:o,...n,headers:C([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}delete(e,t,n){let{memory_store_id:r,expected_content_sha256:o,betas:s}=t;return this._client.delete(N`/v1/memory_stores/${r}/memories/${e}?beta=true`,{query:{expected_content_sha256:o},...n,headers:C([{"anthropic-beta":[...s??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}}});var jd;var Uv=O(()=>{Je();Ie();st();jd=class jd extends te{retrieve(e,t,n){let{memory_store_id:r,betas:o,...s}=t;return this._client.get(N`/v1/memory_stores/${r}/memory_versions/${e}?beta=true`,{query:s,...n,headers:C([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}list(e,t={},n){let{betas:r,...o}=t??{};return this._client.getAPIList(N`/v1/memory_stores/${e}/memory_versions?beta=true`,Ee,{query:o,...n,headers:C([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}redact(e,t,n){let{memory_store_id:r,betas:o}=t;return this._client.post(N`/v1/memory_stores/${r}/memory_versions/${e}/redact?beta=true`,{...n,headers:C([{"anthropic-beta":[...o??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}}});var Hi;var Fv=O(()=>{Nv();Nv();Uv();Uv();Je();Ie();st();Hi=class Hi extends te{constructor(){super(...arguments);this.memories=new $d(this._client),this.memoryVersions=new jd(this._client)}create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/memory_stores?beta=true",{body:r,...t,headers:C([{"anthropic-beta":[...n??[],"agent-memory-2026-07-22"].toString()},t?.headers])})}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(N`/v1/memory_stores/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}update(e,t,n){let{betas:r,...o}=t;return this._client.post(N`/v1/memory_stores/${e}?beta=true`,{body:o,...n,headers:C([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/memory_stores?beta=true",Ee,{query:r,...t,headers:C([{"anthropic-beta":[...n??[],"agent-memory-2026-07-22"].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(N`/v1/memory_stores/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}archive(e,t={},n){let{betas:r}=t??{};return this._client.post(N`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"agent-memory-2026-07-22"].toString()},n?.headers])})}};Hi.Memories=$d;Hi.MemoryVersions=jd});var Ec=O(()=>{dt()});var xc;var zv=O(()=>{dt();Yx();xc=class xc{constructor(e,t){this.iterator=e,this.controller=t}async*decoder(){let e=new ks;for await(let t of this.iterator)for(let n of e.decode(t))yield JSON.parse(n);for(let t of e.flush())yield JSON.parse(t)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,t){if(!e.body){if(t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new j("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new j("Attempted to iterate over a response with no body")}return new xc(ad(e.body),t)}}});var Hd;var $v=O(()=>{Je();Ie();zv();Ec();st();Hd=class Hd extends te{create(e,t){let{betas:n,user_profile_id:r,...o}=e;return this._client.post("/v1/messages/batches?beta=true",{body:o,...t,headers:C([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString(),...r!=null?{"anthropic-user-profile-id":r}:void 0},t?.headers])})}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(N`/v1/messages/batches/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",Zr,{query:r,...t,headers:C([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(N`/v1/messages/batches/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,t={},n){let{betas:r}=t??{};return this._client.post(N`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},n?.headers])})}async results(e,t={},n){let r=await this.retrieve(e);if(!r.results_url)throw new j(`No batch \`results_url\`; Has it finished processing? ${r.processing_status} - ${r.id}`);let{betas:o}=t??{};return this._client.get(r.results_url,{...n,headers:C([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((s,i)=>xc.fromResponse(i.response,i.controller))}}});var zh;var jv=O(()=>{zh={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function xN(e){return e?.output_format??e?.output_config?.format}function Hv(e,t,n){let r=xN(t);if(!t||!("parse"in(r??{})))return{...e,content:e.content.map((o)=>{if(o.type==="text"){let s=Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(s,"parsed",{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return o}),parsed_output:null};return Bv(e,t,n)}function Bv(e,t,n){let r=null,o=e.content.map((s)=>{if(s.type==="text"){let i=hre(t,s.text);if(r===null)r=i;let a=Object.defineProperty({...s},"parsed_output",{value:i,enumerable:!1});return Object.defineProperty(a,"parsed",{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),i},enumerable:!1})}return s});return{...e,content:o,parsed_output:r}}function hre(e,t){let n=xN(e);if(n?.type!=="json_schema")return null;try{if("parse"in n)return n.parse(t);return JSON.parse(t)}catch(r){throw new j(`Failed to parse structured output: ${r}`)}}var Kv=O(()=>{dt()});var Gv=O(()=>{dd()});var gre=(e)=>{let t=0,n=[];while(t<e.length){let r=e[t];if(r==="\\"){t++;continue}if(r==="{"){n.push({type:"brace",value:"{"}),t++;continue}if(r==="}"){n.push({type:"brace",value:"}"}),t++;continue}if(r==="["){n.push({type:"paren",value:"["}),t++;continue}if(r==="]"){n.push({type:"paren",value:"]"}),t++;continue}if(r===":"){n.push({type:"separator",value:":"}),t++;continue}if(r===","){n.push({type:"delimiter",value:","}),t++;continue}if(r==='"'){let a="",c=!1;r=e[++t];while(r!=='"'){if(t===e.length){c=!0;break}if(r==="\\"){if(t++,t===e.length){c=!0;break}a+=r+e[t],r=e[++t]}else a+=r,r=e[++t]}if(r=e[++t],!c)n.push({type:"string",value:a});continue}if(r&&/\s/.test(r)){t++;continue}let s=/[0-9]/;if(r&&s.test(r)||r==="-"||r==="."){let a="";if(r==="-")a+=r,r=e[++t];while(r&&(s.test(r)||r==="."||r==="e"||r==="E"||(r==="-"||r==="+")&&(a[a.length-1]==="e"||a[a.length-1]==="E")))a+=r,r=e[++t];n.push({type:"number",value:a});continue}let i=/[a-z]/i;if(r&&i.test(r)){let a="";while(r&&i.test(r)){if(t===e.length)break;a+=r,r=e[++t]}if(a=="true"||a=="false"||a==="null")n.push({type:"name",value:a});else{t++;continue}continue}t++}return n},vc=(e)=>{if(e.length===0)return e;let t=e[e.length-1];switch(t.type){case"separator":return e=e.slice(0,e.length-1),vc(e);break;case"number":let n=t.value[t.value.length-1];if(n==="."||n==="-"||n==="+"||n==="e"||n==="E")return e=e.slice(0,e.length-1),vc(e);case"string":let r=e[e.length-2];if(r?.type==="delimiter")return e=e.slice(0,e.length-1),vc(e);else if(r?.type==="brace"&&r.value==="{")return e=e.slice(0,e.length-1),vc(e);break;case"delimiter":return e=e.slice(0,e.length-1),vc(e);break}return e},_re=(e)=>{let t=[];if(e.map((n)=>{if(n.type==="brace")if(n.value==="{")t.push("}");else t.splice(t.lastIndexOf("}"),1);if(n.type==="paren")if(n.value==="[")t.push("]");else t.splice(t.lastIndexOf("]"),1)}),t.length>0)t.reverse().map((n)=>{if(n==="}")e.push({type:"brace",value:"}"});else if(n==="]")e.push({type:"paren",value:"]"})});return e},yre=(e)=>{let t="";return e.map((n)=>{switch(n.type){case"string":t+='"'+n.value+'"';break;default:t+=n.value;break}}),t},vN=(e)=>JSON.parse(yre(_re(vc(gre(e)))));var wN=()=>{};function $h(e,t){let n={};for(let s of Object.keys(e))if(s!=="input")n[s]=e[s];Object.defineProperty(n,Ds,{value:t,enumerable:!1,writable:!0});let r,o=!1;return Object.defineProperty(n,"input",{enumerable:!0,configurable:!0,get(){if(!o)r=t?vN(t):{},o=!0;return r}}),n}var Ds="__json_buf";var Wv=O(()=>{wN()});function Xv(e){return e.type==="tool_use"||e.type==="server_tool_use"||e.type==="mcp_tool_use"}function kN(e){}var $n,Ls,wc,Bd,jh,Kd,Gd,Hh,Wd,Co,qd,Bh,Kh,Bi,Gh,Wh,Vd,qv,AN,Zd,Vv,Zv,Yv,TN,Jv,Yd;var CN=O(()=>{Nn();ko();Ec();Gv();Kv();Wv();Yd=class Yd{constructor(e,t){$n.add(this),this.messages=[],this.receivedMessages=[],Ls.set(this,void 0),wc.set(this,null),this.controller=new AbortController,Bd.set(this,void 0),jh.set(this,()=>{}),Kd.set(this,()=>{}),Gd.set(this,void 0),Hh.set(this,()=>{}),Wd.set(this,()=>{}),Co.set(this,{}),qd.set(this,!1),Bh.set(this,!1),Kh.set(this,!1),Bi.set(this,!1),Gh.set(this,void 0),Wh.set(this,void 0),Vd.set(this,void 0),Zd.set(this,(n)=>{if(L(this,Bh,!0,"f"),wr(n))n=new on;if(n instanceof on)return L(this,Kh,!0,"f"),this._emit("abort",n);if(n instanceof j)return this._emit("error",n);if(n instanceof Error){let r=new j(n.message);return r.cause=n,this._emit("error",r)}return this._emit("error",new j(String(n)))}),L(this,Bd,new Promise((n,r)=>{L(this,jh,n,"f"),L(this,Kd,r,"f")}),"f"),L(this,Gd,new Promise((n,r)=>{L(this,Hh,n,"f"),L(this,Wd,r,"f")}),"f"),E(this,Bd,"f").catch(()=>{}),E(this,Gd,"f").catch(()=>{}),L(this,wc,e,"f"),L(this,Vd,t?.logger??console,"f")}get response(){return E(this,Gh,"f")}get request_id(){return E(this,Wh,"f")}async withResponse(){L(this,Bi,!0,"f");let e=await E(this,Bd,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let t=new Yd(null);return t._run(()=>t._fromReadableStream(e)),t}static createMessage(e,t,n,{logger:r}={}){let o=new Yd(t,{logger:r});for(let s of t.messages)o._addMessageParam(s);return L(o,wc,{...t,stream:!0},"f"),o._run(()=>o._createMessage(e,{...t,stream:!0},{...n,headers:{...n?.headers,[bh]:"stream"}})),o}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},E(this,Zd,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,t=!0){if(this.receivedMessages.push(e),t)this._emit("message",e)}async _createMessage(e,t,n){let r=n?.signal,o;if(r){if(r.aborted)this.controller.abort();o=this.controller.abort.bind(this.controller),r.addEventListener("abort",o)}try{E(this,$n,"m",Vv).call(this);let{response:s,data:i}=await e.create({...t,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(s);for await(let a of i)E(this,$n,"m",Zv).call(this,a);if(i.controller.signal?.aborted)throw new on;E(this,$n,"m",Yv).call(this)}finally{if(r&&o)r.removeEventListener("abort",o)}}_connected(e){if(this.ended)return;L(this,Gh,e,"f"),L(this,Wh,e?.headers.get("request-id"),"f"),E(this,jh,"f").call(this,e),this._emit("connect")}get ended(){return E(this,qd,"f")}get errored(){return E(this,Bh,"f")}get aborted(){return E(this,Kh,"f")}abort(){this.controller.abort()}on(e,t){return(E(this,Co,"f")[e]||(E(this,Co,"f")[e]=[])).push({listener:t}),this}off(e,t){let n=E(this,Co,"f")[e];if(!n)return this;let r=n.findIndex((o)=>o.listener===t);if(r>=0)n.splice(r,1);return this}once(e,t){return(E(this,Co,"f")[e]||(E(this,Co,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,n)=>{if(L(this,Bi,!0,"f"),e!=="error")this.once("error",n);this.once(e,t)})}async done(){L(this,Bi,!0,"f"),await E(this,Gd,"f")}get currentMessage(){return E(this,Ls,"f")}async finalMessage(){return await this.done(),E(this,$n,"m",qv).call(this)}async finalText(){return await this.done(),E(this,$n,"m",AN).call(this)}_emit(e,...t){if(E(this,qd,"f"))return;if(e==="end")L(this,qd,!0,"f"),E(this,Hh,"f").call(this);let n=E(this,Co,"f")[e];if(n)E(this,Co,"f")[e]=n.filter((r)=>!r.once),n.forEach(({listener:r})=>r(...t));if(e==="abort"){let r=t[0];if(!E(this,Bi,"f")&&!n?.length)Promise.reject(r);E(this,Kd,"f").call(this,r),E(this,Wd,"f").call(this,r),this._emit("end");return}if(e==="error"){let r=t[0];if(!E(this,Bi,"f")&&!n?.length)Promise.reject(r);E(this,Kd,"f").call(this,r),E(this,Wd,"f").call(this,r),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",E(this,$n,"m",qv).call(this))}async _fromReadableStream(e,t){let n=t?.signal,r;if(n){if(n.aborted)this.controller.abort();r=this.controller.abort.bind(this.controller),n.addEventListener("abort",r)}try{E(this,$n,"m",Vv).call(this),this._connected(null);let o=gn.fromReadableStream(e,this.controller);for await(let s of o)E(this,$n,"m",Zv).call(this,s);if(o.controller.signal?.aborted)throw new on;E(this,$n,"m",Yv).call(this)}finally{if(n&&r)n.removeEventListener("abort",r)}}[(Ls=new WeakMap,wc=new WeakMap,Bd=new WeakMap,jh=new WeakMap,Kd=new WeakMap,Gd=new WeakMap,Hh=new WeakMap,Wd=new WeakMap,Co=new WeakMap,qd=new WeakMap,Bh=new WeakMap,Kh=new WeakMap,Bi=new WeakMap,Gh=new WeakMap,Wh=new WeakMap,Vd=new WeakMap,Zd=new WeakMap,$n=new WeakSet,qv=function(){if(this.receivedMessages.length===0)throw new j("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},AN=function(){if(this.receivedMessages.length===0)throw new j("stream ended without producing a Message with role=assistant");let t=this.receivedMessages.at(-1).content.filter((n)=>n.type==="text").map((n)=>n.text);if(t.length===0)throw new j("stream ended without producing a content block with type=text");return t.join(" ")},Vv=function(){if(this.ended)return;L(this,Ls,void 0,"f")},Zv=function(t){if(this.ended)return;let n=E(this,$n,"m",TN).call(this,t);switch(this._emit("streamEvent",t,n),t.type){case"content_block_delta":{let r=n.content.at(-1);switch(t.delta.type){case"text_delta":{if(r.type==="text")this._emit("text",t.delta.text,r.text||"");break}case"citations_delta":{if(r.type==="text")this._emit("citation",t.delta.citation,r.citations??[]);break}case"input_json_delta":{if(Xv(r)&&E(this,Co,"f").inputJson?.length){let o;try{o=r.input}catch(s){E(this,Zd,"f").call(this,E(this,$n,"m",Jv).call(this,r,s));break}this._emit("inputJson",t.delta.partial_json,o)}break}case"thinking_delta":{if(r.type==="thinking")this._emit("thinking",t.delta.thinking,r.thinking);break}case"signature_delta":{if(r.type==="thinking")this._emit("signature",r.signature);break}case"compaction_delta":{if(r.type==="compaction"&&r.content)this._emit("compaction",r.content);break}default:kN(t.delta)}break}case"message_stop":{this._addMessageParam(n),this._addMessage(Hv(n,E(this,wc,"f"),{logger:E(this,Vd,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{L(this,Ls,n,"f");break}case"content_block_start":case"message_delta":break}},Yv=function(){if(this.ended)throw new j("stream has ended, this shouldn't happen");let t=E(this,Ls,"f");if(!t)throw new j("request ended without sending any chunks");return L(this,Ls,void 0,"f"),Hv(t,E(this,wc,"f"),{logger:E(this,Vd,"f")})},TN=function(t){let n=E(this,Ls,"f");if(t.type==="message_start"){if(n)throw new j(`Unexpected event order, got ${t.type} before receiving "message_stop"`);return t.message}if(!n)throw new j(`Unexpected event order, got ${t.type} before "message_start"`);switch(t.type){case"message_stop":return n;case"message_delta":if(n.container=t.delta.container,n.stop_reason=t.delta.stop_reason,n.stop_sequence=t.delta.stop_sequence,t.delta.stop_details!=null)n.stop_details=t.delta.stop_details;if(n.usage.output_tokens=t.usage.output_tokens,n.context_management=t.context_management,t.usage.input_tokens!=null)n.usage.input_tokens=t.usage.input_tokens;if(t.usage.cache_creation_input_tokens!=null)n.usage.cache_creation_input_tokens=t.usage.cache_creation_input_tokens;if(t.usage.cache_read_input_tokens!=null)n.usage.cache_read_input_tokens=t.usage.cache_read_input_tokens;if(t.usage.server_tool_use!=null)n.usage.server_tool_use=t.usage.server_tool_use;if(t.usage.iterations!=null)n.usage.iterations=t.usage.iterations;return n;case"content_block_start":if(n.content.push(t.content_block),t.content_block.type==="fallback")n.model=t.content_block.to.model;return n;case"content_block_delta":{let r=n.content.at(t.index);switch(t.delta.type){case"text_delta":{if(r?.type==="text")n.content[t.index]={...r,text:(r.text||"")+t.delta.text};break}case"citations_delta":{if(r?.type==="text")n.content[t.index]={...r,citations:[...r.citations??[],t.delta.citation]};break}case"input_json_delta":{if(r&&Xv(r)){let o=(r[Ds]||"")+t.delta.partial_json;n.content[t.index]=$h(r,o)}break}case"thinking_delta":{if(r?.type==="thinking")n.content[t.index]={...r,thinking:r.thinking+t.delta.thinking};break}case"signature_delta":{if(r?.type==="thinking")n.content[t.index]={...r,signature:t.delta.signature};break}case"compaction_delta":{if(r?.type==="compaction")n.content[t.index]={...r,content:(r.content||"")+t.delta.content,encrypted_content:t.delta.encrypted_content};break}default:kN(t.delta)}return n}case"content_block_stop":{let r=n.content.at(t.index);if(r&&Xv(r)&&Ds in r){let o;try{o=r.input}catch(s){o={},E(this,Zd,"f").call(this,E(this,$n,"m",Jv).call(this,r,s))}Object.defineProperty(r,"input",{value:o,enumerable:!0,configurable:!0,writable:!0})}return n}}},Jv=function(t,n){let r=t[Ds];return new j(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${n}. JSON: ${r}`)},Symbol.asyncIterator)](){let e=[],t=[],n=!1;return this.on("streamEvent",(r)=>{let o=t.shift();if(o)o.resolve(r);else e.push(r)}),this.on("end",()=>{n=!0;for(let r of t)r.resolve(void 0);t.length=0}),this.on("abort",(r)=>{n=!0;for(let o of t)o.reject(r);t.length=0}),this.on("error",(r)=>{n=!0;for(let o of t)o.reject(r);t.length=0}),{next:async()=>{if(!e.length){if(n)return{value:void 0,done:!0};return new Promise((o,s)=>t.push({resolve:o,reject:s})).then((o)=>o?{value:o,done:!1}:{value:void 0,done:!0})}return{value:e.shift(),done:!1}},return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new gn(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var RN=1e5,ON=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:
1. Task Overview
The user's core request and success criteria
Any clarifications or constraints they specified
2. Current State
What has been completed so far
Files created, modified, or analyzed (with paths if relevant)
Key outputs or artifacts produced
3. Important Discoveries
Technical constraints or requirements uncovered
Decisions made and their rationale
Errors encountered and how they were resolved
What approaches were tried that didn't work (and why)
4. Next Steps
Specific actions needed to complete the task
Any blockers or open questions to resolve
Priority order if multiple steps remain
5. Context to Preserve
User preferences or style requirements
Domain-specific details that aren't obvious
Any promises made to the user
Be concise but complete—err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task.
Wrap your summary in <summary></summary> tags.`;async function bre(e,t=e.messages.at(-1),n){if(!t||t.role!=="assistant"||!t.content||typeof t.content==="string")return null;let r=t.content.filter((s)=>s.type==="tool_use");if(r.length===0)return null;return{role:"user",content:await Promise.all(r.map(async(s)=>{let i=e.tools.find((a)=>("name"in a?a.name:a.mcp_server_name)===s.name);if(!i||!("run"in i))return{type:"tool_result",tool_use_id:s.id,content:`Error: Tool '${s.name}' not found`,is_error:!0};try{let a=s.input;if("parse"in i&&i.parse)a=i.parse(a);let c=await i.run(a,{toolUse:s,toolUseBlock:s,signal:n?.signal});return{type:"tool_result",tool_use_id:s.id,content:c}}catch(a){return{type:"tool_result",tool_use_id:s.id,content:a instanceof be?a.content:`Error: ${a instanceof Error?a.message:String(a)}`,is_error:!0}}}))}}var Jd,Ac,Ki,Zt,jn,dr,Jo,Ms,Xd,PN,Qv,Qd;var ew=O(()=>{Nn();Ni();dt();Ie();ko();Qd=class Qd{constructor(e,t,n){Jd.add(this),this.client=e,Ac.set(this,!1),Ki.set(this,!1),Zt.set(this,void 0),jn.set(this,void 0),dr.set(this,void 0),Jo.set(this,void 0),Ms.set(this,void 0),Xd.set(this,0),L(this,Zt,{params:{...t,messages:structuredClone(t.messages)}},"f");let r=cv(t.tools,t.messages);if(L(this,jn,{...n,headers:C([Sd("BetaToolRunner"),r.length?{[bd]:r.join(", ")}:void 0,n?.headers])},"f"),L(this,Ms,yc(),"f"),t.compactionControl?.enabled)console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(Ac=new WeakMap,Ki=new WeakMap,Zt=new WeakMap,jn=new WeakMap,dr=new WeakMap,Jo=new WeakMap,Ms=new WeakMap,Xd=new WeakMap,Jd=new WeakSet,PN=async function(){let t=E(this,Zt,"f").params.compactionControl;if(!t||!t.enabled)return!1;let n=0;if(E(this,dr,"f")!==void 0)try{let c=await E(this,dr,"f");n=c.usage.input_tokens+(c.usage.cache_creation_input_tokens??0)+(c.usage.cache_read_input_tokens??0)+c.usage.output_tokens}catch{return!1}let r=t.contextTokenThreshold??RN;if(n<r)return!1;let o=t.model??E(this,Zt,"f").params.model,s=t.summaryPrompt??ON,i=E(this,Zt,"f").params.messages;if(i[i.length-1].role==="assistant"){let c=i[i.length-1];if(Array.isArray(c.content)){let l=c.content.filter((u)=>u.type!=="tool_use");if(l.length===0)i.pop();else c.content=l}}let a=await this.client.beta.messages.create({model:o,messages:[...i,{role:"user",content:[{type:"text",text:s}]}],max_tokens:E(this,Zt,"f").params.max_tokens},{signal:E(this,jn,"f").signal,headers:C([E(this,jn,"f").headers,Sd("compaction")])});if(a.content[0]?.type!=="text")throw new j("Expected text response for compaction");return E(this,Zt,"f").params.messages=[{role:"user",content:a.content}],!0},Symbol.asyncIterator)](){var e;if(E(this,Ac,"f"))throw new j("Cannot iterate over a consumed stream");L(this,Ac,!0,"f"),L(this,Ki,!0,"f"),L(this,Jo,void 0,"f");try{while(!0){let t;try{if(E(this,Zt,"f").params.max_iterations&&E(this,Xd,"f")>=E(this,Zt,"f").params.max_iterations)break;L(this,Ki,!1,"f"),L(this,Jo,void 0,"f"),L(this,Xd,(e=E(this,Xd,"f"),e++,e),"f"),L(this,dr,void 0,"f");let{max_iterations:n,compactionControl:r,...o}=E(this,Zt,"f").params;if(o.stream)t=this.client.beta.messages.stream({...o},E(this,jn,"f")),L(this,dr,t.finalMessage(),"f"),E(this,dr,"f").catch(()=>{}),yield t;else L(this,dr,this.client.beta.messages.create({...o,stream:!1},E(this,jn,"f")),"f"),yield E(this,dr,"f");if(!await E(this,Jd,"m",PN).call(this)){if(!E(this,Ki,"f")){let a=await E(this,dr,"f");if(E(this,Zt,"f").params.messages.push({role:a.role,content:a.content}),a.stop_reason==="refusal")break}let i=await E(this,Jd,"m",Qv).call(this,E(this,Zt,"f").params.messages.at(-1));if(i)E(this,Zt,"f").params.messages.push(i);else if(!E(this,Ki,"f"))break}}finally{if(t)t.abort()}}if(!E(this,dr,"f"))throw new j("ToolRunner concluded without a message from the server");E(this,Ms,"f").resolve(await E(this,dr,"f"))}catch(t){throw L(this,Ac,!1,"f"),E(this,Ms,"f").promise.catch(()=>{}),E(this,Ms,"f").reject(t),L(this,Ms,yc(),"f"),t}}setMessagesParams(e){if(typeof e==="function")E(this,Zt,"f").params=e(E(this,Zt,"f").params);else E(this,Zt,"f").params=e;L(this,Ki,!0,"f"),L(this,Jo,void 0,"f")}setRequestOptions(e){if(typeof e==="function")L(this,jn,e(E(this,jn,"f")),"f");else L(this,jn,{...E(this,jn,"f"),...e},"f")}async generateToolResponse(e=E(this,jn,"f").signal){let t=await E(this,dr,"f")??this.params.messages.at(-1);if(!t)return null;return E(this,Jd,"m",Qv).call(this,t,e)}done(){return E(this,Ms,"f").promise}async runUntilDone(){if(!E(this,Ac,"f"))for await(let e of this);return this.done()}get params(){return E(this,Zt,"f").params}pushMessages(...e){this.setMessagesParams((t)=>({...t,messages:[...t.messages,...e]}))}then(e,t){return this.runUntilDone().then(e,t)}};Qv=async function(t,n=E(this,jn,"f").signal){if(E(this,Jo,"f")!==void 0)return E(this,Jo,"f");return L(this,Jo,bre(E(this,Zt,"f").params,t,{...E(this,jn,"f"),signal:n}),"f"),E(this,Jo,"f")}});function DN(e){if(!e.output_format)return e;if(e.output_config?.format)throw new j("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:t,...n}=e;return{...n,output_config:{...e.output_config,format:t}}}var IN,Sre,Ns;var tw=O(()=>{Ec();$v();jv();Ie();ko();Kv();CN();ew();Ni();$v();ew();Ni();IN={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026","claude-opus-4-0":"June 15th, 2026","claude-opus-4-20250514":"June 15th, 2026","claude-sonnet-4-0":"June 15th, 2026","claude-sonnet-4-20250514":"June 15th, 2026","claude-opus-4-1":"August 5th, 2026","claude-opus-4-1-20250805":"August 5th, 2026","claude-mythos-preview":"June 30th, 2026"},Sre=["claude-mythos-preview","claude-opus-4-6"];Ns=class Ns extends te{constructor(){super(...arguments);this.batches=new Hd(this._client)}create(e,t){let n=DN(e),{betas:r,user_profile_id:o,...s}=n;if(s.model in IN)console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${IN[s.model]}
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(Sre.includes(s.model)&&s.thinking&&s.thinking.type==="enabled")console.warn(`Using Claude with ${s.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let i=this._client._options.timeout;if(!s.stream&&i==null){let c=zh[s.model]??void 0;i=this._client.calculateNonstreamingTimeout(s.max_tokens,c)}let a=Sh(s.tools,s.messages);return this._client.post("/v1/messages?beta=true",{body:s,timeout:i??600000,...t,headers:C([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0,...o!=null?{"anthropic-user-profile-id":o}:void 0},a,t?.headers]),stream:n.stream??!1})}parse(e,t){return t={...t,headers:C([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},t?.headers])},this.create(e,t).then((n)=>Bv(n,e,{logger:this._client.logger??console}))}stream(e,t){return Yd.createMessage(this,e,t)}countTokens(e,t){let n=DN(e),{betas:r,user_profile_id:o,...s}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:s,...t,headers:C([{"anthropic-beta":[...r??[],"token-counting-2024-11-01"].toString(),...o!=null?{"anthropic-user-profile-id":o}:void 0},t?.headers])})}toolRunner(e,t){return new Qd(this._client,e,t)}};Ns.Batches=Hd;Ns.BetaToolRunner=Qd;Ns.ToolError=be});var Tc;var nw=O(()=>{Je();Ie();st();Mh();Mh();Tc=class Tc extends te{list(e,t={},n){let{betas:r,...o}=t??{};return this._client.getAPIList(N`/v1/sessions/${e}/events?beta=true`,Ee,{query:o,...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}send(e,t,n){let{betas:r,...o}=t;return this._client.post(N`/v1/sessions/${e}/events?beta=true`,{body:o,...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,t={},n){let{betas:r,...o}=t??{};return this._client.get(N`/v1/sessions/${e}/events/stream?beta=true`,{query:o,...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}toolRunner(e,t){return new Fi(e,{...t,client:this._client})}};Tc.SessionToolRunner=Fi});var ep;var rw=O(()=>{Je();Ie();st();ep=class ep extends te{retrieve(e,t,n){let{session_id:r,betas:o}=t;return this._client.get(N`/v1/sessions/${r}/resources/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,t,n){let{session_id:r,betas:o,...s}=t;return this._client.post(N`/v1/sessions/${r}/resources/${e}?beta=true`,{body:s,...n,headers:C([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,t={},n){let{betas:r,...o}=t??{};return this._client.getAPIList(N`/v1/sessions/${e}/resources?beta=true`,Ee,{query:o,...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,t,n){let{session_id:r,betas:o}=t;return this._client.delete(N`/v1/sessions/${r}/resources/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}add(e,t,n){let{betas:r,...o}=t;return this._client.post(N`/v1/sessions/${e}/resources?beta=true`,{body:o,...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var tp;var ow=O(()=>{Je();Ie();st();tp=class tp extends te{list(e,t,n){let{session_id:r,betas:o,...s}=t;return this._client.getAPIList(N`/v1/sessions/${r}/threads/${e}/events?beta=true`,Ee,{query:s,...n,headers:C([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,t,n){let{session_id:r,betas:o}=t;return this._client.get(N`/v1/sessions/${r}/threads/${e}/stream?beta=true`,{...n,headers:C([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}}});var kc;var sw=O(()=>{ow();ow();Je();Ie();st();kc=class kc extends te{constructor(){super(...arguments);this.events=new tp(this._client)}retrieve(e,t,n){let{session_id:r,betas:o}=t;return this._client.get(N`/v1/sessions/${r}/threads/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,t={},n){let{betas:r,...o}=t??{};return this._client.getAPIList(N`/v1/sessions/${e}/threads?beta=true`,Ee,{query:o,...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,t,n){let{session_id:r,betas:o}=t;return this._client.post(N`/v1/sessions/${r}/threads/${e}/archive?beta=true`,{...n,headers:C([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};kc.Events=tp});var Us;var iw=O(()=>{nw();nw();rw();rw();sw();sw();Je();Ie();st();Us=class Us extends te{constructor(){super(...arguments);this.events=new Tc(this._client),this.resources=new ep(this._client),this.threads=new kc(this._client)}create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/sessions?beta=true",{body:r,...t,headers:C([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(N`/v1/sessions/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,t,n){let{betas:r,...o}=t;return this._client.post(N`/v1/sessions/${e}?beta=true`,{body:o,...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/sessions?beta=true",Qx,{query:r,...t,headers:C([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(N`/v1/sessions/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,t={},n){let{betas:r}=t??{};return this._client.post(N`/v1/sessions/${e}/archive?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Us.Events=Tc;Us.Resources=ep;Us.Threads=kc});var np;var aw=O(()=>{Je();Ie();cc();st();np=class np extends te{create(e,t,n){let{betas:r,...o}=t;return this._client.post(N`/v1/skills/${e}/versions?beta=true`,ac({body:o,...n,headers:C([{"anthropic-beta":[...r??[],"skills-2025-10-02"].toString()},n?.headers])},this._client,!1))}retrieve(e,t,n){let{skill_id:r,betas:o}=t;return this._client.get(N`/v1/skills/${r}/versions/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e,t={},n){let{betas:r,...o}=t??{};return this._client.getAPIList(N`/v1/skills/${e}/versions?beta=true`,Ee,{query:o,...n,headers:C([{"anthropic-beta":[...r??[],"skills-2025-10-02"].toString()},n?.headers])})}delete(e,t,n){let{skill_id:r,betas:o}=t;return this._client.delete(N`/v1/skills/${r}/versions/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}download(e,t,n){let{skill_id:r,betas:o}=t;return this._client.get(N`/v1/skills/${r}/versions/${e}/content?beta=true`,{...n,headers:C([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}}});var Cc;var cw=O(()=>{aw();aw();Je();Ie();cc();st();Cc=class Cc extends te{constructor(){super(...arguments);this.versions=new np(this._client)}create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/skills?beta=true",ac({body:r,...t,headers:C([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},t?.headers])},this._client,!1))}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(N`/v1/skills/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/skills?beta=true",Ee,{query:r,...t,headers:C([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(N`/v1/skills/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"skills-2025-10-02"].toString()},n?.headers])})}};Cc.Versions=np});var rp;var lw=O(()=>{Je();Ie();st();rp=class rp extends te{create(e,t,n){let{betas:r,...o}=t;return this._client.post(N`/v1/tunnels/${e}/certificates?beta=true`,{body:o,...n,headers:C([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString()},n?.headers])})}retrieve(e,t,n){let{tunnel_id:r,betas:o}=t;return this._client.get(N`/v1/tunnels/${r}/certificates/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...o??[],"mcp-tunnels-2026-06-22"].toString()},n?.headers])})}list(e,t={},n){let{betas:r,...o}=t??{};return this._client.getAPIList(N`/v1/tunnels/${e}/certificates?beta=true`,Ee,{query:o,...n,headers:C([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString()},n?.headers])})}archive(e,t,n){let{tunnel_id:r,betas:o}=t;return this._client.post(N`/v1/tunnels/${r}/certificates/${e}/archive?beta=true`,{...n,headers:C([{"anthropic-beta":[...o??[],"mcp-tunnels-2026-06-22"].toString()},n?.headers])})}}});var Rc;var uw=O(()=>{lw();lw();Je();Ie();st();Rc=class Rc extends te{constructor(){super(...arguments);this.certificates=new rp(this._client)}create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/tunnels?beta=true",{body:r,...t,headers:C([{"anthropic-beta":[...n??[],"mcp-tunnels-2026-06-22"].toString()},t?.headers])})}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(N`/v1/tunnels/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/tunnels?beta=true",Ee,{query:r,...t,headers:C([{"anthropic-beta":[...n??[],"mcp-tunnels-2026-06-22"].toString()},t?.headers])})}archive(e,t={},n){let{betas:r}=t??{};return this._client.post(N`/v1/tunnels/${e}/archive?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString()},n?.headers])})}revealToken(e,t={},n){let{betas:r}=t??{};return this._client.post(N`/v1/tunnels/${e}/reveal_token?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString()},n?.headers])})}rotateToken(e,t,n){let{betas:r,...o}=t;return this._client.post(N`/v1/tunnels/${e}/rotate_token?beta=true`,{body:o,...n,headers:C([{"anthropic-beta":[...r??[],"mcp-tunnels-2026-06-22"].toString()},n?.headers])})}};Rc.Certificates=rp});var op;var dw=O(()=>{Je();Ie();st();op=class op extends te{create(e,t,n){let{betas:r,...o}=t;return this._client.post(N`/v1/vaults/${e}/credentials?beta=true`,{body:o,...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,t,n){let{vault_id:r,betas:o}=t;return this._client.get(N`/v1/vaults/${r}/credentials/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,t,n){let{vault_id:r,betas:o,...s}=t;return this._client.post(N`/v1/vaults/${r}/credentials/${e}?beta=true`,{body:s,...n,headers:C([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,t={},n){let{betas:r,...o}=t??{};return this._client.getAPIList(N`/v1/vaults/${e}/credentials?beta=true`,Ee,{query:o,...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,t,n){let{vault_id:r,betas:o}=t;return this._client.delete(N`/v1/vaults/${r}/credentials/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,t,n){let{vault_id:r,betas:o}=t;return this._client.post(N`/v1/vaults/${r}/credentials/${e}/archive?beta=true`,{...n,headers:C([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}mcpOAuthValidate(e,t,n){let{vault_id:r,betas:o}=t;return this._client.post(N`/v1/vaults/${r}/credentials/${e}/mcp_oauth_validate?beta=true`,{...n,headers:C([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var Oc;var pw=O(()=>{dw();dw();Je();Ie();st();Oc=class Oc extends te{constructor(){super(...arguments);this.credentials=new op(this._client)}create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/vaults?beta=true",{body:r,...t,headers:C([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(N`/v1/vaults/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,t,n){let{betas:r,...o}=t;return this._client.post(N`/v1/vaults/${e}?beta=true`,{body:o,...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/vaults?beta=true",Ee,{query:r,...t,headers:C([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}delete(e,t={},n){let{betas:r}=t??{};return this._client.delete(N`/v1/vaults/${e}?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,t={},n){let{betas:r}=t??{};return this._client.post(N`/v1/vaults/${e}/archive?beta=true`,{...n,headers:C([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Oc.Credentials=op});var Mt;var fw=O(()=>{sv();sv();iv();iv();av();av();lv();lv();uv();uv();dv();dv();mv();mv();gv();gv();Mv();Mv();Fv();Fv();tw();tw();iw();iw();cw();cw();uw();uw();pw();pw();Mt=class Mt extends te{constructor(){super(...arguments);this.models=new xd(this._client),this.messages=new Ns(this._client),this.agents=new lc(this._client),this.environments=new Sc(this._client),this.sessions=new Us(this._client),this.deployments=new gd(this._client),this.deploymentRuns=new hd(this._client),this.vaults=new Oc(this._client),this.memoryStores=new Hi(this._client),this.files=new Ed(this._client),this.skills=new Cc(this._client),this.webhooks=new Td(this._client),this.userProfiles=new vd(this._client),this.dreams=new _d(this._client),this.tunnels=new Rc(this._client)}};Mt.Models=xd;Mt.Messages=Ns;Mt.Agents=lc;Mt.Environments=Sc;Mt.Sessions=Us;Mt.Deployments=gd;Mt.DeploymentRuns=hd;Mt.Vaults=Oc;Mt.MemoryStores=Hi;Mt.Files=Ed;Mt.Skills=Cc;Mt.Webhooks=Td;Mt.UserProfiles=vd;Mt.Dreams=_d;Mt.Tunnels=Rc});var Pc;var mw=O(()=>{Ie();Pc=class Pc extends te{create(e,t){let{betas:n,...r}=e;return this._client.post("/v1/complete",{body:r,timeout:this._client._options.timeout??600000,...t,headers:C([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},t?.headers]),stream:e.stream??!1})}}});function LN(e){return e?.output_config?.format}function hw(e,t,n){let r=LN(t);if(!t||!("parse"in(r??{})))return{...e,content:e.content.map((o)=>{if(o.type==="text")return Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1});return o}),parsed_output:null};return gw(e,t,n)}function gw(e,t,n){let r=null,o=e.content.map((s)=>{if(s.type==="text"){let i=Dre(t,s.text);if(r===null)r=i;return Object.defineProperty({...s},"parsed_output",{value:i,enumerable:!1})}return s});return{...e,content:o,parsed_output:r}}function Dre(e,t){let n=LN(e);if(n?.type!=="json_schema")return null;try{if("parse"in n)return n.parse(t);return JSON.parse(t)}catch(r){throw new j(`Failed to parse structured output: ${r}`)}}var _w=O(()=>{dt()});function vw(e){return e.type==="tool_use"||e.type==="server_tool_use"}function UN(e){}var Rr,Fs,Ic,sp,qh,ip,ap,Vh,cp,Ro,lp,Zh,Yh,Gi,Jh,Xh,up,yw,MN,bw,Sw,Ew,xw,NN,dp;var FN=O(()=>{Nn();ko();Ec();Gv();_w();Wv();dp=class dp{constructor(e,t){Rr.add(this),this.messages=[],this.receivedMessages=[],Fs.set(this,void 0),Ic.set(this,null),this.controller=new AbortController,sp.set(this,void 0),qh.set(this,()=>{}),ip.set(this,()=>{}),ap.set(this,void 0),Vh.set(this,()=>{}),cp.set(this,()=>{}),Ro.set(this,{}),lp.set(this,!1),Zh.set(this,!1),Yh.set(this,!1),Gi.set(this,!1),Jh.set(this,void 0),Xh.set(this,void 0),up.set(this,void 0),bw.set(this,(n)=>{if(L(this,Zh,!0,"f"),wr(n))n=new on;if(n instanceof on)return L(this,Yh,!0,"f"),this._emit("abort",n);if(n instanceof j)return this._emit("error",n);if(n instanceof Error){let r=new j(n.message);return r.cause=n,this._emit("error",r)}return this._emit("error",new j(String(n)))}),L(this,sp,new Promise((n,r)=>{L(this,qh,n,"f"),L(this,ip,r,"f")}),"f"),L(this,ap,new Promise((n,r)=>{L(this,Vh,n,"f"),L(this,cp,r,"f")}),"f"),E(this,sp,"f").catch(()=>{}),E(this,ap,"f").catch(()=>{}),L(this,Ic,e,"f"),L(this,up,t?.logger??console,"f")}get response(){return E(this,Jh,"f")}get request_id(){return E(this,Xh,"f")}async withResponse(){L(this,Gi,!0,"f");let e=await E(this,sp,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let t=new dp(null);return t._run(()=>t._fromReadableStream(e)),t}static createMessage(e,t,n,{logger:r}={}){let o=new dp(t,{logger:r});for(let s of t.messages)o._addMessageParam(s);return L(o,Ic,{...t,stream:!0},"f"),o._run(()=>o._createMessage(e,{...t,stream:!0},{...n,headers:{...n?.headers,[bh]:"stream"}})),o}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},E(this,bw,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,t=!0){if(this.receivedMessages.push(e),t)this._emit("message",e)}async _createMessage(e,t,n){let r=n?.signal,o;if(r){if(r.aborted)this.controller.abort();o=this.controller.abort.bind(this.controller),r.addEventListener("abort",o)}try{E(this,Rr,"m",Sw).call(this);let{response:s,data:i}=await e.create({...t,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(s);for await(let a of i)E(this,Rr,"m",Ew).call(this,a);if(i.controller.signal?.aborted)throw new on;E(this,Rr,"m",xw).call(this)}finally{if(r&&o)r.removeEventListener("abort",o)}}_connected(e){if(this.ended)return;L(this,Jh,e,"f"),L(this,Xh,e?.headers.get("request-id"),"f"),E(this,qh,"f").call(this,e),this._emit("connect")}get ended(){return E(this,lp,"f")}get errored(){return E(this,Zh,"f")}get aborted(){return E(this,Yh,"f")}abort(){this.controller.abort()}on(e,t){return(E(this,Ro,"f")[e]||(E(this,Ro,"f")[e]=[])).push({listener:t}),this}off(e,t){let n=E(this,Ro,"f")[e];if(!n)return this;let r=n.findIndex((o)=>o.listener===t);if(r>=0)n.splice(r,1);return this}once(e,t){return(E(this,Ro,"f")[e]||(E(this,Ro,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,n)=>{if(L(this,Gi,!0,"f"),e!=="error")this.once("error",n);this.once(e,t)})}async done(){L(this,Gi,!0,"f"),await E(this,ap,"f")}get currentMessage(){return E(this,Fs,"f")}async finalMessage(){return await this.done(),E(this,Rr,"m",yw).call(this)}async finalText(){return await this.done(),E(this,Rr,"m",MN).call(this)}_emit(e,...t){if(E(this,lp,"f"))return;if(e==="end")L(this,lp,!0,"f"),E(this,Vh,"f").call(this);let n=E(this,Ro,"f")[e];if(n)E(this,Ro,"f")[e]=n.filter((r)=>!r.once),n.forEach(({listener:r})=>r(...t));if(e==="abort"){let r=t[0];if(!E(this,Gi,"f")&&!n?.length)Promise.reject(r);E(this,ip,"f").call(this,r),E(this,cp,"f").call(this,r),this._emit("end");return}if(e==="error"){let r=t[0];if(!E(this,Gi,"f")&&!n?.length)Promise.reject(r);E(this,ip,"f").call(this,r),E(this,cp,"f").call(this,r),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",E(this,Rr,"m",yw).call(this))}async _fromReadableStream(e,t){let n=t?.signal,r;if(n){if(n.aborted)this.controller.abort();r=this.controller.abort.bind(this.controller),n.addEventListener("abort",r)}try{E(this,Rr,"m",Sw).call(this),this._connected(null);let o=gn.fromReadableStream(e,this.controller);for await(let s of o)E(this,Rr,"m",Ew).call(this,s);if(o.controller.signal?.aborted)throw new on;E(this,Rr,"m",xw).call(this)}finally{if(n&&r)n.removeEventListener("abort",r)}}[(Fs=new WeakMap,Ic=new WeakMap,sp=new WeakMap,qh=new WeakMap,ip=new WeakMap,ap=new WeakMap,Vh=new WeakMap,cp=new WeakMap,Ro=new WeakMap,lp=new WeakMap,Zh=new WeakMap,Yh=new WeakMap,Gi=new WeakMap,Jh=new WeakMap,Xh=new WeakMap,up=new WeakMap,bw=new WeakMap,Rr=new WeakSet,yw=function(){if(this.receivedMessages.length===0)throw new j("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},MN=function(){if(this.receivedMessages.length===0)throw new j("stream ended without producing a Message with role=assistant");let t=this.receivedMessages.at(-1).content.filter((n)=>n.type==="text").map((n)=>n.text);if(t.length===0)throw new j("stream ended without producing a content block with type=text");return t.join(" ")},Sw=function(){if(this.ended)return;L(this,Fs,void 0,"f")},Ew=function(t){if(this.ended)return;let n=E(this,Rr,"m",NN).call(this,t);switch(this._emit("streamEvent",t,n),t.type){case"content_block_delta":{let r=n.content.at(-1);switch(t.delta.type){case"text_delta":{if(r.type==="text")this._emit("text",t.delta.text,r.text||"");break}case"citations_delta":{if(r.type==="text")this._emit("citation",t.delta.citation,r.citations??[]);break}case"input_json_delta":{if(vw(r)&&E(this,Ro,"f").inputJson?.length)this._emit("inputJson",t.delta.partial_json,r.input);break}case"thinking_delta":{if(r.type==="thinking")this._emit("thinking",t.delta.thinking,r.thinking);break}case"signature_delta":{if(r.type==="thinking")this._emit("signature",r.signature);break}default:UN(t.delta)}break}case"message_stop":{this._addMessageParam(n),this._addMessage(hw(n,E(this,Ic,"f"),{logger:E(this,up,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{L(this,Fs,n,"f");break}case"content_block_start":case"message_delta":break}},xw=function(){if(this.ended)throw new j("stream has ended, this shouldn't happen");let t=E(this,Fs,"f");if(!t)throw new j("request ended without sending any chunks");return L(this,Fs,void 0,"f"),hw(t,E(this,Ic,"f"),{logger:E(this,up,"f")})},NN=function(t){let n=E(this,Fs,"f");if(t.type==="message_start"){if(n)throw new j(`Unexpected event order, got ${t.type} before receiving "message_stop"`);return t.message}if(!n)throw new j(`Unexpected event order, got ${t.type} before "message_start"`);switch(t.type){case"message_stop":return n;case"message_delta":if(n.stop_reason=t.delta.stop_reason,n.stop_sequence=t.delta.stop_sequence,t.delta.stop_details!=null)n.stop_details=t.delta.stop_details;if(n.usage.output_tokens=t.usage.output_tokens,t.usage.input_tokens!=null)n.usage.input_tokens=t.usage.input_tokens;if(t.usage.cache_creation_input_tokens!=null)n.usage.cache_creation_input_tokens=t.usage.cache_creation_input_tokens;if(t.usage.cache_read_input_tokens!=null)n.usage.cache_read_input_tokens=t.usage.cache_read_input_tokens;if(t.usage.server_tool_use!=null)n.usage.server_tool_use=t.usage.server_tool_use;return n;case"content_block_start":return n.content.push({...t.content_block}),n;case"content_block_delta":{let r=n.content.at(t.index);switch(t.delta.type){case"text_delta":{if(r?.type==="text")n.content[t.index]={...r,text:(r.text||"")+t.delta.text};break}case"citations_delta":{if(r?.type==="text")n.content[t.index]={...r,citations:[...r.citations??[],t.delta.citation]};break}case"input_json_delta":{if(r&&vw(r)){let o=(r[Ds]||"")+t.delta.partial_json;n.content[t.index]=$h(r,o)}break}case"thinking_delta":{if(r?.type==="thinking")n.content[t.index]={...r,thinking:r.thinking+t.delta.thinking};break}case"signature_delta":{if(r?.type==="thinking")n.content[t.index]={...r,signature:t.delta.signature};break}default:UN(t.delta)}return n}case"content_block_stop":{let r=n.content.at(t.index);if(r&&vw(r)&&Ds in r)Object.defineProperty(r,"input",{value:r.input,enumerable:!0,configurable:!0,writable:!0});return n}}},Symbol.asyncIterator)](){let e=[],t=[],n=!1;return this.on("streamEvent",(r)=>{let o=t.shift();if(o)o.resolve(r);else e.push(r)}),this.on("end",()=>{n=!0;for(let r of t)r.resolve(void 0);t.length=0}),this.on("abort",(r)=>{n=!0;for(let o of t)o.reject(r);t.length=0}),this.on("error",(r)=>{n=!0;for(let o of t)o.reject(r);t.length=0}),{next:async()=>{if(!e.length){if(n)return{value:void 0,done:!0};return new Promise((o,s)=>t.push({resolve:o,reject:s})).then((o)=>o?{value:o,done:!1}:{value:void 0,done:!0})}return{value:e.shift(),done:!1}},return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new gn(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var pp;var ww=O(()=>{Je();Ie();zv();Ec();st();pp=class pp extends te{create(e,t){let{user_profile_id:n,...r}=e;return this._client.post("/v1/messages/batches",{body:r,...t,headers:C([{...n!=null?{"anthropic-user-profile-id":n}:void 0},t?.headers])})}retrieve(e,t){return this._client.get(N`/v1/messages/batches/${e}`,t)}list(e={},t){return this._client.getAPIList("/v1/messages/batches",Zr,{query:e,...t})}delete(e,t){return this._client.delete(N`/v1/messages/batches/${e}`,t)}cancel(e,t){return this._client.post(N`/v1/messages/batches/${e}/cancel`,t)}async results(e,t){let n=await this.retrieve(e);if(!n.results_url)throw new j(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...t,headers:C([{Accept:"application/binary"},t?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((r,o)=>xc.fromResponse(o.response,o.controller))}}});var Wi,zN,Mre;var Aw=O(()=>{Ie();ko();FN();_w();ww();ww();jv();Wi=class Wi extends te{constructor(){super(...arguments);this.batches=new pp(this._client)}create(e,t){let{user_profile_id:n,...r}=e;if(r.model in zN)console.warn(`The model '${r.model}' is deprecated and will reach end-of-life on ${zN[r.model]}
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(Mre.includes(r.model)&&r.thinking&&r.thinking.type==="enabled")console.warn(`Using Claude with ${r.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let o=this._client._options.timeout;if(!r.stream&&o==null){let i=zh[r.model]??void 0;o=this._client.calculateNonstreamingTimeout(r.max_tokens,i)}let s=Sh(r.tools,r.messages);return this._client.post("/v1/messages",{body:r,timeout:o??600000,...t,headers:C([{...n!=null?{"anthropic-user-profile-id":n}:void 0},s,t?.headers]),stream:e.stream??!1})}parse(e,t){return this.create(e,t).then((n)=>gw(n,e,{logger:this._client.logger??console}))}stream(e,t){return dp.createMessage(this,e,t,{logger:this._client.logger??console})}countTokens(e,t){let{user_profile_id:n,...r}=e;return this._client.post("/v1/messages/count_tokens",{body:r,...t,headers:C([{...n!=null?{"anthropic-user-profile-id":n}:void 0},t?.headers])})}};zN={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026","claude-opus-4-0":"June 15th, 2026","claude-opus-4-20250514":"June 15th, 2026","claude-sonnet-4-0":"June 15th, 2026","claude-sonnet-4-20250514":"June 15th, 2026","claude-opus-4-1":"August 5th, 2026","claude-opus-4-1-20250805":"August 5th, 2026","claude-mythos-preview":"June 30th, 2026"},Mre=["claude-mythos-preview","claude-opus-4-6"];Wi.Batches=pp});var Dc;var Tw=O(()=>{Je();Ie();st();Dc=class Dc extends te{retrieve(e,t={},n){let{betas:r}=t??{};return this._client.get(N`/v1/models/${e}`,{...n,headers:C([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}list(e={},t){let{betas:n,...r}=e??{};return this._client.getAPIList("/v1/models",Zr,{query:r,...t,headers:C([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},t?.headers])})}}});var $N=O(()=>{fw();mw();Aw();Tw();_M()});class Rt{get credentials(){return this._authState.provider}constructor({baseURL:e=Pe("ANTHROPIC_BASE_URL"),apiKey:t,authToken:n,webhookKey:r=Pe("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...o}={}){if(kw.add(this),this._requestAuthFlags=new WeakMap,Qh.set(this,void 0),t===void 0)t=o.profile!=null?null:Pe("ANTHROPIC_API_KEY")??null;if(n===void 0)n=o.profile!=null?null:Pe("ANTHROPIC_AUTH_TOKEN")??null;if(o.profile!=null&&(o.credentials!=null||o.config!=null))throw TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let s={apiKey:t,authToken:n,webhookKey:r,...o,baseURL:e||"https://api.anthropic.com"};if(!s.dangerouslyAllowBrowser&&SL())throw new j(`It looks like you're running in a browser-like environment.
This is disabled by default, as it risks exposing your secret API credentials to attackers.
If you understand the risks and have appropriate mitigations in place,
you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
`);this.baseURL=s.baseURL,this._baseURLIsExplicit=o.__baseURLIsExplicit??!!e,this.timeout=s.timeout??Cw.DEFAULT_TIMEOUT,this.logger=s.logger??console,this.logLevel=ld,this.logLevel=ch(s.logLevel,"ClientOptions.logLevel",je(this))??ch(Pe("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",je(this))??ld,this.fetchOptions=s.fetchOptions,this.maxRetries=s.maxRetries??2,this.fetch=s.fetch??EL(),L(this,Qh,vL,"f"),this.middleware=[...s.middleware??[]];let i=Pe("ANTHROPIC_CUSTOM_HEADERS");if(i){let c={};for(let l of i.split(`
`)){let u=l.indexOf(":");if(u>=0)c[l.substring(0,u).trim()]=l.substring(u+1).trim()}s.defaultHeaders={...c,...s.defaultHeaders}}let a=o.__auth;if(delete s.__auth,delete s.__baseURLIsExplicit,this._options=s,this.apiKey=typeof t==="string"?t:null,this.authToken=n,this.webhookKey=r,a){if(this._authState=a,!this._baseURLIsExplicit&&a.baseURL)this.baseURL=a.baseURL}else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let c=s.credentials??null;if(c)this._authState.provider=c,this._authState.tokenCache=this._makeTokenCache(c);else if(s.config!=null){let l=Zx(s.config,this._credentialResolverOptions());this._authState.provider=l.provider,this._authState.tokenCache=this._makeTokenCache(l.provider),this._authState.extraHeaders=l.extraHeaders,this._applyCredentialBaseURL(l.baseURL)}else if(s.profile!=null)this._authState.resolution=this._resolveDefaultCredentials(s.profile);else this._authState.resolution=this._resolveDefaultCredentials()}}_applyCredentialBaseURL(e){if(!e)return;let t=e.replace(/\/+$/,"");if(this._authState.baseURL=t,!this._baseURLIsExplicit)this.baseURL=t}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this._credentialsFetch(),userAgent:this.getUserAgent(),onCacheWriteError:(e)=>{je(this).debug("credential cache write failed (best-effort)",e)},onSafetyWarning:(e)=>{je(this).warn(e)}}}_credentialsFetch(){return Xx(this.fetch,this.middleware,void 0,this)}_makeTokenCache(e){return new jx(e,(t)=>{je(this).debug("advisory token refresh failed; serving cached token",t)})}withOptions(e){let t="credentials"in e||"config"in e||"profile"in e,n="apiKey"in e||"authToken"in e||t,r={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,middleware:this.middleware,apiKey:this.apiKey,authToken:this.authToken,webhookKey:this.webhookKey,credentials:this.credentials,...t?{credentials:void 0,config:void 0,profile:void 0}:{},...e,__auth:n?void 0:this._authState,__baseURLIsExplicit:"baseURL"in e?!0:this._baseURLIsExplicit};return new this.constructor(r)}async _resolveDefaultCredentials(e){try{let t=await sM(this._credentialResolverOptions(),e);if(t)this._authState.provider=t.provider,this._authState.tokenCache=this._makeTokenCache(t.provider),this._authState.extraHeaders=t.extraHeaders,this._applyCredentialBaseURL(t.baseURL);else if(e!=null)throw new j(`Profile "${e}" could not be resolved (no <config_dir>/configs/${e}.json found).`)}catch(t){this._authState.error=t}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:t}){if(e.get("x-api-key")||e.get("authorization"))return;if(this._authState.error)throw this._authState.error;if(this._authState.tokenCache||this._authState.resolution)return;if(this.apiKey&&e.get("x-api-key"))return;if(t.has("x-api-key"))return;if(this.authToken&&e.get("authorization"))return;if(t.has("authorization"))return;throw Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}_authFlags(e){let t=this._requestAuthFlags.get(e);if(!t)t={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(e,t);return t}async authHeaders(e){if(this._authState.resolution)await this._authState.resolution;if(this._authState.error)return;if(this._authState.tokenCache&&this.apiKey==null){let t=await this._authState.tokenCache.getToken();return this._authFlags(e).usedTokenCache=!0,C([{Authorization:`Bearer ${t}`}])}return C([await this.apiKeyAuth(e),await this.bearerAuth(e)])}async apiKeyAuth(e){if(this.apiKey==null)return;return C([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken==null)return;return C([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return LL(e)}getUserAgent(){return`${this.constructor.name}/JS ${Ar}`}defaultIdempotencyKey(){return`stainless-node-retry-${rc()}`}makeStatusError(e,t,n,r){return kt.generate(e,t,n,r)}buildURL(e,t,n){let r=!E(this,kw,"m",jN).call(this)&&n||this.baseURL,o=mL(e)?new URL(e):new URL(r+(r.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),s=this.defaultQuery(),i=Object.fromEntries(o.searchParams);if(!Ox(s)||!Ox(i))t={...i,...s,...t};if(typeof t==="object"&&t&&!Array.isArray(t))o.search=this.stringifyQuery(t);return o.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128000>600)throw new j("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600000}async prepareOptions(e){}async prepareRequest(e,{url:t,options:n}){if(this._authState.tokenCache&&this.apiKey==null){let r=e.headers instanceof Headers?e.headers:new Headers(e.headers);for(let[s,i]of Object.entries(this._authState.extraHeaders))if(!r.has(s))r.set(s,i);if(!r.get("anthropic-beta")?.split(",").map((s)=>s.trim())?.includes(Pi))r.append("anthropic-beta",Pi);e.headers=r}}backendMiddleware(){return[]}get(e,t){return this.methodRequest("get",e,t)}post(e,t){return this.methodRequest("post",e,t)}patch(e,t){return this.methodRequest("patch",e,t)}put(e,t){return this.methodRequest("put",e,t)}delete(e,t){return this.methodRequest("delete",e,t)}methodRequest(e,t,n){return this.request(Promise.resolve(n).then((r)=>({method:e,path:t,...r})))}request(e,t=null){return new Ii(this,this.makeRequest(e,t,void 0))}async makeRequest(e,t,n){let r=await e,o=r.maxRetries??this.maxRetries;if(t==null)t=o,this._requestAuthFlags.delete(r);await this.prepareOptions(r);let{req:s,url:i,timeout:a}=await this.buildRequest(r,{retryCount:o-t}),c="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),l=n===void 0?"":`, retryOf: ${n}`,u=Date.now();if(r.signal?.aborted)throw new on;let p=new AbortController,f=await this.fetchWithTimeout(i,s,a,p,r,{requestLogID:c,retryOfRequestLogID:n}).catch(Oi),m=Date.now();if(f instanceof globalThis.Error){let y=`retrying, ${t} attempts remaining`;if(r.signal?.aborted)throw new on;let S=wr(f)||/timed? ?out/i.test(String(f)+("cause"in f?String(f.cause):"")),b=this.middleware.length>0||!!r.middleware?.length||this.backendMiddleware().length>0;if(b&&!S&&!pM(f))throw je(this).info(`[${c}] middleware error (not retryable)`),je(this).debug(`[${c}] middleware error (not retryable)`,Ao({retryOfRequestLogID:n,url:i,durationMs:m-u,message:f.message})),f;if(t)return je(this).info(`[${c}] connection ${S?"timed out":"failed"} - ${y}`),je(this).debug(`[${c}] connection ${S?"timed out":"failed"} (${y})`,Ao({retryOfRequestLogID:n,url:i,durationMs:m-u,message:f.message})),this.retryRequest(r,t,n??c);if(je(this).info(`[${c}] connection ${S?"timed out":"failed"} - error; no more retries left`),je(this).debug(`[${c}] connection ${S?"timed out":"failed"} (error; no more retries left)`,Ao({retryOfRequestLogID:n,url:i,durationMs:m-u,message:f.message})),S)throw new Zu;if(b&&!Jx(f))throw f;throw new Zo({cause:f})}let h=[...f.headers.entries()].filter(([y])=>y==="request-id").map(([y,S])=>", "+y+": "+JSON.stringify(S)).join(""),_=`[${c}${l}${h}] ${s.method} ${i} ${f.ok?"succeeded":"failed"} with status ${f.status} in ${m-u}ms`;if(!f.ok){let y=await this.shouldRetry(f,r);if(t&&y){let U=`retrying, ${t} attempts remaining`;return await xL(f.body),je(this).info(`${_} - ${U}`),je(this).debug(`[${c}] response error (${U})`,Ao({retryOfRequestLogID:n,url:f.url,status:f.status,headers:f.headers,durationMs:m-u})),this.retryRequest(r,t,n??c,f.headers)}let S=y?"error; no more retries left":"error; not retryable";je(this).info(`${_} - ${S}`);let b=await f.text().catch((U)=>Oi(U).message),x=sd(b),v=x?void 0:b;throw je(this).debug(`[${c}] response error (${S})`,Ao({retryOfRequestLogID:n,url:f.url,status:f.status,headers:f.headers,message:v,durationMs:Date.now()-u})),this.makeStatusError(f.status,x,v,f.headers)}return je(this).info(_),je(this).debug(`[${c}] response start`,Ao({retryOfRequestLogID:n,url:f.url,status:f.status,headers:f.headers,durationMs:m-u})),{response:f,options:r,controller:p,requestLogID:c,retryOfRequestLogID:n,startTime:u}}getAPIList(e,t,n){return this.requestAPIList(t,n&&"then"in n?n.then((r)=>({method:"get",path:e,...r})):{method:"get",path:e,...n})}requestAPIList(e,t){let n=this.makeRequest(t,null,void 0);return new hh(this,n,e)}async fetchWithTimeout(e,t,n,r,o,s){let{signal:i,method:a,...c}=t||{},l=this._makeAbort(r);if(i)i.addEventListener("abort",l,{once:!0});let u=globalThis.ReadableStream&&c.body instanceof globalThis.ReadableStream||typeof c.body==="object"&&c.body!==null&&Symbol.asyncIterator in c.body,p={signal:r.signal,...u?{duplex:"half"}:{},method:"GET",...c};if(a)p.method=a.toUpperCase();let f=this.fetch,m=async(b,x)=>{let v=setTimeout(l,n);try{return await f.call(void 0,b,x)}finally{clearTimeout(v)}},h=o===void 0?m:async(b,x={})=>{let v=typeof b==="string"?b:b instanceof URL?b.href:b.url;if(x.headers=x.headers instanceof Headers?x.headers:new Headers(x.headers),await this.prepareRequest(x,{url:v,options:o}),s)je(this).debug(`[${s.requestLogID}] sending request`,Ao({retryOfRequestLogID:s.retryOfRequestLogID,method:x.method,url:v,options:o,headers:x.headers}));return m(b,x)},_=o?.middleware,y=this.backendMiddleware(),S=_?.length||y.length?[...this.middleware,..._??[],...y]:this.middleware;return await Xx(h,S,o,this)(e,p)}async shouldRetry(e,t){let n=this._authFlags(t);if(e.status===401&&this._authState.tokenCache&&n.usedTokenCache&&!n.didRefreshFor401)return n.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let r=e.headers.get("x-should-retry");if(r==="true")return!0;if(r==="false")return!1;if(e.status===408)return!0;if(e.status===409)return!0;if(e.status===429)return!0;if(e.status>=500)return!0;return!1}async retryRequest(e,t,n,r){let o,s=r?.get("retry-after-ms");if(s){let a=parseFloat(s);if(!Number.isNaN(a))o=a}let i=r?.get("retry-after");if(i&&!o){let a=parseFloat(i);if(!Number.isNaN(a))o=a*1000;else o=Date.parse(i)-Date.now()}if(o===void 0){let a=e.maxRetries??this.maxRetries;o=this.calculateDefaultRetryTimeoutMillis(t,a)}return await qr(o),this.makeRequest(e,t-1,n)}calculateDefaultRetryTimeoutMillis(e,t){let o=t-e,s=Math.min(0.5*Math.pow(2,o),8),i=1-Math.random()*0.25;return s*i*1000}calculateNonstreamingTimeout(e,t){if(3600000*e/128000>600000||t!=null&&e>t)throw new j("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 600000}async buildRequest(e,{retryCount:t=0}={}){let n={...e},{method:r,path:o,query:s,defaultBaseURL:i}=n;if(this._authState.resolution)await this._authState.resolution;if(!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL)this.baseURL=this._authState.baseURL;let a=this.buildURL(o,s,i);if("timeout"in n)gL("timeout",n.timeout);n.timeout=n.timeout??this.timeout;let{bodyHeaders:c,body:l}=this.buildBody({options:n}),u=await this.buildHeaders({options:e,method:r,bodyHeaders:c,retryCount:t});return{req:{method:r,headers:u,...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&l instanceof globalThis.ReadableStream&&{duplex:"half"},...l&&{body:l},...this.fetchOptions??{},...n.fetchOptions??{}},url:a,timeout:n.timeout}}async buildHeaders({options:e,method:t,bodyHeaders:n,retryCount:r}){let o={};if(this.idempotencyHeader&&t!=="get"){if(!e.idempotencyKey)e.idempotencyKey=this.defaultIdempotencyKey();o[this.idempotencyHeader]=e.idempotencyKey}let s=C([o,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(r),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1000))}:{},...id(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(e),this._options.defaultHeaders,n,e.headers]);return this.validateHeaders(s),s.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:t}}){if(!e)return{bodyHeaders:void 0,body:void 0};let n=C([t]);if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e==="string"&&n.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream)return{bodyHeaders:void 0,body:e};else if(typeof e==="object"&&((Symbol.asyncIterator in e)||(Symbol.iterator in e)&&("next"in e)&&typeof e.next==="function"))return{bodyHeaders:void 0,body:Qm(e)};else if(typeof e==="object"&&n.values.get("content-type")==="application/x-www-form-urlencoded")return{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e)};else return E(this,Qh,"f").call(this,{body:e,headers:n})}}var kw,Cw,Qh,jN,HN="\\n\\nHuman:",BN="\\n\\nAssistant:",qi;var Rw=O(()=>{Nn();Wr();Xm();zx();dt();sc();jL();iM();fM();Je();ov();$N();ph();mw();Tw();fw();Aw();Xm();Ie();To();Wr();Cw=Rt,Qh=new WeakMap,kw=new WeakSet,jN=function(){return this.baseURL!=="https://api.anthropic.com"};Rt.Anthropic=Cw;Rt.HUMAN_PROMPT=HN;Rt.AI_PROMPT=BN;Rt.DEFAULT_TIMEOUT=600000;Rt.AnthropicError=j;Rt.APIError=kt;Rt.APIConnectionError=Zo;Rt.APIConnectionTimeoutError=Zu;Rt.APIUserAbortError=on;Rt.NotFoundError=Qu;Rt.ConflictError=ed;Rt.RateLimitError=nd;Rt.BadRequestError=Yu;Rt.AuthenticationError=Ju;Rt.InternalServerError=rd;Rt.PermissionDeniedError=Xu;Rt.UnprocessableEntityError=td;Rt.toFile=gh;qi=class qi extends Rt{constructor(){super(...arguments);this.completions=new Pc(this),this.messages=new Wi(this),this.models=new Dc(this),this.beta=new Mt(this)}};qi.Completions=Pc;qi.Messages=Wi;qi.Models=Dc;qi.Beta=Mt});var KN=O(()=>{dt();dd();Ie();ko();Wr()});var vv=O(()=>{Rw();ov();ph();KN();Rw();Je();dt()});function kp(e,t){return function(){return e.apply(t,arguments)}}function Cp(e){return e!==null&&!pl(e)&&e.constructor!==null&&!pl(e.constructor)&&Bn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}function Tpe(e){let t;if(typeof ArrayBuffer<"u"&&ArrayBuffer.isView)t=ArrayBuffer.isView(e);else t=e&&e.buffer&&Hz(e.buffer);return t}function Upe(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;return{}}function Op(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!=="object")e=[e];if(fl(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(Cp(e))return;let s=n?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length,a;for(r=0;r<i;r++)a=s[r],t.call(null,e[a],a,e)}}function Kz(e,t){if(Cp(e))return null;t=t.toLowerCase();let n=Object.keys(e),r=n.length,o;while(r-- >0)if(o=n[r],t===o.toLowerCase())return o;return null}function tT(){let{caseless:e,skipUndefined:t}=Gz(this)&&this||{},n={},r=(o,s)=>{if(s==="__proto__"||s==="constructor"||s==="prototype")return;let i=e&&Kz(n,s)||s;if(Ig(n[i])&&Ig(o))n[i]=tT(n[i],o);else if(Ig(o))n[i]=tT({},o);else if(fl(o))n[i]=o.slice();else if(!t||!pl(o))n[i]=o};for(let o=0,s=arguments.length;o<s;o++)arguments[o]&&Op(arguments[o],r);return n}function afe(e){return!!(e&&Bn(e.append)&&e[jz]==="FormData"&&e[Lg])}var Ape,Dg,Lg,jz,Mg,no=(e)=>(e=e.toLowerCase(),(t)=>Mg(t)===e),Ng=(e)=>(t)=>typeof t===e,fl,pl,Hz,kpe,Bn,Bz,Rp=(e)=>e!==null&&typeof e==="object",Cpe=(e)=>e===!0||e===!1,Ig=(e)=>{if(Mg(e)!=="object")return!1;let t=Dg(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(jz in e)&&!(Lg in e)},Rpe=(e)=>{if(!Rp(e)||Cp(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch(t){return!1}},Ope,Ppe,Ipe=(e)=>!!(e&&typeof e.uri<"u"),Dpe=(e)=>e&&typeof e.getParts<"u",Lpe,Mpe,Npe=(e)=>Rp(e)&&Bn(e.pipe),Fz,zz,Fpe=(e)=>{if(!e)return!1;if(zz&&e instanceof zz)return!0;let t=Dg(e);if(!t||t===Object.prototype)return!1;if(!Bn(e.append))return!1;let n=Mg(e);return n==="formdata"||n==="object"&&Bn(e.toString)&&e.toString()==="[object FormData]"},zpe,$pe,jpe,Hpe,Bpe,Kpe=(e)=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),ta,Gz=(e)=>!pl(e)&&e!==ta,Gpe=(e,t,n,{allOwnKeys:r}={})=>(Op(t,(o,s)=>{if(n&&Bn(o))Object.defineProperty(e,s,{value:kp(o,n),writable:!0,enumerable:!0,configurable:!0});else Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),Wpe=(e)=>{if(e.charCodeAt(0)===65279)e=e.slice(1);return e},qpe=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Vpe=(e,t,n,r)=>{let o,s,i,a={};if(t=t||{},e==null)return t;do{o=Object.getOwnPropertyNames(e),s=o.length;while(s-- >0)if(i=o[s],(!r||r(i,e,t))&&!a[i])t[i]=e[i],a[i]=!0;e=n!==!1&&Dg(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Zpe=(e,t,n)=>{if(e=String(e),n===void 0||n>e.length)n=e.length;n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},Ype=(e)=>{if(!e)return null;if(fl(e))return e;let t=e.length;if(!Bz(t))return null;let n=Array(t);while(t-- >0)n[t]=e[t];return n},Jpe,Xpe=(e,t)=>{let r=(e&&e[Lg]).call(e),o;while((o=r.next())&&!o.done){let s=o.value;t.call(e,s[0],s[1])}},Qpe=(e,t)=>{let n,r=[];while((n=e.exec(t))!==null)r.push(n);return r},efe,tfe=(e)=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),$z,nfe,Wz=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};Op(n,(o,s)=>{let i;if((i=t(o,s,e))!==!1)r[s]=i||o}),Object.defineProperties(e,r)},rfe=(e)=>{Wz(e,(t,n)=>{if(Bn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;let r=e[n];if(!Bn(r))return;if(t.enumerable=!1,"writable"in t){t.writable=!1;return}if(!t.set)t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}})},ofe=(e,t)=>{let n={},r=(o)=>{o.forEach((s)=>{n[s]=!0})};return fl(e)?r(e):r(String(e).split(t)),n},sfe=()=>{},ife=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,cfe=(e)=>{let t=[,,,,,,,,,,],n=(r,o)=>{if(Rp(r)){if(t.indexOf(r)>=0)return;if(Cp(r))return r;if(!("toJSON"in r)){t[o]=r;let s=fl(r)?[]:{};return Op(r,(i,a)=>{let c=n(i,o+1);!pl(c)&&(s[a]=c)}),t[o]=void 0,s}}return r};return n(e,0)},lfe,ufe=(e)=>e&&(Rp(e)||Bn(e))&&Bn(e.then)&&Bn(e.catch),qz,dfe,pfe=(e)=>e!=null&&Bn(e[Lg]),w;var ut=O(()=>{({toString:Ape}=Object.prototype),{getPrototypeOf:Dg}=Object,{iterator:Lg,toStringTag:jz}=Symbol,Mg=((e)=>(t)=>{let n=Ape.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),{isArray:fl}=Array,pl=Ng("undefined");Hz=no("ArrayBuffer");kpe=Ng("string"),Bn=Ng("function"),Bz=Ng("number"),Ope=no("Date"),Ppe=no("File"),Lpe=no("Blob"),Mpe=no("FileList");Fz=Upe(),zz=typeof Fz.FormData<"u"?Fz.FormData:void 0,zpe=no("URLSearchParams"),[$pe,jpe,Hpe,Bpe]=["ReadableStream","Request","Response","Headers"].map(no);ta=(()=>{if(typeof globalThis<"u")return globalThis;return typeof self<"u"?self:typeof window<"u"?window:global})();Jpe=((e)=>(t)=>e&&t instanceof e)(typeof Uint8Array<"u"&&Dg(Uint8Array)),efe=no("HTMLFormElement"),$z=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),nfe=no("RegExp");lfe=no("AsyncFunction"),qz=((e,t)=>{if(e)return setImmediate;return t?((n,r)=>(ta.addEventListener("message",({source:o,data:s})=>{if(o===ta&&s===n)r.length&&r.shift()()},!1),(o)=>{r.push(o),ta.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):(n)=>setTimeout(n)})(typeof setImmediate==="function",Bn(ta.postMessage)),dfe=typeof queueMicrotask<"u"?queueMicrotask.bind(ta):typeof process<"u"&&process.nextTick||qz,w={isArray:fl,isArrayBuffer:Hz,isBuffer:Cp,isFormData:Fpe,isArrayBufferView:Tpe,isString:kpe,isNumber:Bz,isBoolean:Cpe,isObject:Rp,isPlainObject:Ig,isEmptyObject:Rpe,isReadableStream:$pe,isRequest:jpe,isResponse:Hpe,isHeaders:Bpe,isUndefined:pl,isDate:Ope,isFile:Ppe,isReactNativeBlob:Ipe,isReactNative:Dpe,isBlob:Lpe,isRegExp:nfe,isFunction:Bn,isStream:Npe,isURLSearchParams:zpe,isTypedArray:Jpe,isFileList:Mpe,forEach:Op,merge:tT,extend:Gpe,trim:Kpe,stripBOM:Wpe,inherits:qpe,toFlatObject:Vpe,kindOf:Mg,kindOfTest:no,endsWith:Zpe,toArray:Ype,forEachEntry:Xpe,matchAll:Qpe,isHTMLForm:efe,hasOwnProperty:$z,hasOwnProp:$z,reduceDescriptors:Wz,freezeMethods:rfe,toObjectSet:ofe,toCamelCase:tfe,noop:sfe,toFiniteNumber:ife,findKey:Kz,global:ta,isContextDefined:Gz,isSpecCompliantForm:afe,toJSONObject:cfe,isAsyncFn:lfe,isThenable:ufe,setImmediate:qz,asap:dfe,isIterable:pfe}});var Sn,G;var hr=O(()=>{ut();Sn=class Sn extends Error{static from(e,t,n,r,o,s){let i=new Sn(e.message,t||e.code,n,r,o);if(i.cause=e,i.name=e.name,e.status!=null&&i.status==null)i.status=e.status;return s&&Object.assign(i,s),i}constructor(e,t,n,r,o){super(e);if(Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o)this.response=o,this.status=o.status}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:w.toJSONObject(this.config),code:this.code,status:this.status}}};Sn.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";Sn.ERR_BAD_OPTION="ERR_BAD_OPTION";Sn.ECONNABORTED="ECONNABORTED";Sn.ETIMEDOUT="ETIMEDOUT";Sn.ERR_NETWORK="ERR_NETWORK";Sn.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";Sn.ERR_DEPRECATED="ERR_DEPRECATED";Sn.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";Sn.ERR_BAD_REQUEST="ERR_BAD_REQUEST";Sn.ERR_CANCELED="ERR_CANCELED";Sn.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";Sn.ERR_INVALID_URL="ERR_INVALID_URL";Sn.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";G=Sn});var Yz=k(function(Fdt,Zz){var Vz=Ne("stream").Stream,ffe=Ne("util");Zz.exports=ro;function ro(){this.source=null,this.dataSize=0,this.maxDataSize=1048576,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}ffe.inherits(ro,Vz);ro.create=function(e,t){var n=new this;t=t||{};for(var r in t)n[r]=t[r];n.source=e;var o=e.emit;if(e.emit=function(){return n._handleEmit(arguments),o.apply(e,arguments)},e.on("error",function(){}),n.pauseStream)e.pause();return n};Object.defineProperty(ro.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}});ro.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ro.prototype.resume=function(){if(!this._released)this.release();this.source.resume()};ro.prototype.pause=function(){this.source.pause()};ro.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ro.prototype.pipe=function(){var e=Vz.prototype.pipe.apply(this,arguments);return this.resume(),e};ro.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}if(e[0]==="data")this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded();this._bufferedEvents.push(e)};ro.prototype._checkIfMaxDataSizeExceeded=function(){if(this._maxDataSizeExceeded)return;if(this.dataSize<=this.maxDataSize)return;this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",Error(e))}});var e$=k(function(zdt,Qz){var mfe=Ne("util"),Xz=Ne("stream").Stream,Jz=Yz();Qz.exports=Pt;function Pt(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2097152,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}mfe.inherits(Pt,Xz);Pt.create=function(e){var t=new this;e=e||{};for(var n in e)t[n]=e[n];return t};Pt.isStreamLike=function(e){return typeof e!=="function"&&typeof e!=="string"&&typeof e!=="boolean"&&typeof e!=="number"&&!Buffer.isBuffer(e)};Pt.prototype.append=function(e){var t=Pt.isStreamLike(e);if(t){if(!(e instanceof Jz)){var n=Jz.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=n}if(this._handleErrors(e),this.pauseStreams)e.pause()}return this._streams.push(e),this};Pt.prototype.pipe=function(e,t){return Xz.prototype.pipe.call(this,e,t),this.resume(),e};Pt.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};Pt.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!=="function"){this._pipeNext(e);return}var t=e;t(function(n){var r=Pt.isStreamLike(n);if(r)n.on("data",this._checkDataSize.bind(this)),this._handleErrors(n);this._pipeNext(n)}.bind(this))};Pt.prototype._pipeNext=function(e){this._currentStream=e;var t=Pt.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var n=e;this.write(n),this._getNext()};Pt.prototype._handleErrors=function(e){var t=this;e.on("error",function(n){t._emitError(n)})};Pt.prototype.write=function(e){this.emit("data",e)};Pt.prototype.pause=function(){if(!this.pauseStreams)return;if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function")this._currentStream.pause();this.emit("pause")};Pt.prototype.resume=function(){if(!this._released)this._released=!0,this.writable=!0,this._getNext();if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function")this._currentStream.resume();this.emit("resume")};Pt.prototype.end=function(){this._reset(),this.emit("end")};Pt.prototype.destroy=function(){this._reset(),this.emit("close")};Pt.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};Pt.prototype._checkDataSize=function(){if(this._updateDataSize(),this.dataSize<=this.maxDataSize)return;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(Error(e))};Pt.prototype._updateDataSize=function(){this.dataSize=0;var e=this;if(this._streams.forEach(function(t){if(!t.dataSize)return;e.dataSize+=t.dataSize}),this._currentStream&&this._currentStream.dataSize)this.dataSize+=this._currentStream.dataSize};Pt.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var t$=k(function($dt,hfe){hfe.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var i$=k(function(xfe){/*!
* mime-types
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/var Ug=t$(),gfe=Ne("path").extname,n$=/^\s*([^;\s]*)(?:;|\s|$)/,_fe=/^text\//i;xfe.charset=r$;xfe.charsets={lookup:r$};xfe.contentType=yfe;xfe.extension=bfe;xfe.extensions=Object.create(null);xfe.lookup=Sfe;xfe.types=Object.create(null);Efe(xfe.extensions,xfe.types);function r$(e){if(!e||typeof e!=="string")return!1;var t=n$.exec(e),n=t&&Ug[t[1].toLowerCase()];if(n&&n.charset)return n.charset;if(t&&_fe.test(t[1]))return"UTF-8";return!1}function yfe(e){if(!e||typeof e!=="string")return!1;var t=e.indexOf("/")===-1?xfe.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var n=xfe.charset(t);if(n)t+="; charset="+n.toLowerCase()}return t}function bfe(e){if(!e||typeof e!=="string")return!1;var t=n$.exec(e),n=t&&xfe.extensions[t[1].toLowerCase()];if(!n||!n.length)return!1;return n[0]}function Sfe(e){if(!e||typeof e!=="string")return!1;var t=gfe("x."+e).toLowerCase().substr(1);if(!t)return!1;return xfe.types[t]||!1}function Efe(e,t){var n=["nginx","apache",void 0,"iana"];Object.keys(Ug).forEach(function(o){var s=Ug[o],i=s.extensions;if(!i||!i.length)return;e[o]=i;for(var a=0;a<i.length;a++){var c=i[a];if(t[c]){var l=n.indexOf(Ug[t[c]].source),u=n.indexOf(s.source);if(t[c]!=="application/octet-stream"&&(l>u||l===u&&t[c].substr(0,12)==="application/"))continue}t[c]=o}})}});var c$=k(function(Hdt,a$){a$.exports=Tfe;function Tfe(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;if(t)t(e);else setTimeout(e,0)}});var oT=k(function(Bdt,u$){var l$=c$();u$.exports=kfe;function kfe(e){var t=!1;return l$(function(){t=!0}),function(r,o){if(t)e(r,o);else l$(function(){e(r,o)})}}});var sT=k(function(Kdt,d$){d$.exports=Cfe;function Cfe(e){Object.keys(e.jobs).forEach(Rfe.bind(e)),e.jobs={}}function Rfe(e){if(typeof this.jobs[e]=="function")this.jobs[e]()}});var iT=k(function(Gdt,f$){var p$=oT(),Ofe=sT();f$.exports=Pfe;function Pfe(e,t,n,r){var o=n.keyedList?n.keyedList[n.index]:n.index;n.jobs[o]=Ife(t,o,e[o],function(s,i){if(!(o in n.jobs))return;if(delete n.jobs[o],s)Ofe(n);else n.results[o]=i;r(s,n.results)})}function Ife(e,t,n,r){var o;if(e.length==2)o=e(n,p$(r));else o=e(n,t,p$(r));return o}});var aT=k(function(Wdt,m$){m$.exports=Dfe;function Dfe(e,t){var n=!Array.isArray(e),r={index:0,keyedList:n||t?Object.keys(e):null,jobs:{},results:n?{}:[],size:n?Object.keys(e).length:e.length};if(t)r.keyedList.sort(n?t:function(o,s){return t(e[o],e[s])});return r}});var cT=k(function(qdt,h$){var Lfe=sT(),Mfe=oT();h$.exports=Nfe;function Nfe(e){if(!Object.keys(this.jobs).length)return;this.index=this.size,Lfe(this),Mfe(e)(null,this.results)}});var _$=k(function(Vdt,g$){var Ufe=iT(),Ffe=aT(),zfe=cT();g$.exports=$fe;function $fe(e,t,n){var r=Ffe(e);while(r.index<(r.keyedList||e).length)Ufe(e,t,r,function(o,s){if(o){n(o,s);return}if(Object.keys(r.jobs).length===0){n(null,r.results);return}}),r.index++;return zfe.bind(r,n)}});var lT=k(function(Zdt,Fg){var y$=iT(),jfe=aT(),Hfe=cT();Fg.exports=Bfe;Fg.exports.ascending=b$;Fg.exports.descending=Kfe;function Bfe(e,t,n,r){var o=jfe(e,n);return y$(e,t,o,function s(i,a){if(i){r(i,a);return}if(o.index++,o.index<(o.keyedList||e).length){y$(e,t,o,s);return}r(null,o.results)}),Hfe.bind(o,r)}function b$(e,t){return e<t?-1:e>t?1:0}function Kfe(e,t){return-1*b$(e,t)}});var E$=k(function(Ydt,S$){var Gfe=lT();S$.exports=Wfe;function Wfe(e,t,n){return Gfe(e,t,null,n)}});var v$=k(function(Jdt,x$){x$.exports={parallel:_$(),serial:E$(),serialOrdered:lT()}});var uT=k(function(Xdt,w$){w$.exports=Object});var T$=k(function(Qdt,A$){A$.exports=Error});var C$=k(function(ept,k$){k$.exports=EvalError});var O$=k(function(tpt,R$){R$.exports=RangeError});var I$=k(function(npt,P$){P$.exports=ReferenceError});var L$=k(function(rpt,D$){D$.exports=SyntaxError});var zg=k(function(opt,M$){M$.exports=TypeError});var U$=k(function(spt,N$){N$.exports=URIError});var z$=k(function(ipt,F$){F$.exports=Math.abs});var j$=k(function(apt,$$){$$.exports=Math.floor});var B$=k(function(cpt,H$){H$.exports=Math.max});var G$=k(function(lpt,K$){K$.exports=Math.min});var q$=k(function(upt,W$){W$.exports=Math.pow});var Z$=k(function(dpt,V$){V$.exports=Math.round});var J$=k(function(ppt,Y$){Y$.exports=Number.isNaN||function(t){return t!==t}});var Q$=k(function(fpt,X$){var qfe=J$();X$.exports=function(t){if(qfe(t)||t===0)return t;return t<0?-1:1}});var tj=k(function(mpt,ej){ej.exports=Object.getOwnPropertyDescriptor});var dT=k(function(hpt,nj){var $g=tj();if($g)try{$g([],"length")}catch(e){$g=null}nj.exports=$g});var oj=k(function(gpt,rj){var jg=Object.defineProperty||!1;if(jg)try{jg({},"a",{value:1})}catch(e){jg=!1}rj.exports=jg});var pT=k(function(_pt,sj){sj.exports=function(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function")return!1;if(typeof Symbol.iterator==="symbol")return!0;var t={},n=Symbol("test"),r=Object(n);if(typeof n==="string")return!1;if(Object.prototype.toString.call(n)!=="[object Symbol]")return!1;if(Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var o=42;t[n]=o;for(var s in t)return!1;if(typeof Object.keys==="function"&&Object.keys(t).length!==0)return!1;if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var i=Object.getOwnPropertySymbols(t);if(i.length!==1||i[0]!==n)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor==="function"){var a=Object.getOwnPropertyDescriptor(t,n);if(a.value!==o||a.enumerable!==!0)return!1}return!0}});var cj=k(function(ypt,aj){var ij=typeof Symbol<"u"&&Symbol,Vfe=pT();aj.exports=function(){if(typeof ij!=="function")return!1;if(typeof Symbol!=="function")return!1;if(typeof ij("foo")!=="symbol")return!1;if(typeof Symbol("bar")!=="symbol")return!1;return Vfe()}});var fT=k(function(bpt,lj){lj.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var mT=k(function(Spt,uj){var Zfe=uT();uj.exports=Zfe.getPrototypeOf||null});var fj=k(function(Ept,pj){var Yfe="Function.prototype.bind called on incompatible ",Jfe=Object.prototype.toString,Xfe=Math.max,Qfe="[object Function]",dj=function(t,n){var r=[];for(var o=0;o<t.length;o+=1)r[o]=t[o];for(var s=0;s<n.length;s+=1)r[s+t.length]=n[s];return r},eme=function(t,n){var r=[];for(var o=n||0,s=0;o<t.length;o+=1,s+=1)r[s]=t[o];return r},tme=function(e,t){var n="";for(var r=0;r<e.length;r+=1)if(n+=e[r],r+1<e.length)n+=t;return n};pj.exports=function(t){var n=this;if(typeof n!=="function"||Jfe.apply(n)!==Qfe)throw TypeError(Yfe+n);var r=eme(arguments,1),o,s=function(){if(this instanceof o){var u=n.apply(this,dj(r,arguments));if(Object(u)===u)return u;return this}return n.apply(t,dj(r,arguments))},i=Xfe(0,n.length-r.length),a=[];for(var c=0;c<i;c++)a[c]="$"+c;if(o=Function("binder","return function ("+tme(a,",")+"){ return binder.apply(this,arguments); }")(s),n.prototype){var l=function(){};l.prototype=n.prototype,o.prototype=new l,l.prototype=null}return o}});var na=k(function(xpt,mj){var nme=fj();mj.exports=Function.prototype.bind||nme});var Hg=k(function(vpt,hj){hj.exports=Function.prototype.call});var hT=k(function(wpt,gj){gj.exports=Function.prototype.apply});var yj=k(function(Apt,_j){_j.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Sj=k(function(Tpt,bj){var rme=na(),ome=hT(),sme=Hg(),ime=yj();bj.exports=ime||rme.call(sme,ome)});var xj=k(function(kpt,Ej){var ame=na(),cme=zg(),lme=Hg(),ume=Sj();Ej.exports=function(t){if(t.length<1||typeof t[0]!=="function")throw new cme("a function is required");return ume(ame,lme,t)}});var Cj=k(function(Cpt,kj){var dme=xj(),vj=dT(),Aj;try{Aj=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!=="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var gT=!!Aj&&vj&&vj(Object.prototype,"__proto__"),Tj=Object,wj=Tj.getPrototypeOf;kj.exports=gT&&typeof gT.get==="function"?dme([gT.get]):typeof wj==="function"?function(t){return wj(t==null?t:Tj(t))}:!1});var Dj=k(function(Rpt,Ij){var Rj=fT(),Oj=mT(),Pj=Cj();Ij.exports=Rj?function(t){return Rj(t)}:Oj?function(t){if(!t||typeof t!=="object"&&typeof t!=="function")throw TypeError("getProto: not an object");return Oj(t)}:Pj?function(t){return Pj(t)}:null});var Mj=k(function(Opt,Lj){var pme=Function.prototype.call,fme=Object.prototype.hasOwnProperty,mme=na();Lj.exports=mme.call(pme,fme)});var jj=k(function(Ppt,$j){var Me,hme=uT(),gme=T$(),_me=C$(),yme=O$(),bme=I$(),_l=L$(),gl=zg(),Sme=U$(),Eme=z$(),xme=j$(),vme=B$(),wme=G$(),Ame=q$(),Tme=Z$(),kme=Q$(),Fj=Function,_T=function(e){try{return Fj('"use strict"; return ('+e+").constructor;")()}catch(t){}},Pp=dT(),Cme=oj(),yT=function(){throw new gl},Rme=Pp?function(){try{return arguments.callee,yT}catch(e){try{return Pp(arguments,"callee").get}catch(t){return yT}}}():yT,ml=cj()(),en=Dj(),Ome=mT(),Pme=fT(),zj=hT(),Ip=Hg(),hl={},Ime=typeof Uint8Array>"u"||!en?Me:en(Uint8Array),ra={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Me:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Me:ArrayBuffer,"%ArrayIteratorPrototype%":ml&&en?en([][Symbol.iterator]()):Me,"%AsyncFromSyncIteratorPrototype%":Me,"%AsyncFunction%":hl,"%AsyncGenerator%":hl,"%AsyncGeneratorFunction%":hl,"%AsyncIteratorPrototype%":hl,"%Atomics%":typeof Atomics>"u"?Me:Atomics,"%BigInt%":typeof BigInt>"u"?Me:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Me:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Me:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Me:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":gme,"%eval%":eval,"%EvalError%":_me,"%Float16Array%":typeof Float16Array>"u"?Me:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Me:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Me:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Me:FinalizationRegistry,"%Function%":Fj,"%GeneratorFunction%":hl,"%Int8Array%":typeof Int8Array>"u"?Me:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Me:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Me:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ml&&en?en(en([][Symbol.iterator]())):Me,"%JSON%":typeof JSON==="object"?JSON:Me,"%Map%":typeof Map>"u"?Me:Map,"%MapIteratorPrototype%":typeof Map>"u"||!ml||!en?Me:en(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":hme,"%Object.getOwnPropertyDescriptor%":Pp,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Me:Promise,"%Proxy%":typeof Proxy>"u"?Me:Proxy,"%RangeError%":yme,"%ReferenceError%":bme,"%Reflect%":typeof Reflect>"u"?Me:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Me:Set,"%SetIteratorPrototype%":typeof Set>"u"||!ml||!en?Me:en(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Me:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ml&&en?en(""[Symbol.iterator]()):Me,"%Symbol%":ml?Symbol:Me,"%SyntaxError%":_l,"%ThrowTypeError%":Rme,"%TypedArray%":Ime,"%TypeError%":gl,"%Uint8Array%":typeof Uint8Array>"u"?Me:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Me:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Me:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Me:Uint32Array,"%URIError%":Sme,"%WeakMap%":typeof WeakMap>"u"?Me:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Me:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Me:WeakSet,"%Function.prototype.call%":Ip,"%Function.prototype.apply%":zj,"%Object.defineProperty%":Cme,"%Object.getPrototypeOf%":Ome,"%Math.abs%":Eme,"%Math.floor%":xme,"%Math.max%":vme,"%Math.min%":wme,"%Math.pow%":Ame,"%Math.round%":Tme,"%Math.sign%":kme,"%Reflect.getPrototypeOf%":Pme};if(en)try{null.error}catch(e){bT=en(en(e)),ra["%Error.prototype%"]=bT}var bT,Dme=function e(t){var n;if(t==="%AsyncFunction%")n=_T("async function () {}");else if(t==="%GeneratorFunction%")n=_T("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=_T("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");if(r)n=r.prototype}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");if(o&&en)n=en(o.prototype)}return ra[t]=n,n},Nj={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Dp=na(),Bg=Mj(),Lme=Dp.call(Ip,Array.prototype.concat),Mme=Dp.call(zj,Array.prototype.splice),Uj=Dp.call(Ip,String.prototype.replace),Kg=Dp.call(Ip,String.prototype.slice),Nme=Dp.call(Ip,RegExp.prototype.exec),Ume=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Fme=/\\(\\)?/g,zme=function(t){var n=Kg(t,0,1),r=Kg(t,-1);if(n==="%"&&r!=="%")throw new _l("invalid intrinsic syntax, expected closing `%`");else if(r==="%"&&n!=="%")throw new _l("invalid intrinsic syntax, expected opening `%`");var o=[];return Uj(t,Ume,function(s,i,a,c){o[o.length]=a?Uj(c,Fme,"$1"):i||s}),o},$me=function(t,n){var r=t,o;if(Bg(Nj,r))o=Nj[r],r="%"+o[0]+"%";if(Bg(ra,r)){var s=ra[r];if(s===hl)s=Dme(r);if(typeof s>"u"&&!n)throw new gl("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:r,value:s}}throw new _l("intrinsic "+t+" does not exist!")};$j.exports=function(t,n){if(typeof t!=="string"||t.length===0)throw new gl("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!=="boolean")throw new gl('"allowMissing" argument must be a boolean');if(Nme(/^%?[^%]*%?$/,t)===null)throw new _l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=zme(t),o=r.length>0?r[0]:"",s=$me("%"+o+"%",n),i=s.name,a=s.value,c=!1,l=s.alias;if(l)o=l[0],Mme(r,Lme([0,1],l));for(var u=1,p=!0;u<r.length;u+=1){var f=r[u],m=Kg(f,0,1),h=Kg(f,-1);if((m==='"'||m==="'"||m==="`"||(h==='"'||h==="'"||h==="`"))&&m!==h)throw new _l("property names with quotes must have matching quotes");if(f==="constructor"||!p)c=!0;if(o+="."+f,i="%"+o+"%",Bg(ra,i))a=ra[i];else if(a!=null){if(!(f in a)){if(!n)throw new gl("base intrinsic for "+t+" exists, but the property is not available.");return}if(Pp&&u+1>=r.length){var _=Pp(a,f);if(p=!!_,p&&"get"in _&&!("originalValue"in _.get))a=_.get;else a=a[f]}else p=Bg(a,f),a=a[f];if(p&&!c)ra[i]=a}}return a}});var Bj=k(function(Ipt,Hj){var jme=pT();Hj.exports=function(){return jme()&&!!Symbol.toStringTag}});var Gj=k(function(Dpt,Kj){var Hme=Function.prototype.call,Bme=Object.prototype.hasOwnProperty,Kme=na();Kj.exports=Kme.call(Hme,Bme)});var Vj=k(function(Lpt,qj){var Gme=jj(),Wj=Gme("%Object.defineProperty%",!0),Wme=Bj()(),qme=Gj(),Vme=zg(),Gg=Wme?Symbol.toStringTag:null;qj.exports=function(t,n){var r=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof r<"u"&&typeof r!=="boolean"||typeof o<"u"&&typeof o!=="boolean")throw new Vme("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");if(Gg&&(r||!qme(t,Gg)))if(Wj)Wj(t,Gg,{configurable:!o,enumerable:!1,value:n,writable:!1});else t[Gg]=n}});var Yj=k(function(Mpt,Zj){var Zme=Function.prototype.call,Yme=Object.prototype.hasOwnProperty,Jme=na();Zj.exports=Jme.call(Zme,Yme)});var Xj=k(function(Npt,Jj){Jj.exports=function(e,t){return Object.keys(t).forEach(function(n){e[n]=e[n]||t[n]}),e}});var t1=k(function(Upt,e1){var vT=e$(),Xme=Ne("util"),ST=Ne("path"),Qme=Ne("http"),ehe=Ne("https"),the=Ne("url").parse,nhe=Ne("fs"),rhe=Ne("stream").Stream,ohe=Ne("crypto"),ET=i$(),she=v$(),ihe=Vj(),Js=Yj(),xT=Xj();function Qj(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}function Be(e){if(!(this instanceof Be))return new Be(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],vT.call(this),e=e||{};for(var t in e)this[t]=e[t]}Xme.inherits(Be,vT);Be.LINE_BREAK=`\r
`;Be.DEFAULT_CONTENT_TYPE="application/octet-stream";Be.prototype.append=function(e,t,n){if(n=n||{},typeof n==="string")n={filename:n};var r=vT.prototype.append.bind(this);if(typeof t==="number"||t==null)t=String(t);if(Array.isArray(t)){this._error(Error("Arrays are not supported."));return}var o=this._multiPartHeader(e,t,n),s=this._multiPartFooter();r(o),r(t),r(s),this._trackLength(o,t,n)};Be.prototype._trackLength=function(e,t,n){var r=0;if(n.knownLength!=null)r+=Number(n.knownLength);else if(Buffer.isBuffer(t))r=t.length;else if(typeof t==="string")r=Buffer.byteLength(t);if(this._valueLength+=r,this._overheadLength+=Buffer.byteLength(e)+Be.LINE_BREAK.length,!t||!t.path&&!(t.readable&&Js(t,"httpVersion"))&&!(t instanceof rhe))return;if(!n.knownLength)this._valuesToMeasure.push(t)};Be.prototype._lengthRetriever=function(e,t){if(Js(e,"fd"))if(e.end!=null&&e.end!=1/0&&e.start!=null)t(null,e.end+1-(e.start?e.start:0));else nhe.stat(e.path,function(n,r){if(n){t(n);return}var o=r.size-(e.start?e.start:0);t(null,o)});else if(Js(e,"httpVersion"))t(null,Number(e.headers["content-length"]));else if(Js(e,"httpModule"))e.on("response",function(n){e.pause(),t(null,Number(n.headers["content-length"]))}),e.resume();else t("Unknown stream")};Be.prototype._multiPartHeader=function(e,t,n){if(typeof n.header==="string")return n.header;var r=this._getContentDisposition(t,n),o=this._getContentType(t,n),s="",i={"Content-Disposition":["form-data",'name="'+Qj(e)+'"'].concat(r||[]),"Content-Type":[].concat(o||[])};if(typeof n.header==="object")xT(i,n.header);var a;for(var c in i)if(Js(i,c)){if(a=i[c],a==null)continue;if(!Array.isArray(a))a=[a];if(a.length)s+=c+": "+a.join("; ")+Be.LINE_BREAK}return"--"+this.getBoundary()+Be.LINE_BREAK+s+Be.LINE_BREAK};Be.prototype._getContentDisposition=function(e,t){var n;if(typeof t.filepath==="string")n=ST.normalize(t.filepath).replace(/\\/g,"/");else if(t.filename||e&&(e.name||e.path))n=ST.basename(t.filename||e&&(e.name||e.path));else if(e&&e.readable&&Js(e,"httpVersion"))n=ST.basename(e.client._httpMessage.path||"");if(n)return'filename="'+Qj(n)+'"'};Be.prototype._getContentType=function(e,t){var n=t.contentType;if(!n&&e&&e.name)n=ET.lookup(e.name);if(!n&&e&&e.path)n=ET.lookup(e.path);if(!n&&e&&e.readable&&Js(e,"httpVersion"))n=e.headers["content-type"];if(!n&&(t.filepath||t.filename))n=ET.lookup(t.filepath||t.filename);if(!n&&e&&typeof e==="object")n=Be.DEFAULT_CONTENT_TYPE;return n};Be.prototype._multiPartFooter=function(){return function(e){var t=Be.LINE_BREAK,n=this._streams.length===0;if(n)t+=this._lastBoundary();e(t)}.bind(this)};Be.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Be.LINE_BREAK};Be.prototype.getHeaders=function(e){var t,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)if(Js(e,t))n[t.toLowerCase()]=e[t];return n};Be.prototype.setBoundary=function(e){if(typeof e!=="string")throw TypeError("FormData boundary must be a string");this._boundary=e};Be.prototype.getBoundary=function(){if(!this._boundary)this._generateBoundary();return this._boundary};Be.prototype.getBuffer=function(){var e=new Buffer.alloc(0),t=this.getBoundary();for(var n=0,r=this._streams.length;n<r;n++)if(typeof this._streams[n]!=="function"){if(Buffer.isBuffer(this._streams[n]))e=Buffer.concat([e,this._streams[n]]);else e=Buffer.concat([e,Buffer.from(this._streams[n])]);if(typeof this._streams[n]!=="string"||this._streams[n].substring(2,t.length+2)!==t)e=Buffer.concat([e,Buffer.from(Be.LINE_BREAK)])}return Buffer.concat([e,Buffer.from(this._lastBoundary())])};Be.prototype._generateBoundary=function(){this._boundary="--------------------------"+ohe.randomBytes(12).toString("hex")};Be.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;if(this._streams.length)e+=this._lastBoundary().length;if(!this.hasKnownLength())this._error(Error("Cannot calculate proper length in synchronous way."));return e};Be.prototype.hasKnownLength=function(){var e=!0;if(this._valuesToMeasure.length)e=!1;return e};Be.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length)t+=this._lastBoundary().length;if(!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}she.parallel(this._valuesToMeasure,this._lengthRetriever,function(n,r){if(n){e(n);return}r.forEach(function(o){t+=o}),e(null,t)})};Be.prototype.submit=function(e,t){var n,r,o={method:"post"};if(typeof e==="string")e=the(e),r=xT({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o);else if(r=xT(e,o),!r.port)r.port=r.protocol==="https:"?443:80;if(r.headers=this.getHeaders(e.headers),r.protocol==="https:")n=ehe.request(r);else n=Qme.request(r);return this.getLength(function(s,i){if(s&&s!=="Unknown stream"){this._error(s);return}if(i)n.setHeader("Content-Length",i);if(this.pipe(n),t){var a,c=function(l,u){return n.removeListener("error",c),n.removeListener("response",a),t.call(this,l,u)};a=c.bind(this,null),n.on("error",c),n.on("response",a)}}.bind(this)),n};Be.prototype._error=function(e){if(!this.error)this.error=e,this.pause(),this.emit("error",e)};Be.prototype.toString=function(){return"[object FormData]"};ihe(Be.prototype,"FormData");e1.exports=Be});var n1,Wg;var wT=O(()=>{n1=$a(t1(),1),Wg=n1.default});function TT(e){return w.isPlainObject(e)||w.isArray(e)}function r1(e){return w.endsWith(e,"[]")?e.slice(0,-2):e}function AT(e,t,n){if(!e)return t;return e.concat(t).map(function(o,s){return o=r1(o),!n&&s?"["+o+"]":o}).join(n?".":"")}function ahe(e){return w.isArray(e)&&!e.some(TT)}function lhe(e,t,n){if(!w.isObject(e))throw TypeError("target must be an object");t=t||new(Wg||FormData),n=w.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,S){return!w.isUndefined(S[y])});let r=n.metaTokens,o=n.visitor||p,s=n.dots,i=n.indexes,a=n.Blob||typeof Blob<"u"&&Blob,c=n.maxDepth===void 0?100:n.maxDepth,l=a&&w.isSpecCompliantForm(t);if(!w.isFunction(o))throw TypeError("visitor must be a function");function u(_){if(_===null)return"";if(w.isDate(_))return _.toISOString();if(w.isBoolean(_))return _.toString();if(!l&&w.isBlob(_))throw new G("Blob is not supported. Use a Buffer instead.");if(w.isArrayBuffer(_)||w.isTypedArray(_))return l&&typeof Blob==="function"?new Blob([_]):Buffer.from(_);return _}function p(_,y,S){let b=_;if(w.isReactNative(t)&&w.isReactNativeBlob(_))return t.append(AT(S,y,s),u(_)),!1;if(_&&!S&&typeof _==="object"){if(w.endsWith(y,"{}"))y=r?y:y.slice(0,-2),_=JSON.stringify(_);else if(w.isArray(_)&&ahe(_)||(w.isFileList(_)||w.endsWith(y,"[]"))&&(b=w.toArray(_)))return y=r1(y),b.forEach(function(v,T){!(w.isUndefined(v)||v===null)&&t.append(i===!0?AT([y],T,s):i===null?y:y+"[]",u(v))}),!1}if(TT(_))return!0;return t.append(AT(S,y,s),u(_)),!1}let f=[],m=Object.assign(che,{defaultVisitor:p,convertValue:u,isVisitable:TT});function h(_,y,S=0){if(w.isUndefined(_))return;if(S>c)throw new G("Object is too deeply nested ("+S+" levels). Max depth: "+c,G.ERR_FORM_DATA_DEPTH_EXCEEDED);if(f.indexOf(_)!==-1)throw Error("Circular reference detected in "+y.join("."));f.push(_),w.forEach(_,function(x,v){if((!(w.isUndefined(x)||x===null)&&o.call(t,x,w.isString(v)?v.trim():v,y,m))===!0)h(x,y?y.concat(v):[v],S+1)}),f.pop()}if(!w.isObject(e))throw TypeError("data must be an object");return h(e),t}var che,Xs;var Lp=O(()=>{ut();hr();wT();che=w.toFlatObject(w,{},null,function(t){return/^is[A-Z]/.test(t)});Xs=lhe});function o1(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(r){return t[r]})}function s1(e,t){this._pairs=[],e&&Xs(e,this,t)}var i1,a1;var c1=O(()=>{Lp();i1=s1.prototype;i1.append=function(t,n){this._pairs.push([t,n])};i1.toString=function(t){let n=t?function(r){return t.call(this,r,o1)}:o1;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};a1=s1});function uhe(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function oa(e,t,n){if(!t)return e;let r=n&&n.encode||uhe,o=w.isFunction(n)?{serialize:n}:n,s=o&&o.serialize,i;if(s)i=s(t,o);else i=w.isURLSearchParams(t)?t.toString():new a1(t,o).toString(r);if(i){let a=e.indexOf("#");if(a!==-1)e=e.slice(0,a);e+=(e.indexOf("?")===-1?"?":"&")+i}return e}var qg=O(()=>{ut();c1()});class l1{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){if(this.handlers[e])this.handlers[e]=null}clear(){if(this.handlers)this.handlers=[]}forEach(e){w.forEach(this.handlers,function(n){if(n!==null)e(n)})}}var kT;var u1=O(()=>{ut();kT=l1});var Qs;var Mp=O(()=>{Qs={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0}});import dhe from"url";var d1;var p1=O(()=>{d1=dhe.URLSearchParams});import phe from"crypto";var CT="abcdefghijklmnopqrstuvwxyz",f1="0123456789",m1,fhe=(e=16,t=m1.ALPHA_DIGIT)=>{let n="",{length:r}=t,o=new Uint32Array(e);phe.randomFillSync(o);for(let s=0;s<e;s++)n+=t[o[s]%r];return n},h1;var g1=O(()=>{p1();wT();m1={DIGIT:f1,ALPHA:CT,ALPHA_DIGIT:CT+CT.toUpperCase()+f1},h1={isNode:!0,classes:{URLSearchParams:d1,FormData:Wg,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:m1,generateString:fhe,protocols:["http","https","file","data"]}});var PT={};Xt(PT,{hasBrowserEnv:()=>OT,hasStandardBrowserEnv:()=>mhe,hasStandardBrowserWebWorkerEnv:()=>hhe,navigator:()=>RT,origin:()=>ghe});var OT,RT,mhe,hhe,ghe;var _1=O(()=>{OT=typeof window<"u"&&typeof document<"u",RT=typeof navigator==="object"&&navigator||void 0,mhe=OT&&(!RT||["ReactNative","NativeScript","NS"].indexOf(RT.product)<0),hhe=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function")(),ghe=OT&&window.location.href||"http://localhost"});var qe;var oo=O(()=>{g1();_1();qe={...PT,...h1}});function IT(e,t){return Xs(e,new qe.classes.URLSearchParams,{visitor:function(n,r,o,s){if(qe.isNode&&w.isBuffer(n))return this.append(r,n.toString("base64")),!1;return s.defaultVisitor.apply(this,arguments)},...t})}var y1=O(()=>{ut();Lp();oo()});function _he(e){return w.matchAll(/\w+|\[(\w*)]/g,e).map((t)=>t[0]==="[]"?"":t[1]||t[0])}function yhe(e){let t={},n=Object.keys(e),r,o=n.length,s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}function bhe(e){function t(n,r,o,s){let i=n[s++];if(i==="__proto__")return!0;let a=Number.isFinite(+i),c=s>=n.length;if(i=!i&&w.isArray(o)?o.length:i,c){if(w.hasOwnProp(o,i))o[i]=w.isArray(o[i])?o[i].concat(r):[o[i],r];else o[i]=r;return!a}if(!o[i]||!w.isObject(o[i]))o[i]=[];if(t(n,r,o[i],s)&&w.isArray(o[i]))o[i]=yhe(o[i]);return!a}if(w.isFormData(e)&&w.isFunction(e.entries)){let n={};return w.forEachEntry(e,(r,o)=>{t(_he(r),o,n,0)}),n}return null}var Vg;var DT=O(()=>{ut();Vg=bhe});function She(e,t,n){if(w.isString(e))try{return(t||JSON.parse)(e),w.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}var yl=(e,t)=>e!=null&&w.hasOwnProp(e,t)?e[t]:void 0,LT,bl;var Zg=O(()=>{ut();hr();Mp();Lp();y1();oo();DT();LT={transitional:Qs,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){let r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=w.isObject(t);if(s&&w.isHTMLForm(t))t=new FormData(t);if(w.isFormData(t))return o?JSON.stringify(Vg(t)):t;if(w.isArrayBuffer(t)||w.isBuffer(t)||w.isStream(t)||w.isFile(t)||w.isBlob(t)||w.isReadableStream(t))return t;if(w.isArrayBufferView(t))return t.buffer;if(w.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){let c=yl(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return IT(t,c).toString();if((a=w.isFileList(t))||r.indexOf("multipart/form-data")>-1){let l=yl(this,"env"),u=l&&l.FormData;return Xs(a?{"files[]":t}:t,u&&new u,c)}}if(s||o)return n.setContentType("application/json",!1),She(t);return t}],transformResponse:[function(t){let n=yl(this,"transitional")||LT.transitional,r=n&&n.forcedJSONParsing,o=yl(this,"responseType"),s=o==="json";if(w.isResponse(t)||w.isReadableStream(t))return t;if(t&&w.isString(t)&&(r&&!o||s)){let a=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,yl(this,"parseReviver"))}catch(c){if(a){if(c.name==="SyntaxError")throw G.from(c,G.ERR_BAD_RESPONSE,this,null,yl(this,"response"));throw c}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:qe.classes.FormData,Blob:qe.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};w.forEach(["delete","get","head","post","put","patch"],(e)=>{LT.headers[e]={}});bl=LT});var Ehe,b1=(e)=>{let t={},n,r,o;return e&&e.split(`
`).forEach(function(i){if(o=i.indexOf(":"),n=i.substring(0,o).trim().toLowerCase(),r=i.substring(o+1).trim(),!n||t[n]&&Ehe[n])return;if(n==="set-cookie")if(t[n])t[n].push(r);else t[n]=[r];else t[n]=t[n]?t[n]+", "+r:r}),t};var S1=O(()=>{ut();Ehe=w.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"])});function vhe(e){let t=0,n=e.length;while(t<n){let r=e.charCodeAt(t);if(r!==9&&r!==32)break;t+=1}while(n>t){let r=e.charCodeAt(n-1);if(r!==9&&r!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}function Np(e){return e&&String(e).trim().toLowerCase()}function whe(e){return vhe(e.replace(xhe,""))}function Yg(e){if(e===!1||e==null)return e;return w.isArray(e)?e.map(Yg):whe(String(e))}function Ahe(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;while(r=n.exec(e))t[r[1]]=r[2];return t}function MT(e,t,n,r,o){if(w.isFunction(r))return r.call(this,t,n);if(o)t=n;if(!w.isString(t))return;if(w.isString(r))return t.indexOf(r)!==-1;if(w.isRegExp(r))return r.test(t)}function khe(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Che(e,t){let n=w.toCamelCase(" "+t);["get","set","has"].forEach((r)=>{Object.defineProperty(e,r+n,{value:function(o,s,i){return this[r].call(this,t,o,s,i)},configurable:!0})})}var E1,xhe,The=(e)=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()),Up,At;var Mo=O(()=>{ut();S1();E1=Symbol("internals"),xhe=/[^\x09\x20-\x7E\x80-\xFF]/g;Up=class Up{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function o(i,a,c){let l=Np(a);if(!l)throw Error("header name must be a non-empty string");let u=w.findKey(r,l);if(!u||r[u]===void 0||c===!0||c===void 0&&r[u]!==!1)r[u||a]=Yg(i)}let s=(i,a)=>w.forEach(i,(c,l)=>o(c,l,a));if(w.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(w.isString(e)&&(e=e.trim())&&!The(e))s(b1(e),t);else if(w.isObject(e)&&w.isIterable(e)){let i={},a,c;for(let l of e){if(!w.isArray(l))throw TypeError("Object iterator must return a key-value pair");i[c=l[0]]=(a=i[c])?w.isArray(a)?[...a,l[1]]:[a,l[1]]:l[1]}s(i,t)}else e!=null&&o(t,e,n);return this}get(e,t){if(e=Np(e),e){let n=w.findKey(this,e);if(n){let r=this[n];if(!t)return r;if(t===!0)return Ahe(r);if(w.isFunction(t))return t.call(this,r,n);if(w.isRegExp(t))return t.exec(r);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Np(e),e){let n=w.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||MT(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function o(s){if(s=Np(s),s){let i=w.findKey(n,s);if(i&&(!t||MT(n,n[i],i,t)))delete n[i],r=!0}}if(w.isArray(e))e.forEach(o);else o(e);return r}clear(e){let t=Object.keys(this),n=t.length,r=!1;while(n--){let o=t[n];if(!e||MT(this,this[o],o,e,!0))delete this[o],r=!0}return r}normalize(e){let t=this,n={};return w.forEach(this,(r,o)=>{let s=w.findKey(n,o);if(s){t[s]=Yg(r),delete t[o];return}let i=e?khe(o):String(o).trim();if(i!==o)delete t[o];t[i]=Yg(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return w.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&w.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach((r)=>n.set(r)),n}static accessor(e){let n=(this[E1]=this[E1]={accessors:{}}).accessors,r=this.prototype;function o(s){let i=Np(s);if(!n[i])Che(r,s),n[i]=!0}return w.isArray(e)?e.forEach(o):o(e),this}};Up.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);w.reduceDescriptors(Up.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});w.freezeMethods(Up);At=Up});function Fp(e,t){let n=this||bl,r=t||n,o=At.from(r.headers),s=r.data;return w.forEach(e,function(a){s=a.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}var x1=O(()=>{ut();Zg();Mo()});function zp(e){return!!(e&&e.__CANCEL__)}var v1,gr;var sa=O(()=>{hr();v1=class v1 extends G{constructor(e,t,n){super(e==null?"canceled":e,G.ERR_CANCELED,t,n);this.name="CanceledError",this.__CANCEL__=!0}};gr=v1});function No(e,t,n){let r=n.config.validateStatus;if(!n.status||!r||r(n.status))e(n);else t(new G("Request failed with status code "+n.status,[G.ERR_BAD_REQUEST,G.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}var Jg=O(()=>{hr()});function NT(e){if(typeof e!=="string")return!1;return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function UT(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ia(e,t,n){let r=!NT(t);if(e&&(r||n===!1))return UT(e,t);return t}var Xg=()=>{};function Ohe(e){try{return new URL(e)}catch{return null}}function w1(e){var t=(typeof e==="string"?Ohe(e):e)||{},n=t.protocol,r=t.host,o=t.port;if(typeof r!=="string"||!r||typeof n!=="string")return"";if(n=n.split(":",1)[0],r=r.replace(/:\d*$/,""),o=parseInt(o)||Rhe[n]||0,!Phe(r,o))return"";var s=FT(n+"_proxy")||FT("all_proxy");if(s&&s.indexOf("://")===-1)s=n+"://"+s;return s}function Phe(e,t){var n=FT("no_proxy").toLowerCase();if(!n)return!0;if(n==="*")return!1;return n.split(/[,\s]/).every(function(r){if(!r)return!0;var o=r.match(/^(.+):(\d+)$/),s=o?o[1]:r,i=o?parseInt(o[2]):0;if(i&&i!==t)return!0;if(!/^[.*]/.test(s))return e!==s;if(s.charAt(0)==="*")s=s.slice(1);return!e.endsWith(s)})}function FT(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var Rhe;var A1=O(()=>{Rhe={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443}});var k1=k(function(zft,T1){var Sl=1000,El=Sl*60,xl=El*60,aa=xl*24,Ihe=aa*7,Dhe=aa*365.25;T1.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return Lhe(e);else if(n==="number"&&isFinite(e))return t.long?Nhe(e):Mhe(e);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Lhe(e){if(e=String(e),e.length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*Dhe;case"weeks":case"week":case"w":return n*Ihe;case"days":case"day":case"d":return n*aa;case"hours":case"hour":case"hrs":case"hr":case"h":return n*xl;case"minutes":case"minute":case"mins":case"min":case"m":return n*El;case"seconds":case"second":case"secs":case"sec":case"s":return n*Sl;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}function Mhe(e){var t=Math.abs(e);if(t>=aa)return Math.round(e/aa)+"d";if(t>=xl)return Math.round(e/xl)+"h";if(t>=El)return Math.round(e/El)+"m";if(t>=Sl)return Math.round(e/Sl)+"s";return e+"ms"}function Nhe(e){var t=Math.abs(e);if(t>=aa)return Qg(e,t,aa,"day");if(t>=xl)return Qg(e,t,xl,"hour");if(t>=El)return Qg(e,t,El,"minute");if(t>=Sl)return Qg(e,t,Sl,"second");return e+" ms"}function Qg(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}});var zT=k(function($ft,C1){function Uhe(e){n.debug=n,n.default=n,n.coerce=c,n.disable=i,n.enable=o,n.enabled=a,n.humanize=k1(),n.destroy=l,Object.keys(e).forEach((u)=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let p=0;for(let f=0;f<u.length;f++)p=(p<<5)-p+u.charCodeAt(f),p|=0;return n.colors[Math.abs(p)%n.colors.length]}n.selectColor=t;function n(u){let p,f=null,m,h;function _(...y){if(!_.enabled)return;let S=_,b=Number(new Date),x=b-(p||b);if(S.diff=x,S.prev=p,S.curr=b,p=b,y[0]=n.coerce(y[0]),typeof y[0]!=="string")y.unshift("%O");let v=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(U,M)=>{if(U==="%%")return"%";v++;let F=n.formatters[M];if(typeof F==="function"){let W=y[v];U=F.call(S,W),y.splice(v,1),v--}return U}),n.formatArgs.call(S,y),(S.log||n.log).apply(S,y)}if(_.namespace=u,_.useColors=n.useColors(),_.color=n.selectColor(u),_.extend=r,_.destroy=n.destroy,Object.defineProperty(_,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(f!==null)return f;if(m!==n.namespaces)m=n.namespaces,h=n.enabled(u);return h},set:(y)=>{f=y}}),typeof n.init==="function")n.init(_);return _}function r(u,p){let f=n(this.namespace+(typeof p>"u"?":":p)+u);return f.log=this.log,f}function o(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let p=(typeof u==="string"?u:"").trim().replace(" ",",").split(",").filter(Boolean);for(let f of p)if(f[0]==="-")n.skips.push(f.slice(1));else n.names.push(f)}function s(u,p){let f=0,m=0,h=-1,_=0;while(f<u.length)if(m<p.length&&(p[m]===u[f]||p[m]==="*"))if(p[m]==="*")h=m,_=f,m++;else f++,m++;else if(h!==-1)m=h+1,_++,f=_;else return!1;while(m<p.length&&p[m]==="*")m++;return m===p.length}function i(){let u=[...n.names,...n.skips.map((p)=>"-"+p)].join(",");return n.enable(""),u}function a(u){for(let p of n.skips)if(s(u,p))return!1;for(let p of n.names)if(s(u,p))return!0;return!1}function c(u){if(u instanceof Error)return u.stack||u.message;return u}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}C1.exports=Uhe});var O1=k(function(R1,t_){R1.formatArgs=zhe;R1.save=$he;R1.load=jhe;R1.useColors=Fhe;R1.storage=Hhe();R1.destroy=(()=>{let e=!1;return()=>{if(!e)e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();R1.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Fhe(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function zhe(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t_.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let n=0,r=0;e[0].replace(/%[a-zA-Z%]/g,(o)=>{if(o==="%%")return;if(n++,o==="%c")r=n}),e.splice(r,0,t)}R1.log=console.debug||console.log||(()=>{});function $he(e){try{if(e)R1.storage.setItem("debug",e);else R1.storage.removeItem("debug")}catch(t){}}function jhe(){let e;try{e=R1.storage.getItem("debug")}catch(t){}if(!e&&typeof process<"u"&&"env"in process)e=process.env.DEBUG;return e}function Hhe(){try{return localStorage}catch(e){}}t_.exports=zT()(R1);var{formatters:Bhe}=t_.exports;Bhe.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var I1=k(function(Hft,P1){P1.exports=(e,t=process.argv)=>{let n=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(n+e),o=t.indexOf("--");return r!==-1&&(o===-1||r<o)}});var M1=k(function(Bft,L1){var Jhe=Ne("os"),D1=Ne("tty"),Pr=I1(),{env:tn}=process,n_;if(Pr("no-color")||Pr("no-colors")||Pr("color=false")||Pr("color=never"))n_=0;else if(Pr("color")||Pr("colors")||Pr("color=true")||Pr("color=always"))n_=1;function Xhe(){if("FORCE_COLOR"in tn){if(tn.FORCE_COLOR==="true")return 1;if(tn.FORCE_COLOR==="false")return 0;return tn.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(tn.FORCE_COLOR,10),3)}}function Qhe(e){if(e===0)return!1;return{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ege(e,{streamIsTTY:t,sniffFlags:n=!0}={}){let r=Xhe();if(r!==void 0)n_=r;let o=n?n_:r;if(o===0)return 0;if(n){if(Pr("color=16m")||Pr("color=full")||Pr("color=truecolor"))return 3;if(Pr("color=256"))return 2}if(e&&!t&&o===void 0)return 0;let s=o||0;if(tn.TERM==="dumb")return s;if(process.platform==="win32"){let i=Jhe.release().split(".");if(Number(i[0])>=10&&Number(i[2])>=10586)return Number(i[2])>=14931?3:2;return 1}if("CI"in tn){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((i)=>(i in tn))||tn.CI_NAME==="codeship")return 1;return s}if("TEAMCITY_VERSION"in tn)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(tn.TEAMCITY_VERSION)?1:0;if(tn.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in tn){let i=Number.parseInt((tn.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(tn.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(tn.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(tn.TERM))return 1;if("COLORTERM"in tn)return 1;return s}function $T(e,t={}){let n=ege(e,{streamIsTTY:e&&e.isTTY,...t});return Qhe(n)}L1.exports={supportsColor:$T,stdout:$T({isTTY:D1.isatty(1)}),stderr:$T({isTTY:D1.isatty(2)})}});var z1=k(function(U1,o_){var tge=Ne("tty"),r_=Ne("util");U1.init=cge;U1.log=sge;U1.formatArgs=rge;U1.save=ige;U1.load=age;U1.useColors=nge;U1.destroy=r_.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");U1.colors=[6,2,3,4,5,1];try{let e=M1();if(e&&(e.stderr||e).level>=2)U1.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(e){}U1.inspectOpts=Object.keys(process.env).filter((e)=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),r=process.env[t];if(/^(yes|on|true|enabled)$/i.test(r))r=!0;else if(/^(no|off|false|disabled)$/i.test(r))r=!1;else if(r==="null")r=null;else r=Number(r);return e[n]=r,e},{});function nge(){return"colors"in U1.inspectOpts?Boolean(U1.inspectOpts.colors):tge.isatty(process.stderr.fd)}function rge(e){let{namespace:t,useColors:n}=this;if(n){let r=this.color,o="\x1B[3"+(r<8?r:"8;5;"+r),s=` ${o};1m${t} \x1B[0m`;e[0]=s+e[0].split(`
`).join(`
`+s),e.push(o+"m+"+o_.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=oge()+t+" "+e[0]}function oge(){if(U1.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function sge(...e){return process.stderr.write(r_.formatWithOptions(U1.inspectOpts,...e)+`
`)}function ige(e){if(e)process.env.DEBUG=e;else delete process.env.DEBUG}function age(){return process.env.DEBUG}function cge(e){e.inspectOpts={};let t=Object.keys(U1.inspectOpts);for(let n=0;n<t.length;n++)e.inspectOpts[t[n]]=U1.inspectOpts[t[n]]}o_.exports=zT()(U1);var{formatters:N1}=o_.exports;N1.o=function(e){return this.inspectOpts.colors=this.useColors,r_.inspect(e,this.inspectOpts).split(`
`).map((t)=>t.trim()).join(" ")};N1.O=function(e){return this.inspectOpts.colors=this.useColors,r_.inspect(e,this.inspectOpts)}});var $1=k(function(Gft,jT){if(typeof process>"u"||process.type==="renderer"||!1||process.__nwjs)jT.exports=O1();else jT.exports=z1()});var H1=k(function(Wft,j1){var $p;j1.exports=function(){if(!$p){try{$p=$1()("follow-redirects")}catch(e){}if(typeof $p!=="function")$p=function(){}}$p.apply(null,arguments)}});var q1=k(function(qft,QT){var Hp=Ne("url"),jp=Hp.URL,gge=Ne("http"),_ge=Ne("https"),WT=Ne("stream").Writable,qT=Ne("assert"),B1=H1();(function(){var t=typeof process<"u",n=typeof window<"u"&&typeof document<"u",r=ua(Error.captureStackTrace);if(!t&&(n||!r))console.warn("The follow-redirects package should be excluded from browser builds.")})();var VT=!1;try{qT(new jp(""))}catch(e){VT=e.code==="ERR_INVALID_URL"}var yge=["Authorization","Proxy-Authorization","Cookie"],bge=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],ZT=["abort","aborted","connect","error","socket","timeout"],YT=Object.create(null);ZT.forEach(function(e){YT[e]=function(t,n,r){this._redirectable.emit(e,t,n,r)}});var BT=Bp("ERR_INVALID_URL","Invalid URL",TypeError),KT=Bp("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Sge=Bp("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",KT),Ege=Bp("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),xge=Bp("ERR_STREAM_WRITE_AFTER_END","write after end"),vge=WT.prototype.destroy||G1;function Kn(e,t){if(WT.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t)this.on("response",t);var n=this;this._onNativeResponse=function(r){try{n._processResponse(r)}catch(o){n.emit("error",o instanceof KT?o:new KT({cause:o}))}},this._headerFilter=new RegExp("^(?:"+yge.concat(e.sensitiveHeaders).map(Rge).join("|")+")$","i"),this._performRequest()}Kn.prototype=Object.create(WT.prototype);Kn.prototype.abort=function(){XT(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Kn.prototype.destroy=function(e){return XT(this._currentRequest,e),vge.call(this,e),this};Kn.prototype.write=function(e,t,n){if(this._ending)throw new xge;if(!la(e)&&!kge(e))throw TypeError("data should be a string, Buffer or Uint8Array");if(ua(t))n=t,t=null;if(e.length===0){if(n)n();return}if(this._requestBodyLength+e.length<=this._options.maxBodyLength)this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,n);else this.emit("error",new Ege),this.abort()};Kn.prototype.end=function(e,t,n){if(ua(e))n=e,e=t=null;else if(ua(t))n=t,t=null;if(!e)this._ended=this._ending=!0,this._currentRequest.end(null,null,n);else{var r=this,o=this._currentRequest;this.write(e,t,function(){r._ended=!0,o.end(null,null,n)}),this._ending=!0}};Kn.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)};Kn.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)};Kn.prototype.setTimeout=function(e,t){var n=this;function r(i){i.setTimeout(e),i.removeListener("timeout",i.destroy),i.addListener("timeout",i.destroy)}function o(i){if(n._timeout)clearTimeout(n._timeout);n._timeout=setTimeout(function(){n.emit("timeout"),s()},e),r(i)}function s(){if(n._timeout)clearTimeout(n._timeout),n._timeout=null;if(n.removeListener("abort",s),n.removeListener("error",s),n.removeListener("response",s),n.removeListener("close",s),t)n.removeListener("timeout",t);if(!n.socket)n._currentRequest.removeListener("socket",o)}if(t)this.on("timeout",t);if(this.socket)o(this.socket);else this._currentRequest.once("socket",o);return this.on("socket",r),this.on("abort",s),this.on("error",s),this.on("response",s),this.on("close",s),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){Kn.prototype[e]=function(t,n){return this._currentRequest[e](t,n)}});["aborted","connection","socket"].forEach(function(e){Object.defineProperty(Kn.prototype,e,{get:function(){return this._currentRequest[e]}})});Kn.prototype._sanitizeOptions=function(e){if(!e.headers)e.headers={};if(!Tge(e.sensitiveHeaders))e.sensitiveHeaders=[];if(e.host){if(!e.hostname)e.hostname=e.host;delete e.host}if(!e.pathname&&e.path){var t=e.path.indexOf("?");if(t<0)e.pathname=e.path;else e.pathname=e.path.substring(0,t),e.search=e.path.substring(t)}};Kn.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(!t)throw TypeError("Unsupported protocol "+e);if(this._options.agents){var n=e.slice(0,-1);this._options.agent=this._options.agents[n]}var r=this._currentRequest=t.request(this._options,this._onNativeResponse);r._redirectable=this;for(var o of ZT)r.on(o,YT[o]);if(this._currentUrl=/^\//.test(this._options.path)?Hp.format(this._options):this._options.path,this._isRedirect){var s=0,i=this,a=this._requestBodyBuffers;(function c(l){if(r===i._currentRequest){if(l)i.emit("error",l);else if(s<a.length){var u=a[s++];if(!r.finished)r.write(u.data,u.encoding,c)}else if(i._ended)r.end()}})()}};Kn.prototype._processResponse=function(e){var t=e.statusCode;if(this._options.trackRedirects)this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var n=e.headers.location;if(!n||this._options.followRedirects===!1||t<300||t>=400){e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),this._requestBodyBuffers=[];return}if(XT(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new Sge;var r,o=this._options.beforeRedirect;if(o)r=Object.assign({Host:e.req.getHeader("host")},this._options.headers);var s=this._options.method;if((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method))this._options.method="GET",this._requestBodyBuffers=[],HT(/^content-/i,this._options.headers);var i=HT(/^host$/i,this._options.headers),a=JT(this._currentUrl),c=i||a.host,l=/^\w+:/.test(n)?this._currentUrl:Hp.format(Object.assign(a,{host:c})),u=wge(n,l);if(B1("redirecting to",u.href),this._isRedirect=!0,GT(u,this._options),u.protocol!==a.protocol&&u.protocol!=="https:"||u.host!==c&&!Age(u.host,c))HT(this._headerFilter,this._options.headers);if(ua(o)){var p={headers:e.headers,statusCode:t},f={url:l,method:s,headers:r};o(this._options,p,f),this._sanitizeOptions(this._options)}this._performRequest()};function K1(e){var t={maxRedirects:21,maxBodyLength:10485760},n={};return Object.keys(e).forEach(function(r){var o=r+":",s=n[o]=e[r],i=t[r]=Object.create(s);function a(l,u,p){if(Cge(l))l=GT(l);else if(la(l))l=GT(JT(l));else p=u,u=W1(l),l={protocol:o};if(ua(u))p=u,u=null;if(u=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},l,u),u.nativeProtocols=n,!la(u.host)&&!la(u.hostname))u.hostname="::1";return qT.equal(u.protocol,o,"protocol mismatch"),B1("options",u),new Kn(u,p)}function c(l,u,p){var f=i.request(l,u,p);return f.end(),f}Object.defineProperties(i,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:c,configurable:!0,enumerable:!0,writable:!0}})}),t}function G1(){}function JT(e){var t;if(VT)t=new jp(e);else if(t=W1(Hp.parse(e)),!la(t.protocol))throw new BT({input:e});return t}function wge(e,t){return VT?new jp(e,t):JT(Hp.resolve(t,e))}function W1(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new BT({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new BT({input:e.href||e});return e}function GT(e,t){var n=t||{};for(var r of bge)n[r]=e[r];if(n.hostname.startsWith("["))n.hostname=n.hostname.slice(1,-1);if(n.port!=="")n.port=Number(n.port);return n.path=n.search?n.pathname+n.search:n.pathname,n}function HT(e,t){var n;for(var r in t)if(e.test(r))n=t[r],delete t[r];return n===null||typeof n>"u"?void 0:String(n).trim()}function Bp(e,t,n){function r(o){if(ua(Error.captureStackTrace))Error.captureStackTrace(this,this.constructor);Object.assign(this,o||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return r.prototype=Object.create((n||Error).prototype),Object.defineProperties(r.prototype,{constructor:{value:r,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),r}function XT(e,t){for(var n of ZT)e.removeListener(n,YT[n]);e.on("error",G1),e.destroy(t)}function Age(e,t){qT(la(e)&&la(t));var n=e.length-t.length-1;return n>0&&e[n]==="."&&e.endsWith(t)}function Tge(e){return e instanceof Array}function la(e){return typeof e==="string"||e instanceof String}function ua(e){return typeof e==="function"}function kge(e){return typeof e==="object"&&"length"in e}function Cge(e){return jp&&e instanceof jp}function Rge(e){return e.replace(/[\]\\/()*+?.$]/g,"\\$&")}QT.exports=K1({http:gge,https:_ge});QT.exports.wrap=K1});var da="1.15.2";function Kp(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function ek(e,t,n){let r=n&&n.Blob||qe.classes.Blob,o=Kp(e);if(t===void 0&&r)t=!0;if(o==="data"){e=o.length?e.slice(o.length+1):e;let s=Oge.exec(e);if(!s)throw new G("Invalid URL",G.ERR_INVALID_URL);let i=s[1],a=s[2],c=s[3],l=Buffer.from(decodeURIComponent(c),a?"base64":"utf8");if(t){if(!r)throw new G("Blob is not supported",G.ERR_NOT_SUPPORT);return new r([l],{type:i})}return l}throw new G("Unsupported protocol "+o,G.ERR_NOT_SUPPORT)}var Oge;var V1=O(()=>{hr();oo();Oge=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/});import Pge from"stream";var tk,Z1,nk;var Y1=O(()=>{ut();tk=Symbol("internals");Z1=class Z1 extends Pge.Transform{constructor(e){e=w.toFlatObject(e,{maxRate:0,chunkSize:65536,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(n,r)=>!w.isUndefined(r[n]));super({readableHighWaterMark:e.chunkSize});let t=this[tk]={timeWindow:e.timeWindow,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",(n)=>{if(n==="progress"){if(!t.isCaptured)t.isCaptured=!0}})}_read(e){let t=this[tk];if(t.onReadCallback)t.onReadCallback();return super._read(e)}_transform(e,t,n){let r=this[tk],o=r.maxRate,s=this.readableHighWaterMark,i=r.timeWindow,a=1000/i,c=o/a,l=r.minChunkSize!==!1?Math.max(r.minChunkSize,c*0.01):0,u=(f,m)=>{let h=Buffer.byteLength(f);if(r.bytesSeen+=h,r.bytes+=h,r.isCaptured&&this.emit("progress",r.bytesSeen),this.push(f))process.nextTick(m);else r.onReadCallback=()=>{r.onReadCallback=null,process.nextTick(m)}},p=(f,m)=>{let h=Buffer.byteLength(f),_=null,y=s,S,b=0;if(o){let x=Date.now();if(!r.ts||(b=x-r.ts)>=i)r.ts=x,S=c-r.bytes,r.bytes=S<0?-S:0,b=0;S=c-r.bytes}if(o){if(S<=0)return setTimeout(()=>{m(null,f)},i-b);if(S<y)y=S}if(y&&h>y&&h-y>l)_=f.subarray(y),f=f.subarray(0,y);u(f,_?()=>{process.nextTick(m,null,_)}:m)};p(e,function f(m,h){if(m)return n(m);if(h)p(h,f);else n(null)})}};nk=Z1});var J1,Ige=async function*(e){if(e.stream)yield*e.stream();else if(e.arrayBuffer)yield await e.arrayBuffer();else if(e[J1])yield*e[J1]();else yield e},s_;var rk=O(()=>{({asyncIterator:J1}=Symbol),s_=Ige});import Dge from"util";import{Readable as Lge}from"stream";class X1{constructor(e,t){let{escapeName:n}=this.constructor,r=w.isString(t),o=`Content-Disposition: form-data; name="${n(e)}"${!r&&t.name?`; filename="${n(t.name)}"`:""}${pa}`;if(r)t=Gp.encode(String(t).replace(/\r?\n|\r\n?/g,pa));else{let s=String(t.type||"application/octet-stream").replace(/[\r\n]/g,"");o+=`Content-Type: ${s}${pa}`}this.headers=Gp.encode(o+pa),this.contentLength=r?t.byteLength:t.size,this.size=this.headers.byteLength+this.contentLength+Uge,this.name=e,this.value=t}async*encode(){yield this.headers;let{value:e}=this;if(w.isTypedArray(e))yield e;else yield*s_(e);yield Nge}static escapeName(e){return String(e).replace(/[\r\n"]/g,(t)=>({"\r":"%0D","\n":"%0A",'"':"%22"})[t])}}var Mge,Gp,pa=`\r
`,Nge,Uge=2,Fge=(e,t,n)=>{let{tag:r="form-data-boundary",size:o=25,boundary:s=r+"-"+qe.generateString(o,Mge)}=n||{};if(!w.isFormData(e))throw TypeError("FormData instance required");if(s.length<1||s.length>70)throw Error("boundary must be 10-70 characters long");let i=Gp.encode("--"+s+pa),a=Gp.encode("--"+s+"--"+pa),c=a.byteLength,l=Array.from(e.entries()).map(([p,f])=>{let m=new X1(p,f);return c+=m.size,m});c+=i.byteLength*l.length,c=w.toFiniteNumber(c);let u={"Content-Type":`multipart/form-data; boundary=${s}`};if(Number.isFinite(c))u["Content-Length"]=c;return t&&t(u),Lge.from(async function*(){for(let p of l)yield i,yield*p.encode();yield a}())},Q1;var eH=O(()=>{ut();rk();oo();Mge=qe.ALPHABET.ALPHA_DIGIT+"-_",Gp=typeof TextEncoder==="function"?new TextEncoder:new Dge.TextEncoder,Nge=Gp.encode(pa);Q1=Fge});import zge from"stream";var tH,nH;var rH=O(()=>{tH=class tH extends zge.Transform{__transform(e,t,n){this.push(e),n()}_transform(e,t,n){if(e.length!==0){if(this._transform=this.__transform,e[0]!==120){let r=Buffer.alloc(2);r[0]=120,r[1]=156,this.push(r,t)}}this.__transform(e,t,n)}};nH=tH});var $ge=(e,t)=>w.isAsyncFn(e)?function(...n){let r=n.pop();e.apply(this,n).then((o)=>{try{t?r(null,...t(o)):r(null,o)}catch(s){r(s)}},r)}:e,oH;var sH=O(()=>{ut();oH=$ge});function ok(e){let t;try{t=new URL(e)}catch(s){return!1}let n=(process.env.no_proxy||process.env.NO_PROXY||"").toLowerCase();if(!n)return!1;if(n==="*")return!0;let r=Number.parseInt(t.port,10)||Bge[t.protocol.split(":",1)[0]]||0,o=aH(t.hostname.toLowerCase());return n.split(/[\s,]+/).some((s)=>{if(!s)return!1;let[i,a]=Kge(s);if(i=aH(i),!i)return!1;if(a&&a!==r)return!1;if(i.charAt(0)==="*")i=i.slice(1);if(i.charAt(0)===".")return o.endsWith(i);return o===i||iH(o)&&iH(i)})}var jge,cH=(e)=>{let t=e.split(".");if(t.length!==4)return!1;if(t[0]!=="127")return!1;return t.every((n)=>/^\d+$/.test(n)&&Number(n)>=0&&Number(n)<=255)},Hge=(e)=>{if(e==="::1")return!0;let t=e.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);if(t)return cH(t[1]);let n=e.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);if(n){let o=parseInt(n[1],16);return o>=32512&&o<=32767}let r=e.split(":");if(r.length===8){for(let o=0;o<7;o++)if(!/^0+$/.test(r[o]))return!1;return/^0*1$/.test(r[7])}return!1},iH=(e)=>{if(!e)return!1;if(jge.has(e))return!0;if(cH(e))return!0;return Hge(e)},Bge,Kge=(e)=>{let t=e,n=0;if(t.charAt(0)==="["){let s=t.indexOf("]");if(s!==-1){let i=t.slice(1,s),a=t.slice(s+1);if(a.charAt(0)===":"&&/^\d+$/.test(a.slice(1)))n=Number.parseInt(a.slice(1),10);return[i,n]}}let r=t.indexOf(":"),o=t.lastIndexOf(":");if(r!==-1&&r===o&&/^\d+$/.test(t.slice(o+1)))n=Number.parseInt(t.slice(o+1),10),t=t.slice(0,o);return[t,n]},aH=(e)=>{if(!e)return e;if(e.charAt(0)==="["&&e.charAt(e.length-1)==="]")e=e.slice(1,-1);return e.replace(/\.+$/,"")};var lH=O(()=>{jge=new Set(["localhost"]),Bge={http:80,https:443,ws:80,wss:443,ftp:21}});function Gge(e,t){e=e||10;let n=Array(e),r=Array(e),o=0,s=0,i;return t=t!==void 0?t:1000,function(c){let l=Date.now(),u=r[s];if(!i)i=l;n[o]=c,r[o]=l;let p=s,f=0;while(p!==o)f+=n[p++],p=p%e;if(o=(o+1)%e,o===s)s=(s+1)%e;if(l-i<t)return;let m=u&&l-u;return m?Math.round(f*1000/m):void 0}}var uH;var dH=O(()=>{uH=Gge});function Wge(e,t){let n=0,r=1000/t,o,s,i=(l,u=Date.now())=>{if(n=u,o=null,s)clearTimeout(s),s=null;e(...l)};return[(...l)=>{let u=Date.now(),p=u-n;if(p>=r)i(l,u);else if(o=l,!s)s=setTimeout(()=>{s=null,i(o)},r-p)},()=>o&&i(o)]}var pH;var fH=O(()=>{pH=Wge});var os=(e,t,n=3)=>{let r=0,o=uH(50,250);return pH((s)=>{let i=s.loaded,a=s.lengthComputable?s.total:void 0,c=a!=null?Math.min(i,a):i,l=Math.max(0,c-r),u=o(l);r=Math.max(r,c);let p={loaded:c,total:a,progress:a?c/a:void 0,bytes:l,rate:u?u:void 0,estimated:u&&a?(a-c)/u:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(p)},n)},vl=(e,t)=>{let n=e!=null;return[(r)=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},wl=(e)=>(...t)=>w.asap(()=>e(...t));var i_=O(()=>{dH();fH();ut()});function sk(e){if(!e||typeof e!=="string")return 0;if(!e.startsWith("data:"))return 0;let t=e.indexOf(",");if(t<0)return 0;let n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){let{length:s,length:i}=r;for(let f=0;f<i;f++)if(r.charCodeAt(f)===37&&f+2<i){let m=r.charCodeAt(f+1),h=r.charCodeAt(f+2);if((m>=48&&m<=57||m>=65&&m<=70||m>=97&&m<=102)&&(h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102))s-=2,f+=2}let a=0,c=i-1,l=(f)=>f>=2&&r.charCodeAt(f-2)===37&&r.charCodeAt(f-1)===51&&(r.charCodeAt(f)===68||r.charCodeAt(f)===100);if(c>=0){if(r.charCodeAt(c)===61)a++,c--;else if(l(c))a++,c-=3}if(a===1&&c>=0){if(r.charCodeAt(c)===61)a++;else if(l(c))a++}let p=Math.floor(s/4)*3-(a||0);return p>0?p:0}return Buffer.byteLength(r,"utf8")}import qge from"http";import Vge from"https";import EH from"http2";import xH from"util";import{resolve as mH}from"path";import ei from"zlib";import so from"stream";import{EventEmitter as Zge}from"events";class wH{constructor(){this.sessions=Object.create(null)}getSession(e,t){t=Object.assign({sessionTimeout:1000},t);let n=this.sessions[e];if(n){let l=n.length;for(let u=0;u<l;u++){let[p,f]=n[u];if(!p.destroyed&&!p.closed&&xH.isDeepStrictEqual(f,t))return p}}let r=EH.connect(e,t),o,s=()=>{if(o)return;o=!0;let l=n,u=l.length,p=u;while(p--)if(l[p][0]===r){if(u===1)delete this.sessions[e];else l.splice(p,1);if(!r.closed)r.close();return}},i=r.request,{sessionTimeout:a}=t;if(a!=null){let l,u=0;r.request=function(){let p=i.apply(this,arguments);if(u++,l)clearTimeout(l),l=null;return p.once("close",()=>{if(!--u)l=setTimeout(()=>{l=null,s()},a)}),p}}r.once("close",s);let c=[r,t];return n?n.push(c):n=this.sessions[e]=[c],r}}function t_e(e,t){if(e.beforeRedirects.proxy)e.beforeRedirects.proxy(e);if(e.beforeRedirects.config)e.beforeRedirects.config(e,t)}function AH(e,t,n){let r=t;if(!r&&r!==!1){let o=w1(n);if(o){if(!ok(n))r=new URL(o)}}if(r){if(r.username)r.auth=(r.username||"")+":"+(r.password||"");if(r.auth){if(Boolean(r.auth.username||r.auth.password))r.auth=(r.auth.username||"")+":"+(r.auth.password||"");else if(typeof r.auth==="object")throw new G("Invalid proxy authorization",G.ERR_BAD_OPTION,{proxy:r});let i=Buffer.from(r.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+i}e.headers.host=e.hostname+(e.port?":"+e.port:"");let o=r.hostname||r.host;if(e.hostname=o,e.host=o,e.port=r.port,e.path=n,r.protocol)e.protocol=r.protocol.includes(":")?r.protocol:`${r.protocol}:`}e.beforeRedirects.proxy=function(s){AH(s,t,s.href)}}var vH,hH,Yge,gH,Jge,Xge,Qge,_H,a_,yH,bH=(e,[t,n])=>(e.on("end",n).on("error",n),t),e_e,n_e,r_e=(e)=>new Promise((t,n)=>{let r,o,s=(c,l)=>{if(o)return;o=!0,r&&r(c,l)},i=(c)=>{s(c),t(c)},a=(c)=>{s(c,!0),n(c)};e(i,a,(c)=>r=c).catch(a)}),o_e=({address:e,family:t})=>{if(!w.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}},SH=(e,t)=>o_e(w.isObject(e)?e:{address:e,family:t}),s_e,TH;var kH=O(()=>{ut();Jg();Xg();qg();A1();Mp();hr();sa();oo();V1();Mo();Y1();eH();rk();rH();sH();lH();i_();vH=$a(q1(),1),hH={flush:ei.constants.Z_SYNC_FLUSH,finishFlush:ei.constants.Z_SYNC_FLUSH},Yge={flush:ei.constants.BROTLI_OPERATION_FLUSH,finishFlush:ei.constants.BROTLI_OPERATION_FLUSH},gH=w.isFunction(ei.createBrotliDecompress),{http:Jge,https:Xge}=vH.default,Qge=/https:?/,_H=Symbol("axios.http.socketListener"),a_=Symbol("axios.http.currentReq"),yH=qe.protocols.map((e)=>e+":");e_e=new wH;n_e=typeof process<"u"&&w.kindOf(process)==="process",s_e={request(e,t){let n=e.protocol+"//"+e.hostname+":"+(e.port||(e.protocol==="https:"?443:80)),{http2Options:r,headers:o}=e,s=e_e.getSession(n,r),{HTTP2_HEADER_SCHEME:i,HTTP2_HEADER_METHOD:a,HTTP2_HEADER_PATH:c,HTTP2_HEADER_STATUS:l}=EH.constants,u={[i]:e.protocol.replace(":",""),[a]:e.method,[c]:e.path};w.forEach(o,(f,m)=>{m.charAt(0)!==":"&&(u[m]=f)});let p=s.request(u);return p.once("response",(f)=>{let m=p;f=Object.assign({},f);let h=f[l];delete f[l],m.headers=f,m.statusCode=+h,t(m)}),p}},TH=n_e&&function(t){return r_e(async function(r,o,s){let i=(re)=>w.hasOwnProp(t,re)?t[re]:void 0,a=i("data"),c=i("lookup"),l=i("family"),u=i("httpVersion");if(u===void 0)u=1;let p=i("http2Options"),f=i("responseType"),m=i("responseEncoding"),h=t.method.toUpperCase(),_,y=!1,S;if(u=+u,Number.isNaN(u))throw TypeError(`Invalid protocol version: '${t.httpVersion}' is not a number`);if(u!==1&&u!==2)throw TypeError(`Unsupported protocol version '${u}'`);let b=u===2;if(c){let re=oH(c,(Q)=>w.isArray(Q)?Q:[Q]);c=(Q,ee,Ue)=>{re(Q,ee,(we,Qe,tr)=>{if(we)return Ue(we);let rt=w.isArray(Qe)?Qe.map(($r)=>SH($r)):[SH(Qe,tr)];ee.all?Ue(we,rt):Ue(we,rt[0].address,rt[0].family)})}}let x=new Zge;function v(re){try{x.emit("abort",!re||re.type?new gr(null,t,S):re)}catch(Q){console.warn("emit error",Q)}}x.once("abort",o);let T=()=>{if(t.cancelToken)t.cancelToken.unsubscribe(v);if(t.signal)t.signal.removeEventListener("abort",v);x.removeAllListeners()};if(t.cancelToken||t.signal){if(t.cancelToken&&t.cancelToken.subscribe(v),t.signal)t.signal.aborted?v():t.signal.addEventListener("abort",v)}s((re,Q)=>{if(_=!0,Q){y=!0,T();return}let{data:ee}=re;if(ee instanceof so.Readable||ee instanceof so.Duplex){let Ue=so.finished(ee,()=>{Ue(),T()})}else T()});let U=ia(t.baseURL,t.url,t.allowAbsoluteUrls),M=new URL(U,qe.hasBrowserEnv?qe.origin:void 0),F=M.protocol||yH[0];if(F==="data:"){if(t.maxContentLength>-1){let Q=String(t.url||U||"");if(sk(Q)>t.maxContentLength)return o(new G("maxContentLength size of "+t.maxContentLength+" exceeded",G.ERR_BAD_RESPONSE,t))}let re;if(h!=="GET")return No(r,o,{status:405,statusText:"method not allowed",headers:{},config:t});try{re=ek(t.url,f==="blob",{Blob:t.env&&t.env.Blob})}catch(Q){throw G.from(Q,G.ERR_BAD_REQUEST,t)}if(f==="text"){if(re=re.toString(m),!m||m==="utf8")re=w.stripBOM(re)}else if(f==="stream")re=so.Readable.from(re);return No(r,o,{data:re,status:200,statusText:"OK",headers:new At,config:t})}if(yH.indexOf(F)===-1)return o(new G("Unsupported protocol "+F,G.ERR_BAD_REQUEST,t));let W=At.from(t.headers).normalize();W.set("User-Agent","axios/"+da,!1);let{onUploadProgress:ce,onDownloadProgress:ne}=t,se=t.maxRate,Se=void 0,Te=void 0;if(w.isSpecCompliantForm(a)){let re=W.getContentType(/boundary=([-_\w\d]{10,70})/i);a=Q1(a,(Q)=>{W.set(Q)},{tag:`axios-${da}-boundary`,boundary:re&&re[1]||void 0})}else if(w.isFormData(a)&&w.isFunction(a.getHeaders)&&a.getHeaders!==Object.prototype.getHeaders){if(W.set(a.getHeaders()),!W.hasContentLength())try{let re=await xH.promisify(a.getLength).call(a);Number.isFinite(re)&&re>=0&&W.setContentLength(re)}catch(re){}}else if(w.isBlob(a)||w.isFile(a))a.size&&W.setContentType(a.type||"application/octet-stream"),W.setContentLength(a.size||0),a=so.Readable.from(s_(a));else if(a&&!w.isStream(a)){if(Buffer.isBuffer(a));else if(w.isArrayBuffer(a))a=Buffer.from(new Uint8Array(a));else if(w.isString(a))a=Buffer.from(a,"utf-8");else return o(new G("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",G.ERR_BAD_REQUEST,t));if(W.setContentLength(a.length,!1),t.maxBodyLength>-1&&a.length>t.maxBodyLength)return o(new G("Request body larger than maxBodyLength limit",G.ERR_BAD_REQUEST,t))}let St=w.toFiniteNumber(W.getContentLength());if(w.isArray(se))Se=se[0],Te=se[1];else Se=Te=se;if(a&&(ce||Se)){if(!w.isStream(a))a=so.Readable.from(a,{objectMode:!1});a=so.pipeline([a,new nk({maxRate:w.toFiniteNumber(Se)})],w.noop),ce&&a.on("progress",bH(a,vl(St,os(wl(ce),!1,3))))}let Y=void 0,Ye=i("auth");if(Ye){let re=Ye.username||"",Q=Ye.password||"";Y=re+":"+Q}if(!Y&&M.username){let{username:re,password:Q}=M;Y=re+":"+Q}Y&&W.delete("authorization");let Et;try{Et=oa(M.pathname+M.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(re){let Q=Error(re.message);return Q.config=t,Q.url=t.url,Q.exists=!0,o(Q)}W.set("Accept-Encoding","gzip, compress, deflate"+(gH?", br":""),!1);let ht=Object.assign(Object.create(null),{path:Et,method:h,headers:W.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:Y,protocol:F,family:l,beforeRedirect:t_e,beforeRedirects:Object.create(null),http2Options:p});if(!w.isUndefined(c)&&(ht.lookup=c),t.socketPath){if(typeof t.socketPath!=="string")return o(new G("socketPath must be a string",G.ERR_BAD_OPTION_VALUE,t));if(t.allowedSocketPaths!=null){let re=Array.isArray(t.allowedSocketPaths)?t.allowedSocketPaths:[t.allowedSocketPaths],Q=mH(t.socketPath);if(!re.some((Ue)=>typeof Ue==="string"&&mH(Ue)===Q))return o(new G(`socketPath "${t.socketPath}" is not permitted by allowedSocketPaths`,G.ERR_BAD_OPTION_VALUE,t))}ht.socketPath=t.socketPath}else ht.hostname=M.hostname.startsWith("[")?M.hostname.slice(1,-1):M.hostname,ht.port=M.port,AH(ht,t.proxy,F+"//"+M.hostname+(M.port?":"+M.port:"")+ht.path);let er,Tt=Qge.test(ht.protocol);if(ht.agent=Tt?t.httpsAgent:t.httpAgent,b)er=s_e;else{let re=i("transport");if(re)er=re;else if(t.maxRedirects===0)er=Tt?Vge:qge;else{if(t.maxRedirects)ht.maxRedirects=t.maxRedirects;let Q=i("beforeRedirect");if(Q)ht.beforeRedirects.config=Q;er=Tt?Xge:Jge}}if(t.maxBodyLength>-1)ht.maxBodyLength=t.maxBodyLength;else ht.maxBodyLength=1/0;if(ht.insecureHTTPParser=Boolean(i("insecureHTTPParser")),S=er.request(ht,function(Q){if(S.destroyed)return;let ee=[Q],Ue=w.toFiniteNumber(Q.headers["content-length"]);if(ne||Te){let rt=new nk({maxRate:w.toFiniteNumber(Te)});ne&&rt.on("progress",bH(rt,vl(Ue,os(wl(ne),!0,3)))),ee.push(rt)}let we=Q,Qe=Q.req||S;if(t.decompress!==!1&&Q.headers["content-encoding"]){if(h==="HEAD"||Q.statusCode===204)delete Q.headers["content-encoding"];switch((Q.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":ee.push(ei.createUnzip(hH)),delete Q.headers["content-encoding"];break;case"deflate":ee.push(new nH),ee.push(ei.createUnzip(hH)),delete Q.headers["content-encoding"];break;case"br":if(gH)ee.push(ei.createBrotliDecompress(Yge)),delete Q.headers["content-encoding"]}}we=ee.length>1?so.pipeline(ee,w.noop):ee[0];let tr={status:Q.statusCode,statusText:Q.statusMessage,headers:new At(Q.headers),config:t,request:Qe};if(f==="stream"){if(t.maxContentLength>-1){let rt=t.maxContentLength,$r=we;async function*jo(){let Ft=0;for await(let hm of $r){if(Ft+=hm.length,Ft>rt)throw new G("maxContentLength size of "+rt+" exceeded",G.ERR_BAD_RESPONSE,t,Qe);yield hm}}we=so.Readable.from(jo(),{objectMode:!1})}tr.data=we,No(r,o,tr)}else{let rt=[],$r=0;we.on("data",function(Ft){if(rt.push(Ft),$r+=Ft.length,t.maxContentLength>-1&&$r>t.maxContentLength)y=!0,we.destroy(),v(new G("maxContentLength size of "+t.maxContentLength+" exceeded",G.ERR_BAD_RESPONSE,t,Qe))}),we.on("aborted",function(){if(y)return;let Ft=new G("stream has been aborted",G.ERR_BAD_RESPONSE,t,Qe);we.destroy(Ft),o(Ft)}),we.on("error",function(Ft){if(S.destroyed)return;o(G.from(Ft,null,t,Qe))}),we.on("end",function(){try{let Ft=rt.length===1?rt[0]:Buffer.concat(rt);if(f!=="arraybuffer"){if(Ft=Ft.toString(m),!m||m==="utf8")Ft=w.stripBOM(Ft)}tr.data=Ft}catch(Ft){return o(G.from(Ft,null,t,tr.request,tr))}No(r,o,tr)})}x.once("abort",(rt)=>{if(!we.destroyed)we.emit("error",rt),we.destroy()})}),x.once("abort",(re)=>{if(S.close)S.close();else S.destroy(re)}),S.on("error",function(Q){o(G.from(Q,null,t,S))}),S.on("socket",function(Q){if(Q.setKeepAlive(!0,60000),!Q[_H])Q.on("error",function(Ue){let we=Q[a_];if(we&&!we.destroyed)we.destroy(Ue)}),Q[_H]=!0;Q[a_]=S,S.once("close",function(){if(Q[a_]===S)Q[a_]=null})}),t.timeout){let re=parseInt(t.timeout,10);if(Number.isNaN(re)){v(new G("error trying to parse `config.timeout` to int",G.ERR_BAD_OPTION_VALUE,t,S));return}S.setTimeout(re,function(){if(_)return;let ee=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",Ue=t.transitional||Qs;if(t.timeoutErrorMessage)ee=t.timeoutErrorMessage;v(new G(ee,Ue.clarifyTimeoutError?G.ETIMEDOUT:G.ECONNABORTED,t,S))})}else S.setTimeout(0);if(w.isStream(a)){let re=!1,Q=!1;a.on("end",()=>{re=!0}),a.once("error",(Ue)=>{Q=!0,S.destroy(Ue)}),a.on("close",()=>{if(!re&&!Q)v(new gr("Request stream has been aborted",t,S))});let ee=a;if(t.maxBodyLength>-1&&t.maxRedirects===0){let Ue=t.maxBodyLength,we=0;ee=so.pipeline([a,new so.Transform({transform(Qe,tr,rt){if(we+=Qe.length,we>Ue)return rt(new G("Request body larger than maxBodyLength limit",G.ERR_BAD_REQUEST,t,S));rt(null,Qe)}})],w.noop),ee.on("error",(Qe)=>{if(!S.destroyed)S.destroy(Qe)})}ee.pipe(S)}else a&&S.write(a),S.end()})}});var CH;var RH=O(()=>{oo();CH=qe.hasStandardBrowserEnv?((e,t)=>(n)=>(n=new URL(n,qe.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(qe.origin),qe.navigator&&/(msie|trident)/i.test(qe.navigator.userAgent)):()=>!0});var OH;var PH=O(()=>{ut();oo();OH=qe.hasStandardBrowserEnv?{write(e,t,n,r,o,s,i){if(typeof document>"u")return;let a=[`${e}=${encodeURIComponent(t)}`];if(w.isNumber(n))a.push(`expires=${new Date(n).toUTCString()}`);if(w.isString(r))a.push(`path=${r}`);if(w.isString(o))a.push(`domain=${o}`);if(s===!0)a.push("secure");if(w.isString(i))a.push(`SameSite=${i}`);document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;let t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-86400000,"/")}}:{write(){},read(){return null},remove(){}}});function io(e,t){t=t||{};let n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(l,u,p,f){if(w.isPlainObject(l)&&w.isPlainObject(u))return w.merge.call({caseless:f},l,u);else if(w.isPlainObject(u))return w.merge({},u);else if(w.isArray(u))return u.slice();return u}function o(l,u,p,f){if(!w.isUndefined(u))return r(l,u,p,f);else if(!w.isUndefined(l))return r(void 0,l,p,f)}function s(l,u){if(!w.isUndefined(u))return r(void 0,u)}function i(l,u){if(!w.isUndefined(u))return r(void 0,u);else if(!w.isUndefined(l))return r(void 0,l)}function a(l,u,p){if(w.hasOwnProp(t,p))return r(l,u);else if(w.hasOwnProp(e,p))return r(void 0,l)}let c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,allowedSocketPaths:i,responseEncoding:i,validateStatus:a,headers:(l,u,p)=>o(IH(l),IH(u),p,!0)};return w.forEach(Object.keys({...e,...t}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;let p=w.hasOwnProp(c,u)?c[u]:o,f=w.hasOwnProp(e,u)?e[u]:void 0,m=w.hasOwnProp(t,u)?t[u]:void 0,h=p(f,m,u);w.isUndefined(h)&&p!==a||(n[u]=h)}),n}var IH=(e)=>e instanceof At?{...e}:e;var c_=O(()=>{ut();Mo()});var l_=(e)=>{let t=io({},e),n=(f)=>w.hasOwnProp(t,f)?t[f]:void 0,r=n("data"),o=n("withXSRFToken"),s=n("xsrfHeaderName"),i=n("xsrfCookieName"),a=n("headers"),c=n("auth"),l=n("baseURL"),u=n("allowAbsoluteUrls"),p=n("url");if(t.headers=a=At.from(a),t.url=oa(ia(l,p,u),e.params,e.paramsSerializer),c)a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));if(w.isFormData(r)){if(qe.hasStandardBrowserEnv||qe.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(w.isFunction(r.getHeaders)){let f=r.getHeaders(),m=["content-type","content-length"];Object.entries(f).forEach(([h,_])=>{if(m.includes(h.toLowerCase()))a.set(h,_)})}}if(qe.hasStandardBrowserEnv){if(w.isFunction(o))o=o(t);if(o===!0||o==null&&CH(t.url)){let m=s&&i&&OH.read(i);if(m)a.set(s,m)}}return t};var ik=O(()=>{oo();ut();RH();PH();Xg();c_();Mo();qg()});var i_e,DH;var LH=O(()=>{ut();Jg();Mp();hr();sa();oo();Mo();i_();ik();i_e=typeof XMLHttpRequest<"u",DH=i_e&&function(e){return new Promise(function(n,r){let o=l_(e),s=o.data,i=At.from(o.headers).normalize(),{responseType:a,onUploadProgress:c,onDownloadProgress:l}=o,u,p,f,m,h;function _(){m&&m(),h&&h(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let y=new XMLHttpRequest;y.open(o.method.toUpperCase(),o.url,!0),y.timeout=o.timeout;function S(){if(!y)return;let x=At.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),T={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:x,config:e,request:y};No(function(M){n(M),_()},function(M){r(M),_()},T),y=null}if("onloadend"in y)y.onloadend=S;else y.onreadystatechange=function(){if(!y||y.readyState!==4)return;if(y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0))return;setTimeout(S)};if(y.onabort=function(){if(!y)return;r(new G("Request aborted",G.ECONNABORTED,e,y)),y=null},y.onerror=function(v){let T=v&&v.message?v.message:"Network Error",U=new G(T,G.ERR_NETWORK,e,y);U.event=v||null,r(U),y=null},y.ontimeout=function(){let v=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded",T=o.transitional||Qs;if(o.timeoutErrorMessage)v=o.timeoutErrorMessage;r(new G(v,T.clarifyTimeoutError?G.ETIMEDOUT:G.ECONNABORTED,e,y)),y=null},s===void 0&&i.setContentType(null),"setRequestHeader"in y)w.forEach(i.toJSON(),function(v,T){y.setRequestHeader(T,v)});if(!w.isUndefined(o.withCredentials))y.withCredentials=!!o.withCredentials;if(a&&a!=="json")y.responseType=o.responseType;if(l)[f,h]=os(l,!0),y.addEventListener("progress",f);if(c&&y.upload)[p,m]=os(c),y.upload.addEventListener("progress",p),y.upload.addEventListener("loadend",m);if(o.cancelToken||o.signal){if(u=(x)=>{if(!y)return;r(!x||x.type?new gr(null,e,y):x),y.abort(),y=null},o.cancelToken&&o.cancelToken.subscribe(u),o.signal)o.signal.aborted?u():o.signal.addEventListener("abort",u)}let b=Kp(o.url);if(b&&qe.protocols.indexOf(b)===-1){r(new G("Unsupported protocol "+b+":",G.ERR_BAD_REQUEST,e));return}y.send(s||null)})}});var a_e=(e,t)=>{let{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o,s=function(l){if(!o){o=!0,a();let u=l instanceof Error?l:this.reason;r.abort(u instanceof G?u:new gr(u instanceof Error?u.message:u))}},i=t&&setTimeout(()=>{i=null,s(new G(`timeout of ${t}ms exceeded`,G.ETIMEDOUT))},t),a=()=>{if(e)i&&clearTimeout(i),i=null,e.forEach((l)=>{l.unsubscribe?l.unsubscribe(s):l.removeEventListener("abort",s)}),e=null};e.forEach((l)=>l.addEventListener("abort",s));let{signal:c}=r;return c.unsubscribe=()=>w.asap(a),c}},MH;var NH=O(()=>{sa();hr();ut();MH=a_e});var c_e=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,o;while(r<n)o=r+t,yield e.slice(r,o),r=o},l_e=async function*(e,t){for await(let n of u_e(e))yield*c_e(n,t)},u_e=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},ak=(e,t,n,r)=>{let o=l_e(e,t),s=0,i,a=(c)=>{if(!i)i=!0,r&&r(c)};return new ReadableStream({async pull(c){try{let{done:l,value:u}=await o.next();if(l){a(),c.close();return}let p=u.byteLength;if(n){let f=s+=p;n(f)}c.enqueue(new Uint8Array(u))}catch(l){throw a(l),l}},cancel(c){return a(c),o.return()}},{highWaterMark:2})};var UH=65536,u_,d_e,FH,zH,$H=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},p_e=(e)=>{e=w.merge.call({skipUndefined:!0},d_e,e);let{fetch:t,Request:n,Response:r}=e,o=t?u_(t):typeof fetch==="function",s=u_(n),i=u_(r);if(!o)return!1;let a=o&&u_(FH),c=o&&(typeof zH==="function"?((h)=>(_)=>h.encode(_))(new zH):async(h)=>new Uint8Array(await new n(h).arrayBuffer())),l=s&&a&&$H(()=>{let h=!1,_=new n(qe.origin,{body:new FH,method:"POST",get duplex(){return h=!0,"half"}}),y=_.headers.has("Content-Type");if(_.body!=null)_.body.cancel();return h&&!y}),u=i&&a&&$H(()=>w.isReadableStream(new r("").body)),p={stream:u&&((h)=>h.body)};o&&(()=>{["text","arrayBuffer","blob","formData","stream"].forEach((h)=>{!p[h]&&(p[h]=(_,y)=>{let S=_&&_[h];if(S)return S.call(_);throw new G(`Response type '${h}' is not supported`,G.ERR_NOT_SUPPORT,y)})})})();let f=async(h)=>{if(h==null)return 0;if(w.isBlob(h))return h.size;if(w.isSpecCompliantForm(h))return(await new n(qe.origin,{method:"POST",body:h}).arrayBuffer()).byteLength;if(w.isArrayBufferView(h)||w.isArrayBuffer(h))return h.byteLength;if(w.isURLSearchParams(h))h=h+"";if(w.isString(h))return(await c(h)).byteLength},m=async(h,_)=>{let y=w.toFiniteNumber(h.getContentLength());return y==null?f(_):y};return async(h)=>{let{url:_,method:y,data:S,signal:b,cancelToken:x,timeout:v,onDownloadProgress:T,onUploadProgress:U,responseType:M,headers:F,withCredentials:W="same-origin",fetchOptions:ce}=l_(h),ne=t||fetch;M=M?(M+"").toLowerCase():"text";let se=MH([b,x&&x.toAbortSignal()],v),Se=null,Te=se&&se.unsubscribe&&(()=>{se.unsubscribe()}),St;try{if(U&&l&&y!=="get"&&y!=="head"&&(St=await m(F,S))!==0){let Tt=new n(_,{method:"POST",body:S,duplex:"half"}),re;if(w.isFormData(S)&&(re=Tt.headers.get("content-type")))F.setContentType(re);if(Tt.body){let[Q,ee]=vl(St,os(wl(U)));S=ak(Tt.body,UH,Q,ee)}}if(!w.isString(W))W=W?"include":"omit";let Y=s&&"credentials"in n.prototype;if(w.isFormData(S)){let Tt=F.getContentType();if(Tt&&/^multipart\/form-data/i.test(Tt)&&!/boundary=/i.test(Tt))F.delete("content-type")}let Ye={...ce,signal:se,method:y.toUpperCase(),headers:F.normalize().toJSON(),body:S,duplex:"half",credentials:Y?W:void 0};Se=s&&new n(_,Ye);let Et=await(s?ne(Se,ce):ne(_,Ye)),ht=u&&(M==="stream"||M==="response");if(u&&(T||ht&&Te)){let Tt={};["status","statusText","headers"].forEach((Ue)=>{Tt[Ue]=Et[Ue]});let re=w.toFiniteNumber(Et.headers.get("content-length")),[Q,ee]=T&&vl(re,os(wl(T),!0))||[];Et=new r(ak(Et.body,UH,Q,()=>{ee&&ee(),Te&&Te()}),Tt)}M=M||"text";let er=await p[w.findKey(p,M)||"text"](Et,h);return!ht&&Te&&Te(),await new Promise((Tt,re)=>{No(Tt,re,{data:er,headers:At.from(Et.headers),status:Et.status,statusText:Et.statusText,config:h,request:Se})})}catch(Y){if(Te&&Te(),Y&&Y.name==="TypeError"&&/Load failed|fetch/i.test(Y.message))throw Object.assign(new G("Network Error",G.ERR_NETWORK,h,Se,Y&&Y.response),{cause:Y.cause||Y});throw G.from(Y,Y&&Y.code,h,Se,Y&&Y.response)}}},f_e,ck=(e)=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:o}=t,s=[r,o,n],i=s.length,a=i,c,l,u=f_e;while(a--)c=s[a],l=u.get(c),l===void 0&&u.set(c,l=a?new Map:p_e(t)),u=l;return l},zht;var jH=O(()=>{oo();ut();hr();NH();Mo();i_();ik();Jg();({isFunction:u_}=w),d_e=(({Request:e,Response:t})=>({Request:e,Response:t}))(w.global),{ReadableStream:FH,TextEncoder:zH}=w.global,f_e=new Map,zht=ck()});function g_e(e,t){e=w.isArray(e)?e:[e];let{length:n}=e,r,o,s={};for(let i=0;i<n;i++){r=e[i];let a;if(o=r,!h_e(r)){if(o=lk[(a=String(r)).toLowerCase()],o===void 0)throw new G(`Unknown adapter '${a}'`)}if(o&&(w.isFunction(o)||(o=o.get(t))))break;s[a||"#"+i]=o}if(!o){let i=Object.entries(s).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build")),a=n?i.length>1?`since :
`+i.map(HH).join(`
`):" "+HH(i[0]):"as no adapter specified";throw new G("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}var lk,HH=(e)=>`- ${e}`,h_e=(e)=>w.isFunction(e)||e===null||e===!1,d_;var uk=O(()=>{ut();kH();LH();jH();hr();lk={http:TH,xhr:DH,fetch:{get:ck}};w.forEach(lk,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}});d_={getAdapter:g_e,adapters:lk}});function dk(e){if(e.cancelToken)e.cancelToken.throwIfRequested();if(e.signal&&e.signal.aborted)throw new gr(null,e)}function p_(e){if(dk(e),e.headers=At.from(e.headers),e.data=Fp.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1)e.headers.setContentType("application/x-www-form-urlencoded",!1);return d_.getAdapter(e.adapter||bl.adapter,e)(e).then(function(r){return dk(e),r.data=Fp.call(e,e.transformResponse,r),r.headers=At.from(r.headers),r},function(r){if(!zp(r)){if(dk(e),r&&r.response)r.response.data=Fp.call(e,e.transformResponse,r.response),r.response.headers=At.from(r.response.headers)}return Promise.reject(r)})}var BH=O(()=>{x1();Zg();sa();Mo();uk()});function __e(e,t,n){if(typeof e!=="object")throw new G("options must be an object",G.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),o=r.length;while(o-- >0){let s=r[o],i=Object.prototype.hasOwnProperty.call(t,s)?t[s]:void 0;if(i){let a=e[s],c=a===void 0||i(a,s,e);if(c!==!0)throw new G("option "+s+" must be "+c,G.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new G("Unknown option "+s,G.ERR_BAD_OPTION)}}var f_,KH,Wp;var GH=O(()=>{hr();f_={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{f_[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});KH={};f_.transitional=function(t,n,r){function o(s,i){return"[Axios v"+da+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,a)=>{if(t===!1)throw new G(o(i," has been removed"+(n?" in "+n:"")),G.ERR_DEPRECATED);if(n&&!KH[i])KH[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"));return t?t(s,i,a):!0}};f_.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};Wp={assertOptions:__e,validators:f_}});class qp{constructor(e){this.defaults=e||{},this.interceptors={request:new kT,response:new kT}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=Error();let o=(()=>{if(!r.stack)return"";let s=r.stack.indexOf(`
`);return s===-1?"":r.stack.slice(s+1)})();try{if(!n.stack)n.stack=o;else if(o){let s=o.indexOf(`
`),i=s===-1?-1:o.indexOf(`
`,s+1),a=i===-1?"":o.slice(i+1);if(!String(n.stack).endsWith(a))n.stack+=`
`+o}}catch(s){}}throw n}}_request(e,t){if(typeof e==="string")t=t||{},t.url=e;else t=e||{};t=io(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:o}=t;if(n!==void 0)Wp.assertOptions(n,{silentJSONParsing:Ir.transitional(Ir.boolean),forcedJSONParsing:Ir.transitional(Ir.boolean),clarifyTimeoutError:Ir.transitional(Ir.boolean),legacyInterceptorReqResOrdering:Ir.transitional(Ir.boolean)},!1);if(r!=null)if(w.isFunction(r))t.paramsSerializer={serialize:r};else Wp.assertOptions(r,{encode:Ir.function,serialize:Ir.function},!0);if(t.allowAbsoluteUrls!==void 0);else if(this.defaults.allowAbsoluteUrls!==void 0)t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls;else t.allowAbsoluteUrls=!0;Wp.assertOptions(t,{baseUrl:Ir.spelling("baseURL"),withXsrfToken:Ir.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&w.merge(o.common,o[t.method]);o&&w.forEach(["delete","get","head","post","put","patch","common"],(m)=>{delete o[m]}),t.headers=At.concat(s,o);let i=[],a=!0;this.interceptors.request.forEach(function(h){if(typeof h.runWhen==="function"&&h.runWhen(t)===!1)return;a=a&&h.synchronous;let _=t.transitional||Qs;if(_&&_.legacyInterceptorReqResOrdering)i.unshift(h.fulfilled,h.rejected);else i.push(h.fulfilled,h.rejected)});let c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let l,u=0,p;if(!a){let m=[p_.bind(this),void 0];m.unshift(...i),m.push(...c),p=m.length,l=Promise.resolve(t);while(u<p)l=l.then(m[u++],m[u++]);return l}p=i.length;let f=t;while(u<p){let m=i[u++],h=i[u++];try{f=m(f)}catch(_){h.call(this,_);break}}try{l=p_.call(this,f)}catch(m){return Promise.reject(m)}u=0,p=c.length;while(u<p)l=l.then(c[u++],c[u++]);return l}getUri(e){e=io(this.defaults,e);let t=ia(e.baseURL,e.url,e.allowAbsoluteUrls);return oa(t,e.params,e.paramsSerializer)}}var Ir,Vp;var WH=O(()=>{ut();qg();u1();BH();c_();Xg();GH();Mo();Mp();Ir=Wp.validators;w.forEach(["delete","get","head","options"],function(t){qp.prototype[t]=function(n,r){return this.request(io(r||{},{method:t,url:n,data:(r||{}).data}))}});w.forEach(["post","put","patch"],function(t){function n(r){return function(s,i,a){return this.request(io(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}qp.prototype[t]=n(),qp.prototype[t+"Form"]=n(!0)});Vp=qp});class pk{constructor(e){if(typeof e!=="function")throw TypeError("executor must be a function.");let t;this.promise=new Promise(function(o){t=o});let n=this;this.promise.then((r)=>{if(!n._listeners)return;let o=n._listeners.length;while(o-- >0)n._listeners[o](r);n._listeners=null}),this.promise.then=(r)=>{let o,s=new Promise((i)=>{n.subscribe(i),o=i}).then(r);return s.cancel=function(){n.unsubscribe(o)},s},e(function(o,s,i){if(n.reason)return;n.reason=new gr(o,s,i),t(n.reason)})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}if(this._listeners)this._listeners.push(e);else this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);if(t!==-1)this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=(n)=>{e.abort(n)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new pk(function(r){e=r}),cancel:e}}}var qH;var VH=O(()=>{sa();qH=pk});function fk(e){return function(n){return e.apply(null,n)}}function mk(e){return w.isObject(e)&&e.isAxiosError===!0}var ZH=O(()=>{ut()});var hk,YH;var JH=O(()=>{hk={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(hk).forEach(([e,t])=>{hk[t]=e});YH=hk});function XH(e){let t=new Vp(e),n=kp(Vp.prototype.request,t);return w.extend(n,Vp.prototype,t,{allOwnKeys:!0}),w.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return XH(io(e,o))},n}var Bt,_r;var QH=O(()=>{ut();WH();c_();Zg();DT();sa();VH();Lp();hr();ZH();Mo();uk();JH();Bt=XH(bl);Bt.Axios=Vp;Bt.CanceledError=gr;Bt.CancelToken=qH;Bt.isCancel=zp;Bt.VERSION=da;Bt.toFormData=Xs;Bt.AxiosError=G;Bt.Cancel=Bt.CanceledError;Bt.all=function(t){return Promise.all(t)};Bt.spread=fk;Bt.isAxiosError=mk;Bt.mergeConfig=io;Bt.AxiosHeaders=At;Bt.formToJSON=(e)=>Vg(w.isHTMLForm(e)?new FormData(e):e);Bt.getAdapter=d_.getAdapter;Bt.HttpStatusCode=YH;Bt.default=Bt;_r=Bt});var Ngt,Ugt,Fgt,eB,zgt,$gt,jgt,Hgt,m_,Bgt,Kgt,Ggt,Wgt,qgt,Vgt,Zgt;var h_=O(()=>{QH();({Axios:Ngt,AxiosError:Ugt,CanceledError:Fgt,isCancel:eB,CancelToken:zgt,VERSION:$gt,all:jgt,Cancel:Hgt,isAxiosError:m_,spread:Bgt,toFormData:Kgt,AxiosHeaders:Ggt,HttpStatusCode:Wgt,formToJSON:qgt,getAdapter:Vgt,mergeConfig:Zgt}=_r)});function b_e(e){let t,n=e.startsWith("//")?`https:${e}`:e;try{t=new URL(n).hostname}catch{t=e.match(/^[^/:]+/)?.[0]??e}return t.endsWith(".")?t.slice(0,-1):t}function tB(e){return y_e.test(b_e(e))}var y_e;var nB=O(()=>{y_e=/(^|\.)(anthropic\.com|claude\.ai|claude\.com)$/i});function rB(e){return S_e.has(e)||E_e.test(e)}var S_e,E_e;var oB=O(()=>{S_e=new Set(["localhost","::1","[::1]"]),E_e=/^127(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}$/});function x_e(){return Re(process.env.CLAUDE_CODE_TEST_ALLOW_REAL_NETWORK)}function sB(e,t){return`[CLAUDE_CODE_TEST_ALLOW_REAL_NETWORK] live request from a test runtime: ${e} ${t}
`}function iB(e){let t;try{t=rB(new URL(e).hostname)}catch{t=!1}if(t)return"loopback";return x_e()?"opted-in":"refused"}function gk(e,t){return`Blocked under test: ${e} ${t} — test runtimes must not reach the network. `+"Run the file via `bun run test:file -- <path>` with this request mocked, or set CLAUDE_CODE_TEST_ALLOW_REAL_NETWORK=1 for an intentional live probe."}function aB(e){let t=_r.getUri(e),n=(e.method??"get").toUpperCase();switch(iB(t)){case"loopback":return v_e(e,n);case"opted-in":return process.stderr.write(sB(n,t)),e;case"refused":throw new _k(gk(n,t))}}function v_e(e,t){let n=e.beforeRedirect;return e.beforeRedirect=(r,o)=>{let s=typeof r.href==="string"?r.href:"";switch(iB(s)){case"loopback":break;case"opted-in":process.stderr.write(sB(t,s));break;case"refused":throw process.stderr.write(`${gk(t,s)}
`),new _k(gk(t,s))}n?.(r,o)},e}function w_e(){if(!A_e())_r.interceptors.request.use(aB)}function A_e(){return _r.interceptors.request.handlers?.some((e)=>e?.fulfilled===aB)??!1}function fa(){return}var _k,n_t;var cB=O(()=>{Iu();h_();oB();_k=class _k extends Error{name="TestEgressBlockedError";code="TestEgressBlocked"};n_t=globalThis.fetch});var lB={};Xt(lB,{externalHttp:()=>C_e,isAxiosError:()=>m_,isCancel:()=>eB,isTransportError:()=>k_e});function k_e(e){return m_(e)&&e.response===void 0&&!T_e.has(e.code??"")}function Al(e,t){for(let n of[e,t?.baseURL])if(n&&tB(n))throw Error(`externalHttp: ${n} is Anthropic-operated. Use firstPartyApi from `+"src/services/http/firstParty — it enforces the 3P data-residency gate.")}var T_e,C_e;var uB=O(()=>{h_();nB();cB();h_();T_e=new Set(["ERR_BAD_OPTION","ERR_BAD_OPTION_VALUE","ERR_BAD_REQUEST","ERR_BAD_RESPONSE","ERR_CANCELED","ERR_DEPRECATED","ERR_FORM_DATA_DEPTH_EXCEEDED","ERR_FR_MAX_BODY_LENGTH_EXCEEDED","ERR_FR_TOO_MANY_REDIRECTS","ERR_INVALID_URL","ERR_NOT_SUPPORT","ERR_STREAM_WRITE_AFTER_END"]);C_e={get(e,t){return Al(e,t),fa(),_r.get(e,t)},head(e,t){return Al(e,t),fa(),_r.head(e,t)},post(e,t,n){return Al(e,n),fa(),_r.post(e,t,n)},put(e,t,n){return Al(e,n),fa(),_r.put(e,t,n)},patch(e,t,n){return Al(e,n),fa(),_r.patch(e,t,n)},delete(e,t){return Al(e,t),fa(),_r.delete(e,t)}}});var DB=k(function(PB){Object.defineProperty(PB,"__esModule",{value:!0});PB._globalThis=void 0;PB._globalThis=typeof globalThis==="object"?globalThis:global});var LB=k(function(ma){var qIe=ma&&ma.__createBinding||(Object.create?function(e,t,n,r){if(r===void 0)r=n;Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){if(r===void 0)r=n;e[r]=t[n]}),VIe=ma&&ma.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))qIe(t,e,n)};Object.defineProperty(ma,"__esModule",{value:!0});VIe(DB(),ma)});var MB=k(function(ha){var ZIe=ha&&ha.__createBinding||(Object.create?function(e,t,n,r){if(r===void 0)r=n;Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){if(r===void 0)r=n;e[r]=t[n]}),YIe=ha&&ha.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))ZIe(t,e,n)};Object.defineProperty(ha,"__esModule",{value:!0});YIe(LB(),ha)});var Mk=k(function(NB){Object.defineProperty(NB,"__esModule",{value:!0});NB.VERSION=void 0;NB.VERSION="1.9.0"});var HB=k(function($B){Object.defineProperty($B,"__esModule",{value:!0});$B.isCompatible=$B._makeCompatibilityCheck=void 0;var JIe=Mk(),FB=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function zB(e){let t=new Set([e]),n=new Set,r=e.match(FB);if(!r)return()=>!1;let o={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(o.prerelease!=null)return function(c){return c===e};function s(a){return n.add(a),!1}function i(a){return t.add(a),!0}return function(c){if(t.has(c))return!0;if(n.has(c))return!1;let l=c.match(FB);if(!l)return s(c);let u={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};if(u.prerelease!=null)return s(c);if(o.major!==u.major)return s(c);if(o.major===0){if(o.minor===u.minor&&o.patch<=u.patch)return i(c);return s(c)}if(o.minor<=u.minor)return i(c);return s(c)}}$B._makeCompatibilityCheck=zB;$B.isCompatible=zB(JIe.VERSION)});var ga=k(function(BB){Object.defineProperty(BB,"__esModule",{value:!0});BB.unregisterGlobal=BB.getGlobal=BB.registerGlobal=void 0;var QIe=MB(),Pl=Mk(),eDe=HB(),tDe=Pl.VERSION.split(".")[0],Qp=Symbol.for(`opentelemetry.js.api.${tDe}`),ef=QIe._globalThis;function nDe(e,t,n,r=!1){var o;let s=ef[Qp]=(o=ef[Qp])!==null&&o!==void 0?o:{version:Pl.VERSION};if(!r&&s[e]){let i=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(i.stack||i.message),!1}if(s.version!==Pl.VERSION){let i=Error(`@opentelemetry/api: Registration of version v${s.version} for ${e} does not match previously registered API v${Pl.VERSION}`);return n.error(i.stack||i.message),!1}return s[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${Pl.VERSION}.`),!0}BB.registerGlobal=nDe;function rDe(e){var t,n;let r=(t=ef[Qp])===null||t===void 0?void 0:t.version;if(!r||!(0,eDe.isCompatible)(r))return;return(n=ef[Qp])===null||n===void 0?void 0:n[e]}BB.getGlobal=rDe;function oDe(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${Pl.VERSION}.`);let n=ef[Qp];if(n)delete n[e]}BB.unregisterGlobal=oDe});var VB=k(function(WB){Object.defineProperty(WB,"__esModule",{value:!0});WB.DiagComponentLogger=void 0;var aDe=ga();class GB{constructor(e){this._namespace=e.namespace||"DiagComponentLogger"}debug(...e){return tf("debug",this._namespace,e)}error(...e){return tf("error",this._namespace,e)}info(...e){return tf("info",this._namespace,e)}warn(...e){return tf("warn",this._namespace,e)}verbose(...e){return tf("verbose",this._namespace,e)}}WB.DiagComponentLogger=GB;function tf(e,t,n){let r=(0,aDe.getGlobal)("diag");if(!r)return;return n.unshift(t),r[e](...n)}});var S_=k(function(ZB){Object.defineProperty(ZB,"__esModule",{value:!0});ZB.DiagLogLevel=void 0;var cDe;(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(cDe=ZB.DiagLogLevel||(ZB.DiagLogLevel={}))});var XB=k(function(YB){Object.defineProperty(YB,"__esModule",{value:!0});YB.createLogLevelDiagLogger=void 0;var ss=S_();function lDe(e,t){if(e<ss.DiagLogLevel.NONE)e=ss.DiagLogLevel.NONE;else if(e>ss.DiagLogLevel.ALL)e=ss.DiagLogLevel.ALL;t=t||{};function n(r,o){let s=t[r];if(typeof s==="function"&&e>=o)return s.bind(t);return function(){}}return{error:n("error",ss.DiagLogLevel.ERROR),warn:n("warn",ss.DiagLogLevel.WARN),info:n("info",ss.DiagLogLevel.INFO),debug:n("debug",ss.DiagLogLevel.DEBUG),verbose:n("verbose",ss.DiagLogLevel.VERBOSE)}}YB.createLogLevelDiagLogger=lDe});var _a=k(function(e2){Object.defineProperty(e2,"__esModule",{value:!0});e2.DiagAPI=void 0;var uDe=VB(),dDe=XB(),QB=S_(),E_=ga(),pDe="diag";class Uk{constructor(){function e(r){return function(...o){let s=(0,E_.getGlobal)("diag");if(!s)return;return s[r](...o)}}let t=this,n=(r,o={logLevel:QB.DiagLogLevel.INFO})=>{var s,i,a;if(r===t){let u=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error((s=u.stack)!==null&&s!==void 0?s:u.message),!1}if(typeof o==="number")o={logLevel:o};let c=(0,E_.getGlobal)("diag"),l=(0,dDe.createLogLevelDiagLogger)((i=o.logLevel)!==null&&i!==void 0?i:QB.DiagLogLevel.INFO,r);if(c&&!o.suppressOverrideMessage){let u=(a=Error().stack)!==null&&a!==void 0?a:"<failed to generate stacktrace>";c.warn(`Current logger will be overwritten from ${u}`),l.warn(`Current logger will overwrite one already registered from ${u}`)}return(0,E_.registerGlobal)("diag",l,t,!0)};t.setLogger=n,t.disable=()=>{(0,E_.unregisterGlobal)(pDe,t)},t.createComponentLogger=(r)=>new uDe.DiagComponentLogger(r),t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}static instance(){if(!this._instance)this._instance=new Uk;return this._instance}}e2.DiagAPI=Uk});var o2=k(function(n2){Object.defineProperty(n2,"__esModule",{value:!0});n2.BaggageImpl=void 0;class Il{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let t=this._entries.get(e);if(!t)return;return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries()).map(([e,t])=>[e,t])}setEntry(e,t){let n=new Il(this._entries);return n._entries.set(e,t),n}removeEntry(e){let t=new Il(this._entries);return t._entries.delete(e),t}removeEntries(...e){let t=new Il(this._entries);for(let n of e)t._entries.delete(n);return t}clear(){return new Il}}n2.BaggageImpl=Il});var a2=k(function(s2){Object.defineProperty(s2,"__esModule",{value:!0});s2.baggageEntryMetadataSymbol=void 0;s2.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")});var Fk=k(function(c2){Object.defineProperty(c2,"__esModule",{value:!0});c2.baggageEntryMetadataFromString=c2.createBaggage=void 0;var fDe=_a(),mDe=o2(),hDe=a2(),gDe=fDe.DiagAPI.instance();function _De(e={}){return new mDe.BaggageImpl(new Map(Object.entries(e)))}c2.createBaggage=_De;function yDe(e){if(typeof e!=="string")gDe.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e="";return{__TYPE__:hDe.baggageEntryMetadataSymbol,toString(){return e}}}c2.baggageEntryMetadataFromString=yDe});var nf=k(function(u2){Object.defineProperty(u2,"__esModule",{value:!0});u2.ROOT_CONTEXT=u2.createContextKey=void 0;function SDe(e){return Symbol.for(e)}u2.createContextKey=SDe;class x_{constructor(e){let t=this;t._currentContext=e?new Map(e):new Map,t.getValue=(n)=>t._currentContext.get(n),t.setValue=(n,r)=>{let o=new x_(t._currentContext);return o._currentContext.set(n,r),o},t.deleteValue=(n)=>{let r=new x_(t._currentContext);return r._currentContext.delete(n),r}}}u2.ROOT_CONTEXT=new x_});var h2=k(function(f2){Object.defineProperty(f2,"__esModule",{value:!0});f2.DiagConsoleLogger=void 0;var zk=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];class p2{constructor(){function e(t){return function(...n){if(console){let r=console[t];if(typeof r!=="function")r=console.log;if(typeof r==="function")return r.apply(console,n)}}}for(let t=0;t<zk.length;t++)this[zk[t].n]=e(zk[t].c)}}f2.DiagConsoleLogger=p2});var Vk=k(function(g2){Object.defineProperty(g2,"__esModule",{value:!0});g2.createNoopMeter=g2.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=g2.NOOP_OBSERVABLE_GAUGE_METRIC=g2.NOOP_OBSERVABLE_COUNTER_METRIC=g2.NOOP_UP_DOWN_COUNTER_METRIC=g2.NOOP_HISTOGRAM_METRIC=g2.NOOP_GAUGE_METRIC=g2.NOOP_COUNTER_METRIC=g2.NOOP_METER=g2.NoopObservableUpDownCounterMetric=g2.NoopObservableGaugeMetric=g2.NoopObservableCounterMetric=g2.NoopObservableMetric=g2.NoopHistogramMetric=g2.NoopGaugeMetric=g2.NoopUpDownCounterMetric=g2.NoopCounterMetric=g2.NoopMetric=g2.NoopMeter=void 0;class $k{constructor(){}createGauge(e,t){return g2.NOOP_GAUGE_METRIC}createHistogram(e,t){return g2.NOOP_HISTOGRAM_METRIC}createCounter(e,t){return g2.NOOP_COUNTER_METRIC}createUpDownCounter(e,t){return g2.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(e,t){return g2.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(e,t){return g2.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(e,t){return g2.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}}g2.NoopMeter=$k;class Dl{}g2.NoopMetric=Dl;class jk extends Dl{add(e,t){}}g2.NoopCounterMetric=jk;class Hk extends Dl{add(e,t){}}g2.NoopUpDownCounterMetric=Hk;class Bk extends Dl{record(e,t){}}g2.NoopGaugeMetric=Bk;class Kk extends Dl{record(e,t){}}g2.NoopHistogramMetric=Kk;class rf{addCallback(e){}removeCallback(e){}}g2.NoopObservableMetric=rf;class Gk extends rf{}g2.NoopObservableCounterMetric=Gk;class Wk extends rf{}g2.NoopObservableGaugeMetric=Wk;class qk extends rf{}g2.NoopObservableUpDownCounterMetric=qk;g2.NOOP_METER=new $k;g2.NOOP_COUNTER_METRIC=new jk;g2.NOOP_GAUGE_METRIC=new Bk;g2.NOOP_HISTOGRAM_METRIC=new Kk;g2.NOOP_UP_DOWN_COUNTER_METRIC=new Hk;g2.NOOP_OBSERVABLE_COUNTER_METRIC=new Gk;g2.NOOP_OBSERVABLE_GAUGE_METRIC=new Wk;g2.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new qk;function xDe(){return g2.NOOP_METER}g2.createNoopMeter=xDe});var k2=k(function(T2){Object.defineProperty(T2,"__esModule",{value:!0});T2.ValueType=void 0;var DDe;(function(e){e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE"})(DDe=T2.ValueType||(T2.ValueType={}))});var Yk=k(function(C2){Object.defineProperty(C2,"__esModule",{value:!0});C2.defaultTextMapSetter=C2.defaultTextMapGetter=void 0;C2.defaultTextMapGetter={get(e,t){if(e==null)return;return e[t]},keys(e){if(e==null)return[];return Object.keys(e)}};C2.defaultTextMapSetter={set(e,t,n){if(e==null)return;e[t]=n}}});var D2=k(function(P2){Object.defineProperty(P2,"__esModule",{value:!0});P2.NoopContextManager=void 0;var MDe=nf();class O2{active(){return MDe.ROOT_CONTEXT}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}}P2.NoopContextManager=O2});var of=k(function(M2){Object.defineProperty(M2,"__esModule",{value:!0});M2.ContextAPI=void 0;var NDe=D2(),Jk=ga(),L2=_a(),Xk="context",UDe=new NDe.NoopContextManager;class Qk{constructor(){}static getInstance(){if(!this._instance)this._instance=new Qk;return this._instance}setGlobalContextManager(e){return(0,Jk.registerGlobal)(Xk,e,L2.DiagAPI.instance())}active(){return this._getContextManager().active()}with(e,t,n,...r){return this._getContextManager().with(e,t,n,...r)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return(0,Jk.getGlobal)(Xk)||UDe}disable(){this._getContextManager().disable(),(0,Jk.unregisterGlobal)(Xk,L2.DiagAPI.instance())}}M2.ContextAPI=Qk});var tC=k(function(U2){Object.defineProperty(U2,"__esModule",{value:!0});U2.TraceFlags=void 0;var FDe;(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(FDe=U2.TraceFlags||(U2.TraceFlags={}))});var v_=k(function(F2){Object.defineProperty(F2,"__esModule",{value:!0});F2.INVALID_SPAN_CONTEXT=F2.INVALID_TRACEID=F2.INVALID_SPANID=void 0;var zDe=tC();F2.INVALID_SPANID="0000000000000000";F2.INVALID_TRACEID="00000000000000000000000000000000";F2.INVALID_SPAN_CONTEXT={traceId:F2.INVALID_TRACEID,spanId:F2.INVALID_SPANID,traceFlags:zDe.TraceFlags.NONE}});var w_=k(function(B2){Object.defineProperty(B2,"__esModule",{value:!0});B2.NonRecordingSpan=void 0;var $De=v_();class H2{constructor(e=$De.INVALID_SPAN_CONTEXT){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}}B2.NonRecordingSpan=H2});var oC=k(function(W2){Object.defineProperty(W2,"__esModule",{value:!0});W2.getSpanContext=W2.setSpanContext=W2.deleteSpan=W2.setSpan=W2.getActiveSpan=W2.getSpan=void 0;var jDe=nf(),HDe=w_(),BDe=of(),nC=(0,jDe.createContextKey)("OpenTelemetry Context Key SPAN");function rC(e){return e.getValue(nC)||void 0}W2.getSpan=rC;function KDe(){return rC(BDe.ContextAPI.getInstance().active())}W2.getActiveSpan=KDe;function G2(e,t){return e.setValue(nC,t)}W2.setSpan=G2;function GDe(e){return e.deleteValue(nC)}W2.deleteSpan=GDe;function WDe(e,t){return G2(e,new HDe.NonRecordingSpan(t))}W2.setSpanContext=WDe;function qDe(e){var t;return(t=rC(e))===null||t===void 0?void 0:t.spanContext()}W2.getSpanContext=qDe});var A_=k(function(J2){Object.defineProperty(J2,"__esModule",{value:!0});J2.wrapSpanContext=J2.isSpanContextValid=J2.isValidSpanId=J2.isValidTraceId=void 0;var V2=v_(),QDe=w_(),e0e=/^([0-9a-f]{32})$/i,t0e=/^[0-9a-f]{16}$/i;function Z2(e){return e0e.test(e)&&e!==V2.INVALID_TRACEID}J2.isValidTraceId=Z2;function Y2(e){return t0e.test(e)&&e!==V2.INVALID_SPANID}J2.isValidSpanId=Y2;function n0e(e){return Z2(e.traceId)&&Y2(e.spanId)}J2.isSpanContextValid=n0e;function r0e(e){return new QDe.NonRecordingSpan(e)}J2.wrapSpanContext=r0e});var aC=k(function(tK){Object.defineProperty(tK,"__esModule",{value:!0});tK.NoopTracer=void 0;var a0e=of(),Q2=oC(),sC=w_(),c0e=A_(),iC=a0e.ContextAPI.getInstance();class eK{startSpan(e,t,n=iC.active()){if(Boolean(t===null||t===void 0?void 0:t.root))return new sC.NonRecordingSpan;let o=n&&(0,Q2.getSpanContext)(n);if(l0e(o)&&(0,c0e.isSpanContextValid)(o))return new sC.NonRecordingSpan(o);else return new sC.NonRecordingSpan}startActiveSpan(e,t,n,r){let o,s,i;if(arguments.length<2)return;else if(arguments.length===2)i=t;else if(arguments.length===3)o=t,i=n;else o=t,s=n,i=r;let a=s!==null&&s!==void 0?s:iC.active(),c=this.startSpan(e,o,a),l=(0,Q2.setSpan)(a,c);return iC.with(l,i,void 0,c)}}tK.NoopTracer=eK;function l0e(e){return typeof e==="object"&&typeof e.spanId==="string"&&typeof e.traceId==="string"&&typeof e.traceFlags==="number"}});var cC=k(function(oK){Object.defineProperty(oK,"__esModule",{value:!0});oK.ProxyTracer=void 0;var u0e=aC(),d0e=new u0e.NoopTracer;class rK{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){let o=this._getTracer();return Reflect.apply(o.startActiveSpan,o,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);if(!e)return d0e;return this._delegate=e,this._delegate}}oK.ProxyTracer=rK});var lK=k(function(aK){Object.defineProperty(aK,"__esModule",{value:!0});aK.NoopTracerProvider=void 0;var p0e=aC();class iK{getTracer(e,t,n){return new p0e.NoopTracer}}aK.NoopTracerProvider=iK});var lC=k(function(dK){Object.defineProperty(dK,"__esModule",{value:!0});dK.ProxyTracerProvider=void 0;var f0e=cC(),m0e=lK(),h0e=new m0e.NoopTracerProvider;class uK{getTracer(e,t,n){var r;return(r=this.getDelegateTracer(e,t,n))!==null&&r!==void 0?r:new f0e.ProxyTracer(this,e,t,n)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:h0e}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){var r;return(r=this._delegate)===null||r===void 0?void 0:r.getTracer(e,t,n)}}dK.ProxyTracerProvider=uK});var mK=k(function(fK){Object.defineProperty(fK,"__esModule",{value:!0});fK.SamplingDecision=void 0;var g0e;(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(g0e=fK.SamplingDecision||(fK.SamplingDecision={}))});var gK=k(function(hK){Object.defineProperty(hK,"__esModule",{value:!0});hK.SpanKind=void 0;var _0e;(function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"})(_0e=hK.SpanKind||(hK.SpanKind={}))});var yK=k(function(_K){Object.defineProperty(_K,"__esModule",{value:!0});_K.SpanStatusCode=void 0;var y0e;(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(y0e=_K.SpanStatusCode||(_K.SpanStatusCode={}))});var EK=k(function(bK){Object.defineProperty(bK,"__esModule",{value:!0});bK.validateValue=bK.validateKey=void 0;var fC="[_0-9a-z-*/]",b0e=`[a-z]${fC}{0,255}`,S0e=`[a-z0-9]${fC}{0,240}@[a-z]${fC}{0,13}`,E0e=new RegExp(`^(?:${b0e}|${S0e})$`),x0e=/^[ -~]{0,255}[!-~]$/,v0e=/,|=/;function w0e(e){return E0e.test(e)}bK.validateKey=w0e;function A0e(e){return x0e.test(e)&&!v0e.test(e)}bK.validateValue=A0e});var CK=k(function(TK){Object.defineProperty(TK,"__esModule",{value:!0});TK.TraceStateImpl=void 0;var xK=EK(),vK=32,k0e=512,wK=",",AK="=";class mC{constructor(e){if(this._internalState=new Map,e)this._parse(e)}set(e,t){let n=this._clone();if(n._internalState.has(e))n._internalState.delete(e);return n._internalState.set(e,t),n}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+AK+this.get(t)),e),[]).join(wK)}_parse(e){if(e.length>k0e)return;if(this._internalState=e.split(wK).reverse().reduce((t,n)=>{let r=n.trim(),o=r.indexOf(AK);if(o!==-1){let s=r.slice(0,o),i=r.slice(o+1,n.length);if((0,xK.validateKey)(s)&&(0,xK.validateValue)(i))t.set(s,i)}return t},new Map),this._internalState.size>vK)this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,vK))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new mC;return e._internalState=new Map(this._internalState),e}}TK.TraceStateImpl=mC});var PK=k(function(RK){Object.defineProperty(RK,"__esModule",{value:!0});RK.createTraceState=void 0;var C0e=CK();function R0e(e){return new C0e.TraceStateImpl(e)}RK.createTraceState=R0e});var LK=k(function(IK){Object.defineProperty(IK,"__esModule",{value:!0});IK.context=void 0;var O0e=of();IK.context=O0e.ContextAPI.getInstance()});var UK=k(function(MK){Object.defineProperty(MK,"__esModule",{value:!0});MK.diag=void 0;var P0e=_a();MK.diag=P0e.DiagAPI.instance()});var $K=k(function(FK){Object.defineProperty(FK,"__esModule",{value:!0});FK.NOOP_METER_PROVIDER=FK.NoopMeterProvider=void 0;var I0e=Vk();class hC{getMeter(e,t,n){return I0e.NOOP_METER}}FK.NoopMeterProvider=hC;FK.NOOP_METER_PROVIDER=new hC});var KK=k(function(HK){Object.defineProperty(HK,"__esModule",{value:!0});HK.MetricsAPI=void 0;var L0e=$K(),gC=ga(),jK=_a(),_C="metrics";class yC{constructor(){}static getInstance(){if(!this._instance)this._instance=new yC;return this._instance}setGlobalMeterProvider(e){return(0,gC.registerGlobal)(_C,e,jK.DiagAPI.instance())}getMeterProvider(){return(0,gC.getGlobal)(_C)||L0e.NOOP_METER_PROVIDER}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){(0,gC.unregisterGlobal)(_C,jK.DiagAPI.instance())}}HK.MetricsAPI=yC});var qK=k(function(GK){Object.defineProperty(GK,"__esModule",{value:!0});GK.metrics=void 0;var M0e=KK();GK.metrics=M0e.MetricsAPI.getInstance()});var JK=k(function(ZK){Object.defineProperty(ZK,"__esModule",{value:!0});ZK.NoopTextMapPropagator=void 0;class VK{inject(e,t){}extract(e,t){return e}fields(){return[]}}ZK.NoopTextMapPropagator=VK});var tG=k(function(QK){Object.defineProperty(QK,"__esModule",{value:!0});QK.deleteBaggage=QK.setBaggage=QK.getActiveBaggage=QK.getBaggage=void 0;var N0e=of(),U0e=nf(),bC=(0,U0e.createContextKey)("OpenTelemetry Baggage Key");function XK(e){return e.getValue(bC)||void 0}QK.getBaggage=XK;function F0e(){return XK(N0e.ContextAPI.getInstance().active())}QK.getActiveBaggage=F0e;function z0e(e,t){return e.setValue(bC,t)}QK.setBaggage=z0e;function $0e(e){return e.deleteValue(bC)}QK.deleteBaggage=$0e});var iG=k(function(oG){Object.defineProperty(oG,"__esModule",{value:!0});oG.PropagationAPI=void 0;var SC=ga(),K0e=JK(),nG=Yk(),T_=tG(),G0e=Fk(),rG=_a(),EC="propagation",W0e=new K0e.NoopTextMapPropagator;class xC{constructor(){this.createBaggage=G0e.createBaggage,this.getBaggage=T_.getBaggage,this.getActiveBaggage=T_.getActiveBaggage,this.setBaggage=T_.setBaggage,this.deleteBaggage=T_.deleteBaggage}static getInstance(){if(!this._instance)this._instance=new xC;return this._instance}setGlobalPropagator(e){return(0,SC.registerGlobal)(EC,e,rG.DiagAPI.instance())}inject(e,t,n=nG.defaultTextMapSetter){return this._getGlobalPropagator().inject(e,t,n)}extract(e,t,n=nG.defaultTextMapGetter){return this._getGlobalPropagator().extract(e,t,n)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,SC.unregisterGlobal)(EC,rG.DiagAPI.instance())}_getGlobalPropagator(){return(0,SC.getGlobal)(EC)||W0e}}oG.PropagationAPI=xC});var lG=k(function(aG){Object.defineProperty(aG,"__esModule",{value:!0});aG.propagation=void 0;var q0e=iG();aG.propagation=q0e.PropagationAPI.getInstance()});var hG=k(function(fG){Object.defineProperty(fG,"__esModule",{value:!0});fG.TraceAPI=void 0;var vC=ga(),uG=lC(),dG=A_(),Ll=oC(),pG=_a(),wC="trace";class AC{constructor(){this._proxyTracerProvider=new uG.ProxyTracerProvider,this.wrapSpanContext=dG.wrapSpanContext,this.isSpanContextValid=dG.isSpanContextValid,this.deleteSpan=Ll.deleteSpan,this.getSpan=Ll.getSpan,this.getActiveSpan=Ll.getActiveSpan,this.getSpanContext=Ll.getSpanContext,this.setSpan=Ll.setSpan,this.setSpanContext=Ll.setSpanContext}static getInstance(){if(!this._instance)this._instance=new AC;return this._instance}setGlobalTracerProvider(e){let t=(0,vC.registerGlobal)(wC,this._proxyTracerProvider,pG.DiagAPI.instance());if(t)this._proxyTracerProvider.setDelegate(e);return t}getTracerProvider(){return(0,vC.getGlobal)(wC)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){(0,vC.unregisterGlobal)(wC,pG.DiagAPI.instance()),this._proxyTracerProvider=new uG.ProxyTracerProvider}}fG.TraceAPI=AC});var yG=k(function(gG){Object.defineProperty(gG,"__esModule",{value:!0});gG.trace=void 0;var V0e=hG();gG.trace=V0e.TraceAPI.getInstance()});var TG=k(function(tt){Object.defineProperty(tt,"__esModule",{value:!0});tt.trace=tt.propagation=tt.metrics=tt.diag=tt.context=tt.INVALID_SPAN_CONTEXT=tt.INVALID_TRACEID=tt.INVALID_SPANID=tt.isValidSpanId=tt.isValidTraceId=tt.isSpanContextValid=tt.createTraceState=tt.TraceFlags=tt.SpanStatusCode=tt.SpanKind=tt.SamplingDecision=tt.ProxyTracerProvider=tt.ProxyTracer=tt.defaultTextMapSetter=tt.defaultTextMapGetter=tt.ValueType=tt.createNoopMeter=tt.DiagLogLevel=tt.DiagConsoleLogger=tt.ROOT_CONTEXT=tt.createContextKey=tt.baggageEntryMetadataFromString=void 0;var Z0e=Fk();Object.defineProperty(tt,"baggageEntryMetadataFromString",{enumerable:!0,get:function(){return Z0e.baggageEntryMetadataFromString}});var bG=nf();Object.defineProperty(tt,"createContextKey",{enumerable:!0,get:function(){return bG.createContextKey}});Object.defineProperty(tt,"ROOT_CONTEXT",{enumerable:!0,get:function(){return bG.ROOT_CONTEXT}});var Y0e=h2();Object.defineProperty(tt,"DiagConsoleLogger",{enumerable:!0,get:function(){return Y0e.DiagConsoleLogger}});var J0e=S_();Object.defineProperty(tt,"DiagLogLevel",{enumerable:!0,get:function(){return J0e.DiagLogLevel}});var X0e=Vk();Object.defineProperty(tt,"createNoopMeter",{enumerable:!0,get:function(){return X0e.createNoopMeter}});var Q0e=k2();Object.defineProperty(tt,"ValueType",{enumerable:!0,get:function(){return Q0e.ValueType}});var SG=Yk();Object.defineProperty(tt,"defaultTextMapGetter",{enumerable:!0,get:function(){return SG.defaultTextMapGetter}});Object.defineProperty(tt,"defaultTextMapSetter",{enumerable:!0,get:function(){return SG.defaultTextMapSetter}});var eLe=cC();Object.defineProperty(tt,"ProxyTracer",{enumerable:!0,get:function(){return eLe.ProxyTracer}});var tLe=lC();Object.defineProperty(tt,"ProxyTracerProvider",{enumerable:!0,get:function(){return tLe.ProxyTracerProvider}});var nLe=mK();Object.defineProperty(tt,"SamplingDecision",{enumerable:!0,get:function(){return nLe.SamplingDecision}});var rLe=gK();Object.defineProperty(tt,"SpanKind",{enumerable:!0,get:function(){return rLe.SpanKind}});var oLe=yK();Object.defineProperty(tt,"SpanStatusCode",{enumerable:!0,get:function(){return oLe.SpanStatusCode}});var sLe=tC();Object.defineProperty(tt,"TraceFlags",{enumerable:!0,get:function(){return sLe.TraceFlags}});var iLe=PK();Object.defineProperty(tt,"createTraceState",{enumerable:!0,get:function(){return iLe.createTraceState}});var TC=A_();Object.defineProperty(tt,"isSpanContextValid",{enumerable:!0,get:function(){return TC.isSpanContextValid}});Object.defineProperty(tt,"isValidTraceId",{enumerable:!0,get:function(){return TC.isValidTraceId}});Object.defineProperty(tt,"isValidSpanId",{enumerable:!0,get:function(){return TC.isValidSpanId}});var kC=v_();Object.defineProperty(tt,"INVALID_SPANID",{enumerable:!0,get:function(){return kC.INVALID_SPANID}});Object.defineProperty(tt,"INVALID_TRACEID",{enumerable:!0,get:function(){return kC.INVALID_TRACEID}});Object.defineProperty(tt,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:function(){return kC.INVALID_SPAN_CONTEXT}});var EG=LK();Object.defineProperty(tt,"context",{enumerable:!0,get:function(){return EG.context}});var xG=UK();Object.defineProperty(tt,"diag",{enumerable:!0,get:function(){return xG.diag}});var vG=qK();Object.defineProperty(tt,"metrics",{enumerable:!0,get:function(){return vG.metrics}});var wG=lG();Object.defineProperty(tt,"propagation",{enumerable:!0,get:function(){return wG.propagation}});var AG=yG();Object.defineProperty(tt,"trace",{enumerable:!0,get:function(){return AG.trace}});tt.default={context:EG.context,diag:xG.diag,metrics:vG.metrics,propagation:wG.propagation,trace:AG.trace}});var Tf=k(function(EV){Object.defineProperty(EV,"__esModule",{value:!0});EV.regexpCode=EV.getEsmExportName=EV.getProperty=EV.safeStringify=EV.stringify=EV.strConcat=EV.addCodeArg=EV.str=EV._=EV.nil=EV._Code=EV.Name=EV.IDENTIFIER=EV._CodeOrName=void 0;class Sy{}EV._CodeOrName=Sy;EV.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Yl extends Sy{constructor(e){super();if(!EV.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}EV.Name=Yl;class po extends Sy{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,n)=>`${t}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,n)=>{if(n instanceof Yl)t[n.str]=(t[n.str]||0)+1;return t},{})}}EV._Code=po;EV.nil=new po("");function bV(e,...t){let n=[e[0]],r=0;while(r<t.length)bR(n,t[r]),n.push(e[++r]);return new po(n)}EV._=bV;var yR=new po("+");function SV(e,...t){let n=[Af(e[0])],r=0;while(r<t.length)n.push(yR),bR(n,t[r]),n.push(yR,Af(e[++r]));return OFe(n),new po(n)}EV.str=SV;function bR(e,t){if(t instanceof po)e.push(...t._items);else if(t instanceof Yl)e.push(t);else e.push(DFe(t))}EV.addCodeArg=bR;function OFe(e){let t=1;while(t<e.length-1){if(e[t]===yR){let n=PFe(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}function PFe(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof Yl||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof Yl))return`"${e}${t.slice(1)}`;return}function IFe(e,t){return t.emptyStr()?e:e.emptyStr()?t:SV`${e}${t}`}EV.strConcat=IFe;function DFe(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Af(Array.isArray(e)?e.join(","):e)}function LFe(e){return new po(Af(e))}EV.stringify=LFe;function Af(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}EV.safeStringify=Af;function MFe(e){return typeof e=="string"&&EV.IDENTIFIER.test(e)?new po(`.${e}`):bV`[${e}]`}EV.getProperty=MFe;function NFe(e){if(typeof e=="string"&&EV.IDENTIFIER.test(e))return new po(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}EV.getEsmExportName=NFe;function UFe(e){return new po(e.toString())}EV.regexpCode=UFe});var vR=k(function(AV){Object.defineProperty(AV,"__esModule",{value:!0});AV.ValueScope=AV.ValueScopeName=AV.Scope=AV.varKinds=AV.UsedValueState=void 0;var Zn=Tf();class vV extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var xy;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(xy||(AV.UsedValueState=xy={}));AV.varKinds={const:new Zn.Name("const"),let:new Zn.Name("let"),var:new Zn.Name("var")};class ER{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof Zn.Name?e:this.name(e)}name(e){return new Zn.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,n;if(((n=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||n===void 0?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}AV.Scope=ER;class xR extends Zn.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=Zn._`.${new Zn.Name(t)}[${n}]`}}AV.ValueScopeName=xR;var YFe=Zn._`\n`;class wV extends ER{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?YFe:Zn.nil}}get(){return this._scope}name(e){return new xR(e,this._newName(e))}value(e,t){var n;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let r=this.toName(e),{prefix:o}=r,s=(n=t.key)!==null&&n!==void 0?n:t.ref,i=this._values[o];if(i){let l=i.get(s);if(l)return l}else i=this._values[o]=new Map;i.set(s,r);let a=this._scope[o]||(this._scope[o]=[]),c=a.length;return a[c]=t.ref,r.setValue(t,{property:o,itemIndex:c}),r}getValue(e,t){let n=this._values[e];if(!n)return;return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(n)=>{if(n.scopePath===void 0)throw Error(`CodeGen: name "${n}" has no value`);return Zn._`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,(r)=>{if(r.value===void 0)throw Error(`CodeGen: name "${r}" has no value`);return r.value.code},t,n)}_reduceValues(e,t,n={},r){let o=Zn.nil;for(let s in e){let i=e[s];if(!i)continue;let a=n[s]=n[s]||new Map;i.forEach((c)=>{if(a.has(c))return;a.set(c,xy.Started);let l=t(c);if(l){let u=this.opts.es5?AV.varKinds.var:AV.varKinds.const;o=Zn._`${o}${u} ${c} = ${l};${this.opts._n}`}else if(l=r===null||r===void 0?void 0:r(c))o=Zn._`${o}${l}${this.opts._n}`;else throw new vV(c);a.set(c,xy.Completed)})}return o}}AV.ValueScope=wV});var Ce=k(function(Yn){Object.defineProperty(Yn,"__esModule",{value:!0});Yn.or=Yn.and=Yn.not=Yn.CodeGen=Yn.operators=Yn.varKinds=Yn.ValueScopeName=Yn.ValueScope=Yn.Scope=Yn.Name=Yn.regexpCode=Yn.stringify=Yn.getProperty=Yn.nil=Yn.strConcat=Yn.str=Yn._=void 0;var $e=Tf(),fo=vR(),ci=Tf();Object.defineProperty(Yn,"_",{enumerable:!0,get:function(){return ci._}});Object.defineProperty(Yn,"str",{enumerable:!0,get:function(){return ci.str}});Object.defineProperty(Yn,"strConcat",{enumerable:!0,get:function(){return ci.strConcat}});Object.defineProperty(Yn,"nil",{enumerable:!0,get:function(){return ci.nil}});Object.defineProperty(Yn,"getProperty",{enumerable:!0,get:function(){return ci.getProperty}});Object.defineProperty(Yn,"stringify",{enumerable:!0,get:function(){return ci.stringify}});Object.defineProperty(Yn,"regexpCode",{enumerable:!0,get:function(){return ci.regexpCode}});Object.defineProperty(Yn,"Name",{enumerable:!0,get:function(){return ci.Name}});var Cy=vR();Object.defineProperty(Yn,"Scope",{enumerable:!0,get:function(){return Cy.Scope}});Object.defineProperty(Yn,"ValueScope",{enumerable:!0,get:function(){return Cy.ValueScope}});Object.defineProperty(Yn,"ValueScopeName",{enumerable:!0,get:function(){return Cy.ValueScopeName}});Object.defineProperty(Yn,"varKinds",{enumerable:!0,get:function(){return Cy.varKinds}});Yn.operators={GT:new $e._Code(">"),GTE:new $e._Code(">="),LT:new $e._Code("<"),LTE:new $e._Code("<="),EQ:new $e._Code("==="),NEQ:new $e._Code("!=="),NOT:new $e._Code("!"),OR:new $e._Code("||"),AND:new $e._Code("&&"),ADD:new $e._Code("+")};class li{optimizeNodes(){return this}optimizeNames(e,t){return this}}class kV extends li{constructor(e,t,n){super();this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let n=e?fo.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${r};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=Xl(this.rhs,e,t);return this}get names(){return this.rhs instanceof $e._CodeOrName?this.rhs.names:{}}}class TR extends li{constructor(e,t,n){super();this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof $e.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Xl(this.rhs,e,t),this}get names(){let e=this.lhs instanceof $e.Name?{}:{...this.lhs.names};return ky(e,this.rhs)}}class CV extends TR{constructor(e,t,n,r){super(e,n,r);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class RV extends li{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class OV extends li{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class PV extends li{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class IV extends li{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=Xl(this.code,e,t),this}get names(){return this.code instanceof $e._CodeOrName?this.code.names:{}}}class Ry extends li{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let n=e[t].optimizeNodes();if(Array.isArray(n))e.splice(t,1,...n);else if(n)e[t]=n;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,r=n.length;while(r--){let o=n[r];if(o.optimizeNames(e,t))continue;eze(e,o.names),n.splice(r,1)}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>wa(e,t.names),{})}}class ui extends Ry{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class DV extends Ry{}class kf extends ui{}kf.kind="else";class ds extends ui{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let n=t.optimizeNodes();t=this.else=Array.isArray(n)?new kf(n):n}if(t){if(e===!1)return t instanceof ds?t:t.nodes;if(this.nodes.length)return this;return new ds(FV(e),t instanceof ds?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=Xl(this.condition,e,t),this}get names(){let e=super.names;if(ky(e,this.condition),this.else)wa(e,this.else.names);return e}}ds.kind="if";class Jl extends ui{}Jl.kind="for";class LV extends Jl{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iteration=Xl(this.iteration,e,t),this}get names(){return wa(super.names,this.iteration.names)}}class MV extends Jl{constructor(e,t,n,r){super();this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?fo.varKinds.var:this.varKind,{name:n,from:r,to:o}=this;return`for(${t} ${n}=${r}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=ky(super.names,this.from);return ky(e,this.to)}}class wR extends Jl{constructor(e,t,n,r){super();this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=Xl(this.iterable,e,t),this}get names(){return wa(super.names,this.iterable.names)}}class vy extends ui{constructor(e,t,n){super();this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}vy.kind="func";class wy extends Ry{render(e){return"return "+super.render(e)}}wy.kind="return";class NV extends ui{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),(n=this.catch)===null||n===void 0||n.optimizeNames(e,t),(r=this.finally)===null||r===void 0||r.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)wa(e,this.catch.names);if(this.finally)wa(e,this.finally.names);return e}}class Ay extends ui{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Ay.kind="catch";class Ty extends ui{render(e){return"finally"+super.render(e)}}Ty.kind="finally";class UV{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
`:""},this._extScope=e,this._scope=new fo.Scope({parent:e}),this._nodes=[new DV]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){let o=this._scope.toName(t);if(n!==void 0&&r)this._constants[o.str]=n;return this._leafNode(new kV(e,o,n)),o}const(e,t,n){return this._def(fo.varKinds.const,e,t,n)}let(e,t,n){return this._def(fo.varKinds.let,e,t,n)}var(e,t,n){return this._def(fo.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new TR(e,t,n))}add(e,t){return this._leafNode(new CV(e,Yn.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==$e.nil)this._leafNode(new IV(e));return this}object(...e){let t=["{"];for(let[n,r]of e){if(t.length>1)t.push(",");if(t.push(n),n!==r||this.opts.es5)t.push(":"),(0,$e.addCodeArg)(t,r)}return t.push("}"),new $e._Code(t)}if(e,t,n){if(this._blockNode(new ds(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new ds(e))}else(){return this._elseNode(new kf)}endIf(){return this._endBlockNode(ds,kf)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new LV(e),t)}forRange(e,t,n,r,o=this.opts.es5?fo.varKinds.var:fo.varKinds.let){let s=this._scope.toName(e);return this._for(new MV(o,s,t,n),()=>r(s))}forOf(e,t,n,r=fo.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let s=t instanceof $e.Name?t:this.var("_arr",t);return this.forRange("_i",0,$e._`${s}.length`,(i)=>{this.var(o,$e._`${s}[${i}]`),n(o)})}return this._for(new wR("of",r,o,t),()=>n(o))}forIn(e,t,n,r=this.opts.es5?fo.varKinds.var:fo.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,$e._`Object.keys(${t})`,n);let o=this._scope.toName(e);return this._for(new wR("in",r,o,t),()=>n(o))}endFor(){return this._endBlockNode(Jl)}label(e){return this._leafNode(new RV(e))}break(e){return this._leafNode(new OV(e))}return(e){let t=new wy;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(wy)}try(e,t,n){if(!t&&!n)throw Error('CodeGen: "try" without "catch" and "finally"');let r=new NV;if(this._blockNode(r),this.code(e),t){let o=this.name("e");this._currNode=r.catch=new Ay(o),t(o)}if(n)this._currNode=r.finally=new Ty,this.code(n);return this._endBlockNode(Ay,Ty)}throw(e){return this._leafNode(new PV(e))}block(e,t){if(this._blockStarts.push(this._nodes.length),e)this.code(e).endBlock(t);return this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error("CodeGen: not in self-balancing block");let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=$e.nil,n,r){if(this._blockNode(new vy(e,t,n)),r)this.code(r).endFunc();return this}endFunc(){return this._endBlockNode(vy)}optimize(e=1){while(e-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof ds))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}}Yn.CodeGen=UV;function wa(e,t){for(let n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function ky(e,t){return t instanceof $e._CodeOrName?wa(e,t.names):e}function Xl(e,t,n){if(e instanceof $e.Name)return r(e);if(!o(e))return e;return new $e._Code(e._items.reduce((s,i)=>{if(i instanceof $e.Name)i=r(i);if(i instanceof $e._Code)s.push(...i._items);else s.push(i);return s},[]));function r(s){let i=n[s.str];if(i===void 0||t[s.str]!==1)return s;return delete t[s.str],i}function o(s){return s instanceof $e._Code&&s._items.some((i)=>i instanceof $e.Name&&t[i.str]===1&&n[i.str]!==void 0)}}function eze(e,t){for(let n in t)e[n]=(e[n]||0)-(t[n]||0)}function FV(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:$e._`!${AR(e)}`}Yn.not=FV;var tze=zV(Yn.operators.AND);function nze(...e){return e.reduce(tze)}Yn.and=nze;var rze=zV(Yn.operators.OR);function oze(...e){return e.reduce(rze)}Yn.or=oze;function zV(e){return(t,n)=>t===$e.nil?n:n===$e.nil?t:$e._`${AR(t)} ${e} ${AR(n)}`}function AR(e){return e instanceof $e.Name?e:$e._`(${e})`}});var Ke=k(function(VV){Object.defineProperty(VV,"__esModule",{value:!0});VV.checkStrictMode=VV.getErrorPath=VV.Type=VV.useFunc=VV.setEvaluated=VV.evaluatedPropsToName=VV.mergeEvaluated=VV.eachItem=VV.unescapeJsonPointer=VV.escapeJsonPointer=VV.escapeFragment=VV.unescapeFragment=VV.schemaRefOrVal=VV.schemaHasRulesButRef=VV.schemaHasRules=VV.checkUnknownRules=VV.alwaysValidSchema=VV.toHash=void 0;var at=Ce(),cze=Tf();function lze(e){let t={};for(let n of e)t[n]=!0;return t}VV.toHash=lze;function uze(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return BV(e,t),!KV(t,e.self.RULES.all)}VV.alwaysValidSchema=uze;function BV(e,t=e.schema){let{opts:n,self:r}=e;if(!n.strictSchema)return;if(typeof t==="boolean")return;let o=r.RULES.keywords;for(let s in t)if(!o[s])qV(e,`unknown keyword: "${s}"`)}VV.checkUnknownRules=BV;function KV(e,t){if(typeof e=="boolean")return!e;for(let n in e)if(t[n])return!0;return!1}VV.schemaHasRules=KV;function dze(e,t){if(typeof e=="boolean")return!e;for(let n in e)if(n!=="$ref"&&t.all[n])return!0;return!1}VV.schemaHasRulesButRef=dze;function pze({topSchemaRef:e,schemaPath:t},n,r,o){if(!o){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return at._`${n}`}return at._`${e}${t}${(0,at.getProperty)(r)}`}VV.schemaRefOrVal=pze;function fze(e){return GV(decodeURIComponent(e))}VV.unescapeFragment=fze;function mze(e){return encodeURIComponent(CR(e))}VV.escapeFragment=mze;function CR(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}VV.escapeJsonPointer=CR;function GV(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}VV.unescapeJsonPointer=GV;function hze(e,t){if(Array.isArray(e))for(let n of e)t(n);else t(e)}VV.eachItem=hze;function jV({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:r}){return(o,s,i,a)=>{let c=i===void 0?s:i instanceof at.Name?(s instanceof at.Name?e(o,s,i):t(o,s,i),i):s instanceof at.Name?(t(o,i,s),s):n(s,i);return a===at.Name&&!(c instanceof at.Name)?r(o,c):c}}VV.mergeEvaluated={props:jV({mergeNames:(e,t,n)=>e.if(at._`${n} !== true && ${t} !== undefined`,()=>{e.if(at._`${t} === true`,()=>e.assign(n,!0),()=>e.assign(n,at._`${n} || {}`).code(at._`Object.assign(${n}, ${t})`))}),mergeToName:(e,t,n)=>e.if(at._`${n} !== true`,()=>{if(t===!0)e.assign(n,!0);else e.assign(n,at._`${n} || {}`),RR(e,n,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:WV}),items:jV({mergeNames:(e,t,n)=>e.if(at._`${n} !== true && ${t} !== undefined`,()=>e.assign(n,at._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`)),mergeToName:(e,t,n)=>e.if(at._`${n} !== true`,()=>e.assign(n,t===!0?!0:at._`${n} > ${t} ? ${n} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function WV(e,t){if(t===!0)return e.var("props",!0);let n=e.var("props",at._`{}`);if(t!==void 0)RR(e,n,t);return n}VV.evaluatedPropsToName=WV;function RR(e,t,n){Object.keys(n).forEach((r)=>e.assign(at._`${t}${(0,at.getProperty)(r)}`,!0))}VV.setEvaluated=RR;var HV={};function gze(e,t){return e.scopeValue("func",{ref:t,code:HV[t.code]||(HV[t.code]=new cze._Code(t.code))})}VV.useFunc=gze;var kR;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(kR||(VV.Type=kR={}));function _ze(e,t,n){if(e instanceof at.Name){let r=t===kR.Num;return n?r?at._`"[" + ${e} + "]"`:at._`"['" + ${e} + "']"`:r?at._`"/" + ${e}`:at._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,at.getProperty)(e).toString():"/"+CR(e)}VV.getErrorPath=_ze;function qV(e,t,n=e.opts.strictSchema){if(!n)return;if(t=`strict mode: ${t}`,n===!0)throw Error(t);e.self.logger.warn(t)}VV.checkStrictMode=qV});var ps=k(function(YV){Object.defineProperty(YV,"__esModule",{value:!0});var En=Ce(),Mze={data:new En.Name("data"),valCxt:new En.Name("valCxt"),instancePath:new En.Name("instancePath"),parentData:new En.Name("parentData"),parentDataProperty:new En.Name("parentDataProperty"),rootData:new En.Name("rootData"),dynamicAnchors:new En.Name("dynamicAnchors"),vErrors:new En.Name("vErrors"),errors:new En.Name("errors"),this:new En.Name("this"),self:new En.Name("self"),scope:new En.Name("scope"),json:new En.Name("json"),jsonPos:new En.Name("jsonPos"),jsonLen:new En.Name("jsonLen"),jsonPart:new En.Name("jsonPart")};YV.default=Mze});var Cf=k(function(e4){Object.defineProperty(e4,"__esModule",{value:!0});e4.extendErrors=e4.resetErrorsCount=e4.reportExtraError=e4.reportError=e4.keyword$DataError=e4.keywordError=void 0;var Ge=Ce(),Py=Ke(),Pn=ps();e4.keywordError={message:({keyword:e})=>Ge.str`must pass "${e}" keyword validation`};e4.keyword$DataError={message:({keyword:e,schemaType:t})=>t?Ge.str`"${e}" keyword must be ${t} ($data)`:Ge.str`"${e}" keyword is invalid ($data)`};function Uze(e,t=e4.keywordError,n,r){let{it:o}=e,{gen:s,compositeRule:i,allErrors:a}=o,c=QV(e,t,n);if(r!==null&&r!==void 0?r:i||a)JV(s,c);else XV(o,Ge._`[${c}]`)}e4.reportError=Uze;function Fze(e,t=e4.keywordError,n){let{it:r}=e,{gen:o,compositeRule:s,allErrors:i}=r,a=QV(e,t,n);if(JV(o,a),!(s||i))XV(r,Pn.default.vErrors)}e4.reportExtraError=Fze;function zze(e,t){e.assign(Pn.default.errors,t),e.if(Ge._`${Pn.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(Ge._`${Pn.default.vErrors}.length`,t),()=>e.assign(Pn.default.vErrors,null)))}e4.resetErrorsCount=zze;function $ze({gen:e,keyword:t,schemaValue:n,data:r,errsCount:o,it:s}){if(o===void 0)throw Error("ajv implementation error");let i=e.name("err");e.forRange("i",o,Pn.default.errors,(a)=>{if(e.const(i,Ge._`${Pn.default.vErrors}[${a}]`),e.if(Ge._`${i}.instancePath === undefined`,()=>e.assign(Ge._`${i}.instancePath`,(0,Ge.strConcat)(Pn.default.instancePath,s.errorPath))),e.assign(Ge._`${i}.schemaPath`,Ge.str`${s.errSchemaPath}/${t}`),s.opts.verbose)e.assign(Ge._`${i}.schema`,n),e.assign(Ge._`${i}.data`,r)})}e4.extendErrors=$ze;function JV(e,t){let n=e.const("err",t);e.if(Ge._`${Pn.default.vErrors} === null`,()=>e.assign(Pn.default.vErrors,Ge._`[${n}]`),Ge._`${Pn.default.vErrors}.push(${n})`),e.code(Ge._`${Pn.default.errors}++`)}function XV(e,t){let{gen:n,validateName:r,schemaEnv:o}=e;if(o.$async)n.throw(Ge._`new ${e.ValidationError}(${t})`);else n.assign(Ge._`${r}.errors`,t),n.return(!1)}var Aa={keyword:new Ge.Name("keyword"),schemaPath:new Ge.Name("schemaPath"),params:new Ge.Name("params"),propertyName:new Ge.Name("propertyName"),message:new Ge.Name("message"),schema:new Ge.Name("schema"),parentSchema:new Ge.Name("parentSchema")};function QV(e,t,n){let{createErrors:r}=e.it;if(r===!1)return Ge._`{}`;return jze(e,t,n)}function jze(e,t,n={}){let{gen:r,it:o}=e,s=[Hze(o,n),Bze(e,n)];return Kze(e,t,s),r.object(...s)}function Hze({errorPath:e},{instancePath:t}){let n=t?Ge.str`${e}${(0,Py.getErrorPath)(t,Py.Type.Str)}`:e;return[Pn.default.instancePath,(0,Ge.strConcat)(Pn.default.instancePath,n)]}function Bze({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:r}){let o=r?t:Ge.str`${t}/${e}`;if(n)o=Ge.str`${o}${(0,Py.getErrorPath)(n,Py.Type.Str)}`;return[Aa.schemaPath,o]}function Kze(e,{params:t,message:n},r){let{keyword:o,data:s,schemaValue:i,it:a}=e,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:p}=a;if(r.push([Aa.keyword,o],[Aa.params,typeof t=="function"?t(e):t||Ge._`{}`]),c.messages)r.push([Aa.message,typeof n=="function"?n(e):n]);if(c.verbose)r.push([Aa.schema,i],[Aa.parentSchema,Ge._`${u}${p}`],[Pn.default.data,s]);if(l)r.push([Aa.propertyName,l])}});var s4=k(function(r4){Object.defineProperty(r4,"__esModule",{value:!0});r4.boolOrEmptySchema=r4.topBoolOrEmptySchema=void 0;var Zze=Cf(),Yze=Ce(),Jze=ps(),Xze={message:"boolean schema is false"};function Qze(e){let{gen:t,schema:n,validateName:r}=e;if(n===!1)n4(e,!1);else if(typeof n=="object"&&n.$async===!0)t.return(Jze.default.data);else t.assign(Yze._`${r}.errors`,null),t.return(!0)}r4.topBoolOrEmptySchema=Qze;function e$e(e,t){let{gen:n,schema:r}=e;if(r===!1)n.var(t,!1),n4(e);else n.var(t,!0)}r4.boolOrEmptySchema=e$e;function n4(e,t){let{gen:n,data:r}=e,o={gen:n,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,Zze.reportError)(o,Xze,void 0,t)}});var PR=k(function(i4){Object.defineProperty(i4,"__esModule",{value:!0});i4.getRules=i4.isJSONType=void 0;var n$e=["string","number","integer","boolean","null","object","array"],r$e=new Set(n$e);function o$e(e){return typeof e=="string"&&r$e.has(e)}i4.isJSONType=o$e;function s$e(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}i4.getRules=s$e});var IR=k(function(u4){Object.defineProperty(u4,"__esModule",{value:!0});u4.shouldUseRule=u4.shouldUseGroup=u4.schemaHasRulesForType=void 0;function a$e({schema:e,self:t},n){let r=t.RULES.types[n];return r&&r!==!0&&c4(e,r)}u4.schemaHasRulesForType=a$e;function c4(e,t){return t.rules.some((n)=>l4(e,n))}u4.shouldUseGroup=c4;function l4(e,t){var n;return e[t.keyword]!==void 0||((n=t.definition.implements)===null||n===void 0?void 0:n.some((r)=>e[r]!==void 0))}u4.shouldUseRule=l4});var Rf=k(function(h4){Object.defineProperty(h4,"__esModule",{value:!0});h4.reportTypeError=h4.checkDataTypes=h4.checkDataType=h4.coerceAndCheckDataType=h4.getJSONTypes=h4.getSchemaTypes=h4.DataType=void 0;var u$e=PR(),d$e=IR(),p$e=Cf(),Ae=Ce(),p4=Ke(),Ql;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Ql||(h4.DataType=Ql={}));function f$e(e){let t=f4(e.type);if(t.includes("null")){if(e.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(e.nullable===!0)t.push("null")}return t}h4.getSchemaTypes=f$e;function f4(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(u$e.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}h4.getJSONTypes=f4;function m$e(e,t){let{gen:n,data:r,opts:o}=e,s=h$e(t,o.coerceTypes),i=t.length>0&&!(s.length===0&&t.length===1&&(0,d$e.schemaHasRulesForType)(e,t[0]));if(i){let a=LR(t,r,o.strictNumbers,Ql.Wrong);n.if(a,()=>{if(s.length)g$e(e,t,s);else MR(e)})}return i}h4.coerceAndCheckDataType=m$e;var m4=new Set(["string","number","integer","boolean","null"]);function h$e(e,t){return t?e.filter((n)=>m4.has(n)||t==="array"&&n==="array"):[]}function g$e(e,t,n){let{gen:r,data:o,opts:s}=e,i=r.let("dataType",Ae._`typeof ${o}`),a=r.let("coerced",Ae._`undefined`);if(s.coerceTypes==="array")r.if(Ae._`${i} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>r.assign(o,Ae._`${o}[0]`).assign(i,Ae._`typeof ${o}`).if(LR(t,o,s.strictNumbers),()=>r.assign(a,o)));r.if(Ae._`${a} !== undefined`);for(let l of n)if(m4.has(l)||l==="array"&&s.coerceTypes==="array")c(l);r.else(),MR(e),r.endIf(),r.if(Ae._`${a} !== undefined`,()=>{r.assign(o,a),_$e(e,a)});function c(l){switch(l){case"string":r.elseIf(Ae._`${i} == "number" || ${i} == "boolean"`).assign(a,Ae._`"" + ${o}`).elseIf(Ae._`${o} === null`).assign(a,Ae._`""`);return;case"number":r.elseIf(Ae._`${i} == "boolean" || ${o} === null
|| (${i} == "string" && ${o} && ${o} == +${o})`).assign(a,Ae._`+${o}`);return;case"integer":r.elseIf(Ae._`${i} === "boolean" || ${o} === null
|| (${i} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,Ae._`+${o}`);return;case"boolean":r.elseIf(Ae._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf(Ae._`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":r.elseIf(Ae._`${o} === "" || ${o} === 0 || ${o} === false`),r.assign(a,null);return;case"array":r.elseIf(Ae._`${i} === "string" || ${i} === "number"
|| ${i} === "boolean" || ${o} === null`).assign(a,Ae._`[${o}]`)}}}function _$e({gen:e,parentData:t,parentDataProperty:n},r){e.if(Ae._`${t} !== undefined`,()=>e.assign(Ae._`${t}[${n}]`,r))}function DR(e,t,n,r=Ql.Correct){let o=r===Ql.Correct?Ae.operators.EQ:Ae.operators.NEQ,s;switch(e){case"null":return Ae._`${t} ${o} null`;case"array":s=Ae._`Array.isArray(${t})`;break;case"object":s=Ae._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=i(Ae._`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=i();break;default:return Ae._`typeof ${t} ${o} ${e}`}return r===Ql.Correct?s:(0,Ae.not)(s);function i(a=Ae.nil){return(0,Ae.and)(Ae._`typeof ${t} == "number"`,a,n?Ae._`isFinite(${t})`:Ae.nil)}}h4.checkDataType=DR;function LR(e,t,n,r){if(e.length===1)return DR(e[0],t,n,r);let o,s=(0,p4.toHash)(e);if(s.array&&s.object){let i=Ae._`typeof ${t} != "object"`;o=s.null?i:Ae._`!${t} || ${i}`,delete s.null,delete s.array,delete s.object}else o=Ae.nil;if(s.number)delete s.integer;for(let i in s)o=(0,Ae.and)(o,DR(i,t,n,r));return o}h4.checkDataTypes=LR;var y$e={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?Ae._`{type: ${e}}`:Ae._`{type: ${t}}`};function MR(e){let t=b$e(e);(0,p$e.reportError)(t,y$e)}h4.reportTypeError=MR;function b$e(e){let{gen:t,data:n,schema:r}=e,o=(0,p4.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:o,schemaValue:o,parentSchema:r,params:{},it:e}}});var S4=k(function(y4){Object.defineProperty(y4,"__esModule",{value:!0});y4.assignDefaults=void 0;var eu=Ce(),T$e=Ke();function k$e(e,t){let{properties:n,items:r}=e.schema;if(t==="object"&&n)for(let o in n)_4(e,o,n[o].default);else if(t==="array"&&Array.isArray(r))r.forEach((o,s)=>_4(e,s,o.default))}y4.assignDefaults=k$e;function _4(e,t,n){let{gen:r,compositeRule:o,data:s,opts:i}=e;if(n===void 0)return;let a=eu._`${s}${(0,eu.getProperty)(t)}`;if(o){(0,T$e.checkStrictMode)(e,`default is ignored for: ${a}`);return}let c=eu._`${a} === undefined`;if(i.useDefaults==="empty")c=eu._`${c} || ${a} === null || ${a} === ""`;r.if(c,eu._`${a} = ${(0,eu.stringify)(n)}`)}});var Nr=k(function(v4){Object.defineProperty(v4,"__esModule",{value:!0});v4.validateUnion=v4.validateArray=v4.usePattern=v4.callValidateCode=v4.schemaProperties=v4.allSchemaProperties=v4.noPropertyInData=v4.propertyInData=v4.isOwnProperty=v4.hasPropFunc=v4.reportMissingProp=v4.checkMissingProp=v4.checkReportMissingProp=void 0;var mt=Ce(),NR=Ke(),di=ps(),C$e=Ke();function R$e(e,t){let{gen:n,data:r,it:o}=e;n.if(FR(n,r,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:mt._`${t}`},!0),e.error()})}v4.checkReportMissingProp=R$e;function O$e({gen:e,data:t,it:{opts:n}},r,o){return(0,mt.or)(...r.map((s)=>(0,mt.and)(FR(e,t,s,n.ownProperties),mt._`${o} = ${s}`)))}v4.checkMissingProp=O$e;function P$e(e,t){e.setParams({missingProperty:t},!0),e.error()}v4.reportMissingProp=P$e;function E4(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:mt._`Object.prototype.hasOwnProperty`})}v4.hasPropFunc=E4;function UR(e,t,n){return mt._`${E4(e)}.call(${t}, ${n})`}v4.isOwnProperty=UR;function I$e(e,t,n,r){let o=mt._`${t}${(0,mt.getProperty)(n)} !== undefined`;return r?mt._`${o} && ${UR(e,t,n)}`:o}v4.propertyInData=I$e;function FR(e,t,n,r){let o=mt._`${t}${(0,mt.getProperty)(n)} === undefined`;return r?(0,mt.or)(o,(0,mt.not)(UR(e,t,n))):o}v4.noPropertyInData=FR;function x4(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}v4.allSchemaProperties=x4;function D$e(e,t){return x4(t).filter((n)=>!(0,NR.alwaysValidSchema)(e,t[n]))}v4.schemaProperties=D$e;function L$e({schemaCode:e,data:t,it:{gen:n,topSchemaRef:r,schemaPath:o,errorPath:s},it:i},a,c,l){let u=l?mt._`${e}, ${t}, ${r}${o}`:t,p=[[di.default.instancePath,(0,mt.strConcat)(di.default.instancePath,s)],[di.default.parentData,i.parentData],[di.default.parentDataProperty,i.parentDataProperty],[di.default.rootData,di.default.rootData]];if(i.opts.dynamicRef)p.push([di.default.dynamicAnchors,di.default.dynamicAnchors]);let f=mt._`${u}, ${n.object(...p)}`;return c!==mt.nil?mt._`${a}.call(${c}, ${f})`:mt._`${a}(${f})`}v4.callValidateCode=L$e;var M$e=mt._`new RegExp`;function N$e({gen:e,it:{opts:t}},n){let r=t.unicodeRegExp?"u":"",{regExp:o}=t.code,s=o(n,r);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:mt._`${o.code==="new RegExp"?M$e:(0,C$e.useFunc)(e,o)}(${n}, ${r})`})}v4.usePattern=N$e;function U$e(e){let{gen:t,data:n,keyword:r,it:o}=e,s=t.name("valid");if(o.allErrors){let a=t.let("valid",!0);return i(()=>t.assign(a,!1)),a}return t.var(s,!0),i(()=>t.break()),s;function i(a){let c=t.const("len",mt._`${n}.length`);t.forRange("i",0,c,(l)=>{e.subschema({keyword:r,dataProp:l,dataPropType:NR.Type.Num},s),t.if((0,mt.not)(s),a)})}}v4.validateArray=U$e;function F$e(e){let{gen:t,schema:n,keyword:r,it:o}=e;if(!Array.isArray(n))throw Error("ajv implementation error");if(n.some((c)=>(0,NR.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let i=t.let("valid",!1),a=t.name("_valid");t.block(()=>n.forEach((c,l)=>{let u=e.subschema({keyword:r,schemaProp:l,compositeRule:!0},a);if(t.assign(i,mt._`${i} || ${a}`),!e.mergeValidEvaluated(u,a))t.if((0,mt.not)(i))})),e.result(i,()=>e.reset(),()=>e.error(!0))}v4.validateUnion=F$e});var R4=k(function(k4){Object.defineProperty(k4,"__esModule",{value:!0});k4.validateKeywordUsage=k4.validSchemaType=k4.funcKeywordCode=k4.macroKeywordCode=void 0;var In=Ce(),Ta=ps(),J$e=Nr(),X$e=Cf();function Q$e(e,t){let{gen:n,keyword:r,schema:o,parentSchema:s,it:i}=e,a=t.macro.call(i.self,o,s,i),c=T4(n,r,a);if(i.opts.validateSchema!==!1)i.self.validateSchema(a,!0);let l=n.name("valid");e.subschema({schema:a,schemaPath:In.nil,errSchemaPath:`${i.errSchemaPath}/${r}`,topSchemaRef:c,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}k4.macroKeywordCode=Q$e;function eje(e,t){var n;let{gen:r,keyword:o,schema:s,parentSchema:i,$data:a,it:c}=e;nje(c,t);let l=!a&&t.compile?t.compile.call(c.self,s,i,c):t.validate,u=T4(r,o,l),p=r.let("valid");e.block$data(p,f),e.ok((n=t.valid)!==null&&n!==void 0?n:p);function f(){if(t.errors===!1){if(_(),t.modifying)A4(e);y(()=>e.error())}else{let S=t.async?m():h();if(t.modifying)A4(e);y(()=>tje(e,S))}}function m(){let S=r.let("ruleErrs",null);return r.try(()=>_(In._`await `),(b)=>r.assign(p,!1).if(In._`${b} instanceof ${c.ValidationError}`,()=>r.assign(S,In._`${b}.errors`),()=>r.throw(b))),S}function h(){let S=In._`${u}.errors`;return r.assign(S,null),_(In.nil),S}function _(S=t.async?In._`await `:In.nil){let b=c.opts.passContext?Ta.default.this:Ta.default.self,x=!(("compile"in t)&&!a||t.schema===!1);r.assign(p,In._`${S}${(0,J$e.callValidateCode)(e,u,b,x)}`,t.modifying)}function y(S){var b;r.if((0,In.not)((b=t.valid)!==null&&b!==void 0?b:p),S)}}k4.funcKeywordCode=eje;function A4(e){let{gen:t,data:n,it:r}=e;t.if(r.parentData,()=>t.assign(n,In._`${r.parentData}[${r.parentDataProperty}]`))}function tje(e,t){let{gen:n}=e;n.if(In._`Array.isArray(${t})`,()=>{n.assign(Ta.default.vErrors,In._`${Ta.default.vErrors} === null ? ${t} : ${Ta.default.vErrors}.concat(${t})`).assign(Ta.default.errors,In._`${Ta.default.vErrors}.length`),(0,X$e.extendErrors)(e)},()=>e.error())}function nje({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function T4(e,t,n){if(n===void 0)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,In.stringify)(n)})}function rje(e,t,n=!1){return!t.length||t.some((r)=>r==="array"?Array.isArray(e):r==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==r||n&&typeof e>"u")}k4.validSchemaType=rje;function oje({schema:e,opts:t,self:n,errSchemaPath:r},o,s){if(Array.isArray(o.keyword)?!o.keyword.includes(s):o.keyword!==s)throw Error("ajv implementation error");let i=o.dependencies;if(i===null||i===void 0?void 0:i.some((a)=>!Object.prototype.hasOwnProperty.call(e,a)))throw Error(`parent schema must have dependencies of ${s}: ${i.join(",")}`);if(o.validateSchema){if(!o.validateSchema(e[s])){let c=`keyword "${s}" value is invalid at path "${r}": `+n.errorsText(o.validateSchema.errors);if(t.validateSchema==="log")n.logger.error(c);else throw Error(c)}}}k4.validateKeywordUsage=oje});var D4=k(function(P4){Object.defineProperty(P4,"__esModule",{value:!0});P4.extendSubschemaMode=P4.extendSubschemaData=P4.getSubschema=void 0;var Uo=Ce(),O4=Ke();function cje(e,{keyword:t,schemaProp:n,schema:r,schemaPath:o,errSchemaPath:s,topSchemaRef:i}){if(t!==void 0&&r!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return n===void 0?{schema:a,schemaPath:Uo._`${e.schemaPath}${(0,Uo.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[n],schemaPath:Uo._`${e.schemaPath}${(0,Uo.getProperty)(t)}${(0,Uo.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,O4.escapeFragment)(n)}`}}if(r!==void 0){if(o===void 0||s===void 0||i===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:o,topSchemaRef:i,errSchemaPath:s}}throw Error('either "keyword" or "schema" must be passed')}P4.getSubschema=cje;function lje(e,t,{dataProp:n,dataPropType:r,data:o,dataTypes:s,propertyName:i}){if(o!==void 0&&n!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(n!==void 0){let{errorPath:l,dataPathArr:u,opts:p}=t,f=a.let("data",Uo._`${t.data}${(0,Uo.getProperty)(n)}`,!0);c(f),e.errorPath=Uo.str`${l}${(0,O4.getErrorPath)(n,r,p.jsPropertySyntax)}`,e.parentDataProperty=Uo._`${n}`,e.dataPathArr=[...u,e.parentDataProperty]}if(o!==void 0){let l=o instanceof Uo.Name?o:a.let("data",o,!0);if(c(l),i!==void 0)e.propertyName=i}if(s)e.dataTypes=s;function c(l){e.data=l,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,l]}}P4.extendSubschemaData=lje;function uje(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:o,allErrors:s}){if(r!==void 0)e.compositeRule=r;if(o!==void 0)e.createErrors=o;if(s!==void 0)e.allErrors=s;e.jtdDiscriminator=t,e.jtdMetadata=n}P4.extendSubschemaMode=uje});var zR=k(function(zkt,L4){L4.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,s;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[o]))return!1;for(o=r;o--!==0;){var i=s[o];if(!e(t[i],n[i]))return!1}return!0}return t!==t&&n!==n}});var N4=k(function($kt,M4){var pi=M4.exports=function(e,t,n){if(typeof t=="function")n=t,t={};n=t.cb||n;var r=typeof n=="function"?n:n.pre||function(){},o=n.post||function(){};Iy(t,r,o,e,"",e)};pi.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};pi.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};pi.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};pi.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Iy(e,t,n,r,o,s,i,a,c,l){if(r&&typeof r=="object"&&!Array.isArray(r)){t(r,o,s,i,a,c,l);for(var u in r){var p=r[u];if(Array.isArray(p)){if(u in pi.arrayKeywords)for(var f=0;f<p.length;f++)Iy(e,t,n,p[f],o+"/"+u+"/"+f,s,o,u,r,f)}else if(u in pi.propsKeywords){if(p&&typeof p=="object")for(var m in p)Iy(e,t,n,p[m],o+"/"+u+"/"+fje(m),s,o,u,r,m)}else if(u in pi.keywords||e.allKeys&&!(u in pi.skipKeywords))Iy(e,t,n,p,o+"/"+u,s,o,u,r)}n(r,o,s,i,a,c,l)}}function fje(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Of=k(function($4){Object.defineProperty($4,"__esModule",{value:!0});$4.getSchemaRefs=$4.resolveUrl=$4.normalizeId=$4._getFullPath=$4.getFullPath=$4.inlineRef=void 0;var mje=Ke(),hje=zR(),gje=N4(),_je=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function yje(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!$R(e);if(!t)return!1;return U4(e)<=t}$4.inlineRef=yje;var bje=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function $R(e){for(let t in e){if(bje.has(t))return!0;let n=e[t];if(Array.isArray(n)&&n.some($R))return!0;if(typeof n=="object"&&$R(n))return!0}return!1}function U4(e){let t=0;for(let n in e){if(n==="$ref")return 1/0;if(t++,_je.has(n))continue;if(typeof e[n]=="object")(0,mje.eachItem)(e[n],(r)=>t+=U4(r));if(t===1/0)return 1/0}return t}function F4(e,t="",n){if(n!==!1)t=tu(t);let r=e.parse(t);return z4(e,r)}$4.getFullPath=F4;function z4(e,t){return e.serialize(t).split("#")[0]+"#"}$4._getFullPath=z4;var Sje=/#\/?$/;function tu(e){return e?e.replace(Sje,""):""}$4.normalizeId=tu;function Eje(e,t,n){return n=tu(n),e.resolve(t,n)}$4.resolveUrl=Eje;var xje=/^[a-z_][-a-z0-9._]*$/i;function vje(e,t){if(typeof e=="boolean")return{};let{schemaId:n,uriResolver:r}=this.opts,o=tu(e[n]||t),s={"":o},i=F4(r,o,!1),a={},c=new Set;return gje(e,{allKeys:!0},(p,f,m,h)=>{if(h===void 0)return;let _=i+f,y=s[h];if(typeof p[n]=="string")y=S.call(this,p[n]);b.call(this,p.$anchor),b.call(this,p.$dynamicAnchor),s[f]=y;function S(x){let v=this.opts.uriResolver.resolve;if(x=tu(y?v(y,x):x),c.has(x))throw u(x);c.add(x);let T=this.refs[x];if(typeof T=="string")T=this.refs[T];if(typeof T=="object")l(p,T.schema,x);else if(x!==tu(_))if(x[0]==="#")l(p,a[x],x),a[x]=p;else this.refs[x]=_;return x}function b(x){if(typeof x=="string"){if(!xje.test(x))throw Error(`invalid anchor "${x}"`);S.call(this,`#${x}`)}}}),a;function l(p,f,m){if(f!==void 0&&!hje(p,f))throw u(m)}function u(p){return Error(`reference "${p}" resolves to more than one schema`)}}$4.getSchemaRefs=vje});var Df=k(function(n6){Object.defineProperty(n6,"__esModule",{value:!0});n6.getData=n6.KeywordCxt=n6.validateFunctionCode=void 0;var W4=s4(),H4=Rf(),HR=IR(),Dy=Rf(),Rje=S4(),If=R4(),jR=D4(),le=Ce(),_e=ps(),Oje=Of(),fs=Ke(),Pf=Cf();function Pje(e){if(Z4(e)){if(Y4(e),V4(e)){Lje(e);return}}q4(e,()=>(0,W4.topBoolOrEmptySchema)(e))}n6.validateFunctionCode=Pje;function q4({gen:e,validateName:t,schema:n,schemaEnv:r,opts:o},s){if(o.code.es5)e.func(t,le._`${_e.default.data}, ${_e.default.valCxt}`,r.$async,()=>{e.code(le._`"use strict"; ${B4(n,o)}`),Dje(e,o),e.code(s)});else e.func(t,le._`${_e.default.data}, ${Ije(o)}`,r.$async,()=>e.code(B4(n,o)).code(s))}function Ije(e){return le._`{${_e.default.instancePath}="", ${_e.default.parentData}, ${_e.default.parentDataProperty}, ${_e.default.rootData}=${_e.default.data}${e.dynamicRef?le._`, ${_e.default.dynamicAnchors}={}`:le.nil}}={}`}function Dje(e,t){e.if(_e.default.valCxt,()=>{if(e.var(_e.default.instancePath,le._`${_e.default.valCxt}.${_e.default.instancePath}`),e.var(_e.default.parentData,le._`${_e.default.valCxt}.${_e.default.parentData}`),e.var(_e.default.parentDataProperty,le._`${_e.default.valCxt}.${_e.default.parentDataProperty}`),e.var(_e.default.rootData,le._`${_e.default.valCxt}.${_e.default.rootData}`),t.dynamicRef)e.var(_e.default.dynamicAnchors,le._`${_e.default.valCxt}.${_e.default.dynamicAnchors}`)},()=>{if(e.var(_e.default.instancePath,le._`""`),e.var(_e.default.parentData,le._`undefined`),e.var(_e.default.parentDataProperty,le._`undefined`),e.var(_e.default.rootData,_e.default.data),t.dynamicRef)e.var(_e.default.dynamicAnchors,le._`{}`)})}function Lje(e){let{schema:t,opts:n,gen:r}=e;q4(e,()=>{if(n.$comment&&t.$comment)X4(e);if(zje(e),r.let(_e.default.vErrors,null),r.let(_e.default.errors,0),n.unevaluated)Mje(e);J4(e),Hje(e)});return}function Mje(e){let{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",le._`${n}.evaluated`),t.if(le._`${e.evaluated}.dynamicProps`,()=>t.assign(le._`${e.evaluated}.props`,le._`undefined`)),t.if(le._`${e.evaluated}.dynamicItems`,()=>t.assign(le._`${e.evaluated}.items`,le._`undefined`))}function B4(e,t){let n=typeof e=="object"&&e[t.schemaId];return n&&(t.code.source||t.code.process)?le._`/*# sourceURL=${n} */`:le.nil}function Nje(e,t){if(Z4(e)){if(Y4(e),V4(e)){Uje(e,t);return}}(0,W4.boolOrEmptySchema)(e,t)}function V4({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let n in e)if(t.RULES.all[n])return!0;return!1}function Z4(e){return typeof e.schema!="boolean"}function Uje(e,t){let{schema:n,gen:r,opts:o}=e;if(o.$comment&&n.$comment)X4(e);$je(e),jje(e);let s=r.const("_errs",_e.default.errors);J4(e,s),r.var(t,le._`${s} === ${_e.default.errors}`)}function Y4(e){(0,fs.checkUnknownRules)(e),Fje(e)}function J4(e,t){if(e.opts.jtd)return K4(e,[],!1,t);let n=(0,H4.getSchemaTypes)(e.schema),r=(0,H4.coerceAndCheckDataType)(e,n);K4(e,n,!r,t)}function Fje(e){let{schema:t,errSchemaPath:n,opts:r,self:o}=e;if(t.$ref&&r.ignoreKeywordsWithRef&&(0,fs.schemaHasRulesButRef)(t,o.RULES))o.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function zje(e){let{schema:t,opts:n}=e;if(t.default!==void 0&&n.useDefaults&&n.strictSchema)(0,fs.checkStrictMode)(e,"default is ignored in the schema root")}function $je(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=(0,Oje.resolveUrl)(e.opts.uriResolver,e.baseId,t)}function jje(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function X4({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:o}){let s=n.$comment;if(o.$comment===!0)e.code(le._`${_e.default.self}.logger.log(${s})`);else if(typeof o.$comment=="function"){let i=le.str`${r}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code(le._`${_e.default.self}.opts.$comment(${s}, ${i}, ${a}.schema)`)}}function Hje(e){let{gen:t,schemaEnv:n,validateName:r,ValidationError:o,opts:s}=e;if(n.$async)t.if(le._`${_e.default.errors} === 0`,()=>t.return(_e.default.data),()=>t.throw(le._`new ${o}(${_e.default.vErrors})`));else{if(t.assign(le._`${r}.errors`,_e.default.vErrors),s.unevaluated)Bje(e);t.return(le._`${_e.default.errors} === 0`)}}function Bje({gen:e,evaluated:t,props:n,items:r}){if(n instanceof le.Name)e.assign(le._`${t}.props`,n);if(r instanceof le.Name)e.assign(le._`${t}.items`,r)}function K4(e,t,n,r){let{gen:o,schema:s,data:i,allErrors:a,opts:c,self:l}=e,{RULES:u}=l;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0,fs.schemaHasRulesButRef)(s,u))){o.block(()=>e6(e,"$ref",u.all.$ref.definition));return}if(!c.jtd)Kje(e,t);o.block(()=>{for(let f of u.rules)p(f);p(u.post)});function p(f){if(!(0,HR.shouldUseGroup)(s,f))return;if(f.type){if(o.if((0,Dy.checkDataType)(f.type,i,c.strictNumbers)),G4(e,f),t.length===1&&t[0]===f.type&&n)o.else(),(0,Dy.reportTypeError)(e);o.endIf()}else G4(e,f);if(!a)o.if(le._`${_e.default.errors} === ${r||0}`)}}function G4(e,t){let{gen:n,schema:r,opts:{useDefaults:o}}=e;if(o)(0,Rje.assignDefaults)(e,t.type);n.block(()=>{for(let s of t.rules)if((0,HR.shouldUseRule)(r,s))e6(e,s.keyword,s.definition,t.type)})}function Kje(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(Gje(e,t),!e.opts.allowUnionTypes)Wje(e,t);qje(e,e.dataTypes)}function Gje(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((n)=>{if(!Q4(e.dataTypes,n))BR(e,`type "${n}" not allowed by context "${e.dataTypes.join(",")}"`)}),Zje(e,t)}function Wje(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))BR(e,"use allowUnionTypes to allow union type keyword")}function qje(e,t){let n=e.self.RULES.all;for(let r in n){let o=n[r];if(typeof o=="object"&&(0,HR.shouldUseRule)(e.schema,o)){let{type:s}=o.definition;if(s.length&&!s.some((i)=>Vje(t,i)))BR(e,`missing type "${s.join(",")}" for keyword "${r}"`)}}}function Vje(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Q4(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function Zje(e,t){let n=[];for(let r of e.dataTypes)if(Q4(t,r))n.push(r);else if(t.includes("integer")&&r==="number")n.push("integer");e.dataTypes=n}function BR(e,t){let n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,fs.checkStrictMode)(e,t,e.opts.strictTypes)}class KR{constructor(e,t,n){if((0,If.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,fs.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",t6(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,If.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);if("code"in t?t.trackErrors:t.errors!==!1)this.errsCount=e.gen.const("_errs",_e.default.errors)}result(e,t,n){this.failResult((0,le.not)(e),t,n)}failResult(e,t,n){if(this.gen.if(e),n)n();else this.error();if(t){if(this.gen.else(),t(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(e,t){this.failResult((0,le.not)(e),void 0,t)}fail(e){if(e===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(e),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail(le._`${t} !== undefined && (${(0,le.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?Pf.reportExtraError:Pf.reportError)(this,this.def.error,t)}$dataError(){(0,Pf.reportError)(this,this.def.$dataError||Pf.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,Pf.resetErrorsCount)(this.gen,this.errsCount)}ok(e){if(!this.allErrors)this.gen.if(e)}setParams(e,t){if(t)Object.assign(this.params,e);else this.params=e}block$data(e,t,n=le.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=le.nil,t=le.nil){if(!this.$data)return;let{gen:n,schemaCode:r,schemaType:o,def:s}=this;if(n.if((0,le.or)(le._`${r} === undefined`,t)),e!==le.nil)n.assign(e,!0);if(o.length||s.validateSchema){if(n.elseIf(this.invalid$data()),this.$dataError(),e!==le.nil)n.assign(e,!1)}n.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:n,def:r,it:o}=this;return(0,le.or)(s(),i());function s(){if(n.length){if(!(t instanceof le.Name))throw Error("ajv implementation error");let a=Array.isArray(n)?n:[n];return le._`${(0,Dy.checkDataTypes)(a,t,o.opts.strictNumbers,Dy.DataType.Wrong)}`}return le.nil}function i(){if(r.validateSchema){let a=e.scopeValue("validate$data",{ref:r.validateSchema});return le._`!${a}(${t})`}return le.nil}}subschema(e,t){let n=(0,jR.getSubschema)(this.it,e);(0,jR.extendSubschemaData)(n,this.it,e),(0,jR.extendSubschemaMode)(n,e);let r={...this.it,...n,items:void 0,props:void 0};return Nje(r,t),r}mergeEvaluated(e,t){let{it:n,gen:r}=this;if(!n.opts.unevaluated)return;if(n.props!==!0&&e.props!==void 0)n.props=fs.mergeEvaluated.props(r,e.props,n.props,t);if(n.items!==!0&&e.items!==void 0)n.items=fs.mergeEvaluated.items(r,e.items,n.items,t)}mergeValidEvaluated(e,t){let{it:n,gen:r}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return r.if(t,()=>this.mergeEvaluated(e,le.Name)),!0}}n6.KeywordCxt=KR;function e6(e,t,n,r){let o=new KR(e,n,t);if("code"in n)n.code(o,r);else if(o.$data&&n.validate)(0,If.funcKeywordCode)(o,n);else if("macro"in n)(0,If.macroKeywordCode)(o,n);else if(n.compile||n.validate)(0,If.funcKeywordCode)(o,n)}var Yje=/^\/(?:[^~]|~0|~1)*$/,Jje=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function t6(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let o,s;if(e==="")return _e.default.rootData;if(e[0]==="/"){if(!Yje.test(e))throw Error(`Invalid JSON-pointer: ${e}`);o=e,s=_e.default.rootData}else{let l=Jje.exec(e);if(!l)throw Error(`Invalid JSON-pointer: ${e}`);let u=+l[1];if(o=l[2],o==="#"){if(u>=t)throw Error(c("property/index",u));return r[t-u]}if(u>t)throw Error(c("data",u));if(s=n[t-u],!o)return s}let i=s,a=o.split("/");for(let l of a)if(l)s=le._`${s}${(0,le.getProperty)((0,fs.unescapeJsonPointer)(l))}`,i=le._`${i} && ${s}`;return i;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${t}`}}n6.getData=t6});var Ly=k(function(s6){Object.defineProperty(s6,"__esModule",{value:!0});class o6 extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}s6.default=o6});var Lf=k(function(a6){Object.defineProperty(a6,"__esModule",{value:!0});var GR=Of();class i6 extends Error{constructor(e,t,n,r){super(r||`can't resolve reference ${n} from id ${t}`);this.missingRef=(0,GR.resolveUrl)(e,t,n),this.missingSchema=(0,GR.normalizeId)((0,GR.getFullPath)(e,this.missingRef))}}a6.default=i6});var Ny=k(function(u6){Object.defineProperty(u6,"__esModule",{value:!0});u6.resolveSchema=u6.getCompilingSchema=u6.resolveRef=u6.compileSchema=u6.SchemaEnv=void 0;var mo=Ce(),n1e=Ly(),ka=ps(),ho=Of(),c6=Ke(),r1e=Df();class Mf{constructor(e){var t;this.refs={},this.dynamicAnchors={};let n;if(typeof e.schema=="object")n=e.schema;this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,ho.normalizeId)(n===null||n===void 0?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n===null||n===void 0?void 0:n.$async,this.refs={}}}u6.SchemaEnv=Mf;function qR(e){let t=l6.call(this,e);if(t)return t;let n=(0,ho.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:r,lines:o}=this.opts.code,{ownProperties:s}=this.opts,i=new mo.CodeGen(this.scope,{es5:r,lines:o,ownProperties:s}),a;if(e.$async)a=i.scopeValue("Error",{ref:n1e.default,code:mo._`require("ajv/dist/runtime/validation_error").default`});let c=i.scopeName("validate");e.validateName=c;let l={gen:i,allErrors:this.opts.allErrors,data:ka.default.data,parentData:ka.default.parentData,parentDataProperty:ka.default.parentDataProperty,dataNames:[ka.default.data],dataPathArr:[mo.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,mo.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:mo.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:mo._`""`,opts:this.opts,self:this},u;try{this._compilations.add(e),(0,r1e.validateFunctionCode)(l),i.optimize(this.opts.code.optimize);let p=i.toString();if(u=`${i.scopeRefs(ka.default.scope)}return ${p}`,this.opts.code.process)u=this.opts.code.process(u,e);let m=Function(`${ka.default.self}`,`${ka.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:m}),m.errors=null,m.schema=e.schema,m.schemaEnv=e,e.$async)m.$async=!0;if(this.opts.code.source===!0)m.source={validateName:c,validateCode:p,scopeValues:i._values};if(this.opts.unevaluated){let{props:h,items:_}=l;if(m.evaluated={props:h instanceof mo.Name?void 0:h,items:_ instanceof mo.Name?void 0:_,dynamicProps:h instanceof mo.Name,dynamicItems:_ instanceof mo.Name},m.source)m.source.evaluated=(0,mo.stringify)(m.evaluated)}return e.validate=m,e}catch(p){if(delete e.validate,delete e.validateName,u)this.logger.error("Error compiling schema, function code:",u);throw p}finally{this._compilations.delete(e)}}u6.compileSchema=qR;function o1e(e,t,n){var r;n=(0,ho.resolveUrl)(this.opts.uriResolver,t,n);let o=e.refs[n];if(o)return o;let s=a1e.call(this,e,n);if(s===void 0){let i=(r=e.localRefs)===null||r===void 0?void 0:r[n],{schemaId:a}=this.opts;if(i)s=new Mf({schema:i,schemaId:a,root:e,baseId:t})}if(s===void 0)return;return e.refs[n]=s1e.call(this,s)}u6.resolveRef=o1e;function s1e(e){if((0,ho.inlineRef)(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:qR.call(this,e)}function l6(e){for(let t of this._compilations)if(i1e(t,e))return t}u6.getCompilingSchema=l6;function i1e(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function a1e(e,t){let n;while(typeof(n=this.refs[t])=="string")t=n;return n||this.schemas[t]||My.call(this,e,t)}function My(e,t){let n=this.opts.uriResolver.parse(t),r=(0,ho._getFullPath)(this.opts.uriResolver,n),o=(0,ho.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===o)return WR.call(this,n,e);let s=(0,ho.normalizeId)(r),i=this.refs[s]||this.schemas[s];if(typeof i=="string"){let a=My.call(this,e,i);if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;return WR.call(this,n,a)}if(typeof(i===null||i===void 0?void 0:i.schema)!=="object")return;if(!i.validate)qR.call(this,i);if(s===(0,ho.normalizeId)(t)){let{schema:a}=i,{schemaId:c}=this.opts,l=a[c];if(l)o=(0,ho.resolveUrl)(this.opts.uriResolver,o,l);return new Mf({schema:a,schemaId:c,root:e,baseId:o})}return WR.call(this,n,i)}u6.resolveSchema=My;var c1e=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function WR(e,{baseId:t,schema:n,root:r}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof n==="boolean")return;let c=n[(0,c6.unescapeFragment)(a)];if(c===void 0)return;n=c;let l=typeof n==="object"&&n[this.opts.schemaId];if(!c1e.has(a)&&l)t=(0,ho.resolveUrl)(this.opts.uriResolver,t,l)}let s;if(typeof n!="boolean"&&n.$ref&&!(0,c6.schemaHasRulesButRef)(n,this.RULES)){let a=(0,ho.resolveUrl)(this.opts.uriResolver,t,n.$ref);s=My.call(this,r,a)}let{schemaId:i}=this.opts;if(s=s||new Mf({schema:n,schemaId:i,root:r,baseId:t}),s.schema!==s.root.schema)return s;return}});var p6=k(function(Wkt,f1e){f1e.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var YR=k(function(qkt,y6){var m1e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),m6=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),VR=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),h6=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),h1e=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function ZR(e){let t="",n=0,r=0;for(r=0;r<e.length;r++){if(n=e[r].charCodeAt(0),n===48)continue;if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[r];break}for(r+=1;r<e.length;r++){if(n=e[r].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[r]}return t}var g1e=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function f6(e){return e.length=0,!0}function _1e(e,t,n){if(e.length){let r=ZR(e);if(r!=="")t.push(r);else return n.error=!0,!1;e.length=0}return!0}function y1e(e){let t=0,n={error:!1,address:"",zone:""},r=[],o=[],s=!1,i=!1,a=_1e;for(let c=0;c<e.length;c++){let l=e[c];if(l==="["||l==="]")continue;if(l===":"){if(s===!0)i=!0;if(!a(o,r,n))break;if(++t>7){n.error=!0;break}if(c>0&&e[c-1]===":")s=!0;r.push(":");continue}else if(l==="%"){if(!a(o,r,n))break;a=f6}else{o.push(l);continue}}if(o.length)if(a===f6)n.zone=o.join("");else if(i)r.push(o.join(""));else r.push(ZR(o));return n.address=r.join(""),n}function g6(e){if(b1e(e,":")<2)return{host:e,isIPV6:!1};let t=y1e(e);if(!t.error){let{address:n,address:r}=t;if(t.zone)n+="%"+t.zone,r+="%25"+t.zone;return{host:n,isIPV6:!0,escapedHost:r}}else return{host:e,isIPV6:!1}}function b1e(e,t){let n=0;for(let r=0;r<e.length;r++)if(e[r]===t)n++;return n}function S1e(e){let t=e,n=[],r=-1,o=0;while(o=t.length){if(o===1)if(t===".")break;else if(t==="/"){n.push("/");break}else{n.push(t);break}else if(o===2){if(t[0]==="."){if(t[1]===".")break;else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."||t[1]==="/"){n.push("/");break}}}else if(o===3){if(t==="/.."){if(n.length!==0)n.pop();n.push("/");break}}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."){if(t[3]==="/"){if(t=t.slice(3),n.length!==0)n.pop();continue}}}}if((r=t.indexOf("/",1))===-1){n.push(t);break}else n.push(t.slice(0,r)),t=t.slice(r)}return n.join("")}var E1e={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},x1e=/[@/?#:]/g,v1e=/[@/?#]/g;function _6(e,t){let n=t?v1e:x1e;return n.lastIndex=0,e.replace(n,(r)=>E1e[r])}function w1e(e,t=!1){if(e.indexOf("%")===-1)return e;let n="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let o=e.slice(r+1,r+3);if(VR(o)){let s=o.toUpperCase(),i=String.fromCharCode(parseInt(s,16));if(t&&h6(i))n+=i;else n+="%"+s;r+=2;continue}}n+=e[r]}return n}function A1e(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){let r=e.slice(n+1,n+3);if(VR(r)){let o=r.toUpperCase(),s=String.fromCharCode(parseInt(o,16));if(s!=="."&&h6(s))t+=s;else t+="%"+o;n+=2;continue}}if(h1e(e[n]))t+=e[n];else t+=escape(e[n])}return t}function T1e(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){let r=e.slice(n+1,n+3);if(VR(r)){t+="%"+r.toUpperCase(),n+=2;continue}}t+=escape(e[n])}return t}function k1e(e){let t=[];if(e.userinfo!==void 0)t.push(e.userinfo),t.push("@");if(e.host!==void 0){let n=unescape(e.host);if(!m6(n)){let r=g6(n);if(r.isIPV6===!0)n=`[${r.escapedHost}]`;else n=_6(n,!1)}t.push(n)}if(typeof e.port==="number"||typeof e.port==="string")t.push(":"),t.push(String(e.port));return t.length?t.join(""):void 0}y6.exports={nonSimpleDomain:g1e,recomposeAuthority:k1e,reescapeHostDelimiters:_6,normalizePercentEncoding:w1e,normalizePathEncoding:A1e,escapePreservingEscapes:T1e,removeDotSegments:S1e,isIPv4:m6,isUUID:m1e,normalizeIPv6:g6,stringArrayToHexStripped:ZR}});var v6=k(function(Vkt,x6){var{isUUID:C1e}=YR(),R1e=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,O1e=["http","https","ws","wss","urn","urn:uuid"];function P1e(e){return O1e.indexOf(e)!==-1}function JR(e){if(e.secure===!0)return!0;else if(e.secure===!1)return!1;else if(e.scheme)return e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S");else return!1}function b6(e){if(!e.host)e.error=e.error||"HTTP URIs must have a host.";return e}function S6(e){let t=String(e.scheme).toLowerCase()==="https";if(e.port===(t?443:80)||e.port==="")e.port=void 0;if(!e.path)e.path="/";return e}function I1e(e){return e.secure=JR(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function D1e(e){if(e.port===(JR(e)?443:80)||e.port==="")e.port=void 0;if(typeof e.secure==="boolean")e.scheme=e.secure?"wss":"ws",e.secure=void 0;if(e.resourceName){let[t,n]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function L1e(e,t){if(!e.path)return e.error="URN can not be parsed",e;let n=e.path.match(R1e);if(n){let r=t.scheme||e.scheme||"urn";e.nid=n[1].toLowerCase(),e.nss=n[2];let o=`${r}:${t.nid||e.nid}`,s=XR(o);if(e.path=void 0,s)e=s.parse(e,t)}else e.error=e.error||"URN can not be parsed.";return e}function M1e(e,t){if(e.nid===void 0)throw Error("URN without nid cannot be serialized");let n=t.scheme||e.scheme||"urn",r=e.nid.toLowerCase(),o=`${n}:${t.nid||r}`,s=XR(o);if(s)e=s.serialize(e,t);let i=e,a=e.nss;return i.path=`${r||t.nid}:${a}`,t.skipEscape=!0,i}function N1e(e,t){let n=e;if(n.uuid=n.nss,n.nss=void 0,!t.tolerant&&(!n.uuid||!C1e(n.uuid)))n.error=n.error||"UUID is not valid.";return n}function U1e(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var E6={scheme:"http",domainHost:!0,parse:b6,serialize:S6},F1e={scheme:"https",domainHost:E6.domainHost,parse:b6,serialize:S6},Uy={scheme:"ws",domainHost:!0,parse:I1e,serialize:D1e},z1e={scheme:"wss",domainHost:Uy.domainHost,parse:Uy.parse,serialize:Uy.serialize},$1e={scheme:"urn",parse:L1e,serialize:M1e,skipNormalize:!0},j1e={scheme:"urn:uuid",parse:N1e,serialize:U1e,skipNormalize:!0},Fy={http:E6,https:F1e,ws:Uy,wss:z1e,urn:$1e,"urn:uuid":j1e};Object.setPrototypeOf(Fy,null);function XR(e){return e&&(Fy[e]||Fy[e.toLowerCase()])||void 0}x6.exports={wsIsSecure:JR,SCHEMES:Fy,isValidSchemeName:P1e,getSchemeHandler:XR}});var R6=k(function(Zkt,zy){var{normalizeIPv6:H1e,removeDotSegments:Nf,recomposeAuthority:B1e,normalizePercentEncoding:K1e,normalizePathEncoding:G1e,escapePreservingEscapes:W1e,reescapeHostDelimiters:q1e,isIPv4:V1e,nonSimpleDomain:Z1e}=YR(),{SCHEMES:Y1e,getSchemeHandler:A6}=v6();function J1e(e,t){if(typeof e==="string")e=nHe(e,t);else if(typeof e==="object")e=nu(Ca(e,t),t);return e}function X1e(e,t,n){let r=n?Object.assign({scheme:"null"},n):{scheme:"null"},o=T6(nu(e,r),nu(t,r),r,!0);return r.skipEscape=!0,Ca(o,r)}function T6(e,t,n,r){let o={};if(!r)e=nu(Ca(e,n),n),t=nu(Ca(t,n),n);if(n=n||{},!n.tolerant&&t.scheme)o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=Nf(t.path||""),o.query=t.query;else{if(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=Nf(t.path||""),o.query=t.query;else{if(!t.path)if(o.path=e.path,t.query!==void 0)o.query=t.query;else o.query=e.query;else{if(t.path[0]==="/")o.path=Nf(t.path);else{if((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path)o.path="/"+t.path;else if(!e.path)o.path=t.path;else o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path;o.path=Nf(o.path)}o.query=t.query}o.userinfo=e.userinfo,o.host=e.host,o.port=e.port}o.scheme=e.scheme}return o.fragment=t.fragment,o}function Q1e(e,t,n){let r=w6(e,n),o=w6(t,n);return r!==void 0&&o!==void 0&&r.toLowerCase()===o.toLowerCase()}function Ca(e,t){let n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},r=Object.assign({},t),o=[],s=A6(r.scheme||n.scheme);if(s&&s.serialize)s.serialize(n,r);if(n.path!==void 0)if(!r.skipEscape){if(n.path=W1e(n.path),n.scheme!==void 0)n.path=n.path.split("%3A").join(":")}else n.path=K1e(n.path);if(r.reference!=="suffix"&&n.scheme)o.push(n.scheme,":");let i=B1e(n);if(i!==void 0){if(r.reference!=="suffix")o.push("//");if(o.push(i),n.path&&n.path[0]!=="/")o.push("/")}if(n.path!==void 0){let a=n.path;if(!r.absolutePath&&(!s||!s.absolutePath))a=Nf(a);if(i===void 0&&a[0]==="/"&&a[1]==="/")a="/%2F"+a.slice(2);o.push(a)}if(n.query!==void 0)o.push("?",n.query);if(n.fragment!==void 0)o.push("#",n.fragment);return o.join("")}var eHe=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function tHe(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port==="number"&&(e.port<0||e.port>65535))return"URI port is malformed.";return}function k6(e,t){let n=Object.assign({},t),r={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1,s=!1;if(n.reference==="suffix")if(n.scheme)e=n.scheme+":"+e;else e="//"+e;let i=e.match(eHe);if(i){if(r.scheme=i[1],r.userinfo=i[3],r.host=i[4],r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=i[7],r.fragment=i[8],isNaN(r.port))r.port=i[5];let a=tHe(r,i);if(a!==void 0)r.error=r.error||a,o=!0;if(r.host)if(V1e(r.host)===!1){let u=H1e(r.host);r.host=u.host.toLowerCase(),s=u.isIPV6}else s=!0;if(r.scheme===void 0&&r.userinfo===void 0&&r.host===void 0&&r.port===void 0&&r.query===void 0&&!r.path)r.reference="same-document";else if(r.scheme===void 0)r.reference="relative";else if(r.fragment===void 0)r.reference="absolute";else r.reference="uri";if(n.reference&&n.reference!=="suffix"&&n.reference!==r.reference)r.error=r.error||"URI is not a "+n.reference+" reference.";let c=A6(n.scheme||r.scheme);if(!n.unicodeSupport&&(!c||!c.unicodeSupport)){if(r.host&&(n.domainHost||c&&c.domainHost)&&s===!1&&Z1e(r.host))try{r.host=URL.domainToASCII(r.host.toLowerCase())}catch(l){r.error=r.error||"Host's domain name can not be converted to ASCII: "+l}}if(!c||c&&!c.skipNormalize){if(e.indexOf("%")!==-1){if(r.scheme!==void 0)r.scheme=unescape(r.scheme);if(r.host!==void 0)r.host=q1e(unescape(r.host),s)}if(r.path)r.path=G1e(r.path);if(r.fragment)try{r.fragment=encodeURI(decodeURIComponent(r.fragment))}catch{r.error=r.error||"URI malformed"}}if(c&&c.parse)c.parse(r,n)}else r.error=r.error||"URI can not be parsed.";return{parsed:r,malformedAuthorityOrPort:o}}function nu(e,t){return k6(e,t).parsed}function nHe(e,t){return C6(e,t).normalized}function C6(e,t){let{parsed:n,malformedAuthorityOrPort:r}=k6(e,t);return{normalized:r?e:Ca(n,t),malformedAuthorityOrPort:r}}function w6(e,t){if(typeof e==="string"){let{normalized:n,malformedAuthorityOrPort:r}=C6(e,t);return r?void 0:n}if(typeof e==="object")return Ca(e,t)}var QR={SCHEMES:Y1e,normalize:J1e,resolve:X1e,resolveComponent:T6,equal:Q1e,serialize:Ca,parse:nu};zy.exports=QR;zy.exports.default=QR;zy.exports.fastUri=QR});var I6=k(function(P6){Object.defineProperty(P6,"__esModule",{value:!0});var O6=R6();O6.code='require("ajv/dist/runtime/uri").default';P6.default=O6});var $6=k(function(ms){Object.defineProperty(ms,"__esModule",{value:!0});ms.CodeGen=ms.Name=ms.nil=ms.stringify=ms.str=ms._=ms.KeywordCxt=void 0;var oHe=Df();Object.defineProperty(ms,"KeywordCxt",{enumerable:!0,get:function(){return oHe.KeywordCxt}});var ru=Ce();Object.defineProperty(ms,"_",{enumerable:!0,get:function(){return ru._}});Object.defineProperty(ms,"str",{enumerable:!0,get:function(){return ru.str}});Object.defineProperty(ms,"stringify",{enumerable:!0,get:function(){return ru.stringify}});Object.defineProperty(ms,"nil",{enumerable:!0,get:function(){return ru.nil}});Object.defineProperty(ms,"Name",{enumerable:!0,get:function(){return ru.Name}});Object.defineProperty(ms,"CodeGen",{enumerable:!0,get:function(){return ru.CodeGen}});var sHe=Ly(),U6=Lf(),iHe=PR(),Uf=Ny(),aHe=Ce(),Ff=Of(),$y=Rf(),tO=Ke(),D6=p6(),cHe=I6(),F6=(e,t)=>new RegExp(e,t);F6.code="new RegExp";var lHe=["removeAdditional","useDefaults","coerceTypes"],uHe=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),dHe={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},pHe={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},L6=200;function fHe(e){var t,n,r,o,s,i,a,c,l,u,p,f,m,h,_,y,S,b,x,v,T,U,M,F,W;let ce=e.strict,ne=(t=e.code)===null||t===void 0?void 0:t.optimize,se=ne===!0||ne===void 0?1:ne||0,Se=(r=(n=e.code)===null||n===void 0?void 0:n.regExp)!==null&&r!==void 0?r:F6,Te=(o=e.uriResolver)!==null&&o!==void 0?o:cHe.default;return{strictSchema:(i=(s=e.strictSchema)!==null&&s!==void 0?s:ce)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:ce)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=e.strictTypes)!==null&&l!==void 0?l:ce)!==null&&u!==void 0?u:"log",strictTuples:(f=(p=e.strictTuples)!==null&&p!==void 0?p:ce)!==null&&f!==void 0?f:"log",strictRequired:(h=(m=e.strictRequired)!==null&&m!==void 0?m:ce)!==null&&h!==void 0?h:!1,code:e.code?{...e.code,optimize:se,regExp:Se}:{optimize:se,regExp:Se},loopRequired:(_=e.loopRequired)!==null&&_!==void 0?_:L6,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:L6,meta:(S=e.meta)!==null&&S!==void 0?S:!0,messages:(b=e.messages)!==null&&b!==void 0?b:!0,inlineRefs:(x=e.inlineRefs)!==null&&x!==void 0?x:!0,schemaId:(v=e.schemaId)!==null&&v!==void 0?v:"$id",addUsedSchema:(T=e.addUsedSchema)!==null&&T!==void 0?T:!0,validateSchema:(U=e.validateSchema)!==null&&U!==void 0?U:!0,validateFormats:(M=e.validateFormats)!==null&&M!==void 0?M:!0,unicodeRegExp:(F=e.unicodeRegExp)!==null&&F!==void 0?F:!0,int32range:(W=e.int32range)!==null&&W!==void 0?W:!0,uriResolver:Te}}class jy{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...fHe(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new aHe.ValueScope({scope:{},prefixes:uHe,es5:t,lines:n}),this.logger=bHe(e.logger);let r=e.validateFormats;if(e.validateFormats=!1,this.RULES=(0,iHe.getRules)(),M6.call(this,dHe,e,"NOT SUPPORTED"),M6.call(this,pHe,e,"DEPRECATED","warn"),this._metaOpts=_He.call(this),e.formats)hHe.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)gHe.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);mHe.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,r=D6;if(n==="id")r={...D6},r.id=r.$id,delete r.$id;if(t&&e)this.addMetaSchema(r,r[n],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let r=n(t);if(!("$async"in n))this.errors=n.errors;return r}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(l,u){await o.call(this,l.$schema);let p=this._addSchema(l,u);return p.validate||s.call(this,p)}async function o(l){if(l&&!this.getSchema(l))await r.call(this,{$ref:l},!0)}async function s(l){try{return this._compileSchemaEnv(l)}catch(u){if(!(u instanceof U6.default))throw u;return i.call(this,u),await a.call(this,u.missingSchema),s.call(this,l)}}function i({missingSchema:l,missingRef:u}){if(this.refs[l])throw Error(`AnySchema ${l} is loaded but ${u} cannot be resolved`)}async function a(l){let u=await c.call(this,l);if(!this.refs[l])await o.call(this,u.$schema);if(!this.refs[l])this.addSchema(u,l,t)}async function c(l){let u=this._loading[l];if(u)return u;try{return await(this._loading[l]=n(l))}finally{delete this._loading[l]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(let s of e)this.addSchema(s,void 0,n,r);return this}let o;if(typeof e==="object"){let{schemaId:s}=this.opts;if(o=e[s],o!==void 0&&typeof o!="string")throw Error(`schema ${s} must be string`)}return t=(0,Ff.normalizeId)(t||o),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let r=this.validate(n,e);if(!r&&t){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw Error(o)}return r}getSchema(e){let t;while(typeof(t=N6.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:n}=this.opts,r=new Uf.SchemaEnv({schema:{},schemaId:n});if(t=Uf.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=N6.call(this,e);if(typeof t=="object")this._cache.delete(t.schema);return delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let n=e[this.opts.schemaId];if(n)n=(0,Ff.normalizeId)(n),delete this.schemas[n],delete this.refs[n];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if(typeof e=="string"){if(n=e,typeof t=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n}else if(typeof e=="object"&&t===void 0){if(t=e,n=t.keyword,Array.isArray(n)&&!n.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(EHe.call(this,n,t),!t)return(0,tO.eachItem)(n,(o)=>eO.call(this,o)),this;vHe.call(this,t);let r={...t,type:(0,$y.getJSONTypes)(t.type),schemaType:(0,$y.getJSONTypes)(t.schemaType)};return(0,tO.eachItem)(n,r.type.length===0?(o)=>eO.call(this,o,r):(o)=>r.type.forEach((s)=>eO.call(this,o,r,s))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let n of t.rules){let r=n.rules.findIndex((o)=>o.keyword===e);if(r>=0)n.rules.splice(r,1)}return this}addFormat(e,t){if(typeof t=="string")t=new RegExp(t);return this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:n="data"}={}){if(!e||e.length===0)return"No errors";return e.map((r)=>`${n}${r.instancePath} ${r.message}`).reduce((r,o)=>r+t+o)}$dataMetaSchema(e,t){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let r of t){let o=r.split("/").slice(1),s=e;for(let i of o)s=s[i];for(let i in n){let a=n[i];if(typeof a!="object")continue;let{$data:c}=a.definition,l=s[i];if(c&&l)s[i]=z6(l)}}return e}_removeAllSchemas(e,t){for(let n in e){let r=e[n];if(!t||t.test(n)){if(typeof r=="string")delete e[n];else if(r&&!r.meta)this._cache.delete(r.schema),delete e[n]}}}_addSchema(e,t,n,r=this.opts.validateSchema,o=this.opts.addUsedSchema){let s,{schemaId:i}=this.opts;if(typeof e=="object")s=e[i];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof e!="boolean")throw Error("schema must be object or boolean");let a=this._cache.get(e);if(a!==void 0)return a;n=(0,Ff.normalizeId)(s||n);let c=Ff.getSchemaRefs.call(this,e,n);if(a=new Uf.SchemaEnv({schema:e,schemaId:i,meta:t,baseId:n,localRefs:c}),this._cache.set(a.schema,a),o&&!n.startsWith("#")){if(n)this._checkUnique(n);this.refs[n]=a}if(r)this.validateSchema(e,!0);return a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta)this._compileMetaSchema(e);else Uf.compileSchema.call(this,e);if(!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{Uf.compileSchema.call(this,e)}finally{this.opts=t}}}jy.ValidationError=sHe.default;jy.MissingRefError=U6.default;ms.default=jy;function M6(e,t,n,r="error"){for(let o in e){let s=o;if(s in t)this.logger[r](`${n}: option ${o}. ${e[s]}`)}}function N6(e){return e=(0,Ff.normalizeId)(e),this.schemas[e]||this.refs[e]}function mHe(){let e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function hHe(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function gHe(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let n=e[t];if(!n.keyword)n.keyword=t;this.addKeyword(n)}}function _He(){let e={...this.opts};for(let t of lHe)delete e[t];return e}var yHe={log(){},warn(){},error(){}};function bHe(e){if(e===!1)return yHe;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}var SHe=/^[a-z_$][a-z0-9_$:-]*$/i;function EHe(e,t){let{RULES:n}=this;if((0,tO.eachItem)(e,(r)=>{if(n.keywords[r])throw Error(`Keyword ${r} is already defined`);if(!SHe.test(r))throw Error(`Keyword ${r} has invalid name`)}),!t)return;if(t.$data&&!(("code"in t)||("validate"in t)))throw Error('$data keyword must have "code" or "validate" function')}function eO(e,t,n){var r;let o=t===null||t===void 0?void 0:t.post;if(n&&o)throw Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,i=o?s.post:s.rules.find(({type:c})=>c===n);if(!i)i={type:n,rules:[]},s.rules.push(i);if(s.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:(0,$y.getJSONTypes)(t.type),schemaType:(0,$y.getJSONTypes)(t.schemaType)}};if(t.before)xHe.call(this,i,a,t.before);else i.rules.push(a);s.all[e]=a,(r=t.implements)===null||r===void 0||r.forEach((c)=>this.addKeyword(c))}function xHe(e,t,n){let r=e.rules.findIndex((o)=>o.keyword===n);if(r>=0)e.rules.splice(r,0,t);else e.rules.push(t),this.logger.warn(`rule ${n} is not defined`)}function vHe(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=z6(t);e.validateSchema=this.compile(t,!0)}var wHe={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function z6(e){return{anyOf:[e,wHe]}}});var H6=k(function(j6){Object.defineProperty(j6,"__esModule",{value:!0});var kHe={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};j6.default=kHe});var V6=k(function(W6){Object.defineProperty(W6,"__esModule",{value:!0});W6.callRef=W6.getValidate=void 0;var RHe=Lf(),B6=Nr(),Jn=Ce(),ou=ps(),K6=Ny(),Hy=Ke(),OHe={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:n,it:r}=e,{baseId:o,schemaEnv:s,validateName:i,opts:a,self:c}=r,{root:l}=s;if((n==="#"||n==="#/")&&o===l.baseId)return p();let u=K6.resolveRef.call(c,l,o,n);if(u===void 0)throw new RHe.default(r.opts.uriResolver,o,n);if(u instanceof K6.SchemaEnv)return f(u);return m(u);function p(){if(s===l)return By(e,i,s,s.$async);let h=t.scopeValue("root",{ref:l});return By(e,Jn._`${h}.validate`,l,l.$async)}function f(h){let _=G6(e,h);By(e,_,h,h.$async)}function m(h){let _=t.scopeValue("schema",a.code.source===!0?{ref:h,code:(0,Jn.stringify)(h)}:{ref:h}),y=t.name("valid"),S=e.subschema({schema:h,dataTypes:[],schemaPath:Jn.nil,topSchemaRef:_,errSchemaPath:n},y);e.mergeEvaluated(S),e.ok(y)}}};function G6(e,t){let{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):Jn._`${n.scopeValue("wrapper",{ref:t})}.validate`}W6.getValidate=G6;function By(e,t,n,r){let{gen:o,it:s}=e,{allErrors:i,schemaEnv:a,opts:c}=s,l=c.passContext?ou.default.this:Jn.nil;if(r)u();else p();function u(){if(!a.$async)throw Error("async schema referenced by sync schema");let h=o.let("valid");o.try(()=>{if(o.code(Jn._`await ${(0,B6.callValidateCode)(e,t,l)}`),m(t),!i)o.assign(h,!0)},(_)=>{if(o.if(Jn._`!(${_} instanceof ${s.ValidationError})`,()=>o.throw(_)),f(_),!i)o.assign(h,!1)}),e.ok(h)}function p(){e.result((0,B6.callValidateCode)(e,t,l),()=>m(t),()=>f(t))}function f(h){let _=Jn._`${h}.errors`;o.assign(ou.default.vErrors,Jn._`${ou.default.vErrors} === null ? ${_} : ${ou.default.vErrors}.concat(${_})`),o.assign(ou.default.errors,Jn._`${ou.default.vErrors}.length`)}function m(h){var _;if(!s.opts.unevaluated)return;let y=(_=n===null||n===void 0?void 0:n.validate)===null||_===void 0?void 0:_.evaluated;if(s.props!==!0)if(y&&!y.dynamicProps){if(y.props!==void 0)s.props=Hy.mergeEvaluated.props(o,y.props,s.props)}else{let S=o.var("props",Jn._`${h}.evaluated.props`);s.props=Hy.mergeEvaluated.props(o,S,s.props,Jn.Name)}if(s.items!==!0)if(y&&!y.dynamicItems){if(y.items!==void 0)s.items=Hy.mergeEvaluated.items(o,y.items,s.items)}else{let S=o.var("items",Jn._`${h}.evaluated.items`);s.items=Hy.mergeEvaluated.items(o,S,s.items,Jn.Name)}}}W6.callRef=By;W6.default=OHe});var Y6=k(function(Z6){Object.defineProperty(Z6,"__esModule",{value:!0});var DHe=H6(),LHe=V6(),MHe=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",DHe.default,LHe.default];Z6.default=MHe});var X6=k(function(J6){Object.defineProperty(J6,"__esModule",{value:!0});var Ky=Ce(),fi=Ky.operators,Gy={maximum:{okStr:"<=",ok:fi.LTE,fail:fi.GT},minimum:{okStr:">=",ok:fi.GTE,fail:fi.LT},exclusiveMaximum:{okStr:"<",ok:fi.LT,fail:fi.GTE},exclusiveMinimum:{okStr:">",ok:fi.GT,fail:fi.LTE}},UHe={message:({keyword:e,schemaCode:t})=>Ky.str`must be ${Gy[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Ky._`{comparison: ${Gy[e].okStr}, limit: ${t}}`},FHe={keyword:Object.keys(Gy),type:"number",schemaType:"number",$data:!0,error:UHe,code(e){let{keyword:t,data:n,schemaCode:r}=e;e.fail$data(Ky._`${n} ${Gy[t].fail} ${r} || isNaN(${n})`)}};J6.default=FHe});var e3=k(function(Q6){Object.defineProperty(Q6,"__esModule",{value:!0});var zf=Ce(),$He={message:({schemaCode:e})=>zf.str`must be multiple of ${e}`,params:({schemaCode:e})=>zf._`{multipleOf: ${e}}`},jHe={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:$He,code(e){let{gen:t,data:n,schemaCode:r,it:o}=e,s=o.opts.multipleOfPrecision,i=t.let("res"),a=s?zf._`Math.abs(Math.round(${i}) - ${i}) > 1e-${s}`:zf._`${i} !== parseInt(${i})`;e.fail$data(zf._`(${r} === 0 || (${i} = ${n}/${r}, ${a}))`)}};Q6.default=jHe});var r3=k(function(n3){Object.defineProperty(n3,"__esModule",{value:!0});function t3(e){let t=e.length,n=0,r=0,o;while(r<t)if(n++,o=e.charCodeAt(r++),o>=55296&&o<=56319&&r<t){if(o=e.charCodeAt(r),(o&64512)===56320)r++}return n}n3.default=t3;t3.code='require("ajv/dist/runtime/ucs2length").default'});var s3=k(function(o3){Object.defineProperty(o3,"__esModule",{value:!0});var Ra=Ce(),KHe=Ke(),GHe=r3(),WHe={message({keyword:e,schemaCode:t}){let n=e==="maxLength"?"more":"fewer";return Ra.str`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>Ra._`{limit: ${e}}`},qHe={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:WHe,code(e){let{keyword:t,data:n,schemaCode:r,it:o}=e,s=t==="maxLength"?Ra.operators.GT:Ra.operators.LT,i=o.opts.unicode===!1?Ra._`${n}.length`:Ra._`${(0,KHe.useFunc)(e.gen,GHe.default)}(${n})`;e.fail$data(Ra._`${i} ${s} ${r}`)}};o3.default=qHe});var a3=k(function(i3){Object.defineProperty(i3,"__esModule",{value:!0});var ZHe=Nr(),YHe=Ke(),su=Ce(),JHe={message:({schemaCode:e})=>su.str`must match pattern "${e}"`,params:({schemaCode:e})=>su._`{pattern: ${e}}`},XHe={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:JHe,code(e){let{gen:t,data:n,$data:r,schema:o,schemaCode:s,it:i}=e,a=i.opts.unicodeRegExp?"u":"";if(r){let{regExp:c}=i.opts.code,l=c.code==="new RegExp"?su._`new RegExp`:(0,YHe.useFunc)(t,c),u=t.let("valid");t.try(()=>t.assign(u,su._`${l}(${s}, ${a}).test(${n})`),()=>t.assign(u,!1)),e.fail$data(su._`!${u}`)}else{let c=(0,ZHe.usePattern)(e,o);e.fail$data(su._`!${c}.test(${n})`)}}};i3.default=XHe});var l3=k(function(c3){Object.defineProperty(c3,"__esModule",{value:!0});var $f=Ce(),eBe={message({keyword:e,schemaCode:t}){let n=e==="maxProperties"?"more":"fewer";return $f.str`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>$f._`{limit: ${e}}`},tBe={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:eBe,code(e){let{keyword:t,data:n,schemaCode:r}=e,o=t==="maxProperties"?$f.operators.GT:$f.operators.LT;e.fail$data($f._`Object.keys(${n}).length ${o} ${r}`)}};c3.default=tBe});var d3=k(function(u3){Object.defineProperty(u3,"__esModule",{value:!0});var jf=Nr(),Hf=Ce(),rBe=Ke(),oBe={message:({params:{missingProperty:e}})=>Hf.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>Hf._`{missingProperty: ${e}}`},sBe={keyword:"required",type:"object",schemaType:"array",$data:!0,error:oBe,code(e){let{gen:t,schema:n,schemaCode:r,data:o,$data:s,it:i}=e,{opts:a}=i;if(!s&&n.length===0)return;let c=n.length>=a.loopRequired;if(i.allErrors)l();else u();if(a.strictRequired){let m=e.parentSchema.properties,{definedProperties:h}=e.it;for(let _ of n)if((m===null||m===void 0?void 0:m[_])===void 0&&!h.has(_)){let y=i.schemaEnv.baseId+i.errSchemaPath,S=`required property "${_}" is not defined at "${y}" (strictRequired)`;(0,rBe.checkStrictMode)(i,S,i.opts.strictRequired)}}function l(){if(c||s)e.block$data(Hf.nil,p);else for(let m of n)(0,jf.checkReportMissingProp)(e,m)}function u(){let m=t.let("missing");if(c||s){let h=t.let("valid",!0);e.block$data(h,()=>f(m,h)),e.ok(h)}else t.if((0,jf.checkMissingProp)(e,n,m)),(0,jf.reportMissingProp)(e,m),t.else()}function p(){t.forOf("prop",r,(m)=>{e.setParams({missingProperty:m}),t.if((0,jf.noPropertyInData)(t,o,m,a.ownProperties),()=>e.error())})}function f(m,h){e.setParams({missingProperty:m}),t.forOf(m,r,()=>{t.assign(h,(0,jf.propertyInData)(t,o,m,a.ownProperties)),t.if((0,Hf.not)(h),()=>{e.error(),t.break()})},Hf.nil)}}};u3.default=sBe});var f3=k(function(p3){Object.defineProperty(p3,"__esModule",{value:!0});var Bf=Ce(),aBe={message({keyword:e,schemaCode:t}){let n=e==="maxItems"?"more":"fewer";return Bf.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>Bf._`{limit: ${e}}`},cBe={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:aBe,code(e){let{keyword:t,data:n,schemaCode:r}=e,o=t==="maxItems"?Bf.operators.GT:Bf.operators.LT;e.fail$data(Bf._`${n}.length ${o} ${r}`)}};p3.default=cBe});var Wy=k(function(h3){Object.defineProperty(h3,"__esModule",{value:!0});var m3=zR();m3.code='require("ajv/dist/runtime/equal").default';h3.default=m3});var _3=k(function(g3){Object.defineProperty(g3,"__esModule",{value:!0});var nO=Rf(),fn=Ce(),dBe=Ke(),pBe=Wy(),fBe={message:({params:{i:e,j:t}})=>fn.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>fn._`{i: ${e}, j: ${t}}`},mBe={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:fBe,code(e){let{gen:t,data:n,$data:r,schema:o,parentSchema:s,schemaCode:i,it:a}=e;if(!r&&!o)return;let c=t.let("valid"),l=s.items?(0,nO.getSchemaTypes)(s.items):[];e.block$data(c,u,fn._`${i} === false`),e.ok(c);function u(){let h=t.let("i",fn._`${n}.length`),_=t.let("j");e.setParams({i:h,j:_}),t.assign(c,!0),t.if(fn._`${h} > 1`,()=>(p()?f:m)(h,_))}function p(){return l.length>0&&!l.some((h)=>h==="object"||h==="array")}function f(h,_){let y=t.name("item"),S=(0,nO.checkDataTypes)(l,y,a.opts.strictNumbers,nO.DataType.Wrong),b=t.const("indices",fn._`{}`);t.for(fn._`;${h}--;`,()=>{if(t.let(y,fn._`${n}[${h}]`),t.if(S,fn._`continue`),l.length>1)t.if(fn._`typeof ${y} == "string"`,fn._`${y} += "_"`);t.if(fn._`typeof ${b}[${y}] == "number"`,()=>{t.assign(_,fn._`${b}[${y}]`),e.error(),t.assign(c,!1).break()}).code(fn._`${b}[${y}] = ${h}`)})}function m(h,_){let y=(0,dBe.useFunc)(t,pBe.default),S=t.name("outer");t.label(S).for(fn._`;${h}--;`,()=>t.for(fn._`${_} = ${h}; ${_}--;`,()=>t.if(fn._`${y}(${n}[${h}], ${n}[${_}])`,()=>{e.error(),t.assign(c,!1).break(S)})))}}};g3.default=mBe});var b3=k(function(y3){Object.defineProperty(y3,"__esModule",{value:!0});var rO=Ce(),gBe=Ke(),_Be=Wy(),yBe={message:"must be equal to constant",params:({schemaCode:e})=>rO._`{allowedValue: ${e}}`},bBe={keyword:"const",$data:!0,error:yBe,code(e){let{gen:t,data:n,$data:r,schemaCode:o,schema:s}=e;if(r||s&&typeof s=="object")e.fail$data(rO._`!${(0,gBe.useFunc)(t,_Be.default)}(${n}, ${o})`);else e.fail(rO._`${s} !== ${n}`)}};y3.default=bBe});var E3=k(function(S3){Object.defineProperty(S3,"__esModule",{value:!0});var Kf=Ce(),EBe=Ke(),xBe=Wy(),vBe={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>Kf._`{allowedValues: ${e}}`},wBe={keyword:"enum",schemaType:"array",$data:!0,error:vBe,code(e){let{gen:t,data:n,$data:r,schema:o,schemaCode:s,it:i}=e;if(!r&&o.length===0)throw Error("enum must have non-empty array");let a=o.length>=i.opts.loopEnum,c,l=()=>c!==null&&c!==void 0?c:c=(0,EBe.useFunc)(t,xBe.default),u;if(a||r)u=t.let("valid"),e.block$data(u,p);else{if(!Array.isArray(o))throw Error("ajv implementation error");let m=t.const("vSchema",s);u=(0,Kf.or)(...o.map((h,_)=>f(m,_)))}e.pass(u);function p(){t.assign(u,!1),t.forOf("v",s,(m)=>t.if(Kf._`${l()}(${n}, ${m})`,()=>t.assign(u,!0).break()))}function f(m,h){let _=o[h];return typeof _==="object"&&_!==null?Kf._`${l()}(${n}, ${m}[${h}])`:Kf._`${n} === ${_}`}}};S3.default=wBe});var v3=k(function(x3){Object.defineProperty(x3,"__esModule",{value:!0});var TBe=X6(),kBe=e3(),CBe=s3(),RBe=a3(),OBe=l3(),PBe=d3(),IBe=f3(),DBe=_3(),LBe=b3(),MBe=E3(),NBe=[TBe.default,kBe.default,CBe.default,RBe.default,OBe.default,PBe.default,IBe.default,DBe.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},LBe.default,MBe.default];x3.default=NBe});var sO=k(function(A3){Object.defineProperty(A3,"__esModule",{value:!0});A3.validateAdditionalItems=void 0;var Oa=Ce(),oO=Ke(),FBe={message:({params:{len:e}})=>Oa.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Oa._`{limit: ${e}}`},zBe={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:FBe,code(e){let{parentSchema:t,it:n}=e,{items:r}=t;if(!Array.isArray(r)){(0,oO.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}w3(e,r)}};function w3(e,t){let{gen:n,schema:r,data:o,keyword:s,it:i}=e;i.items=!0;let a=n.const("len",Oa._`${o}.length`);if(r===!1)e.setParams({len:t.length}),e.pass(Oa._`${a} <= ${t.length}`);else if(typeof r=="object"&&!(0,oO.alwaysValidSchema)(i,r)){let l=n.var("valid",Oa._`${a} <= ${t.length}`);n.if((0,Oa.not)(l),()=>c(l)),e.ok(l)}function c(l){n.forRange("i",t.length,a,(u)=>{if(e.subschema({keyword:s,dataProp:u,dataPropType:oO.Type.Num},l),!i.allErrors)n.if((0,Oa.not)(l),()=>n.break())})}}A3.validateAdditionalItems=w3;A3.default=zBe});var iO=k(function(R3){Object.defineProperty(R3,"__esModule",{value:!0});R3.validateTuple=void 0;var k3=Ce(),qy=Ke(),jBe=Nr(),HBe={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:n}=e;if(Array.isArray(t))return C3(e,"additionalItems",t);if(n.items=!0,(0,qy.alwaysValidSchema)(n,t))return;e.ok((0,jBe.validateArray)(e))}};function C3(e,t,n=e.schema){let{gen:r,parentSchema:o,data:s,keyword:i,it:a}=e;if(u(o),a.opts.unevaluated&&n.length&&a.items!==!0)a.items=qy.mergeEvaluated.items(r,n.length,a.items);let c=r.name("valid"),l=r.const("len",k3._`${s}.length`);n.forEach((p,f)=>{if((0,qy.alwaysValidSchema)(a,p))return;r.if(k3._`${l} > ${f}`,()=>e.subschema({keyword:i,schemaProp:f,dataProp:f},c)),e.ok(c)});function u(p){let{opts:f,errSchemaPath:m}=a,h=n.length,_=h===p.minItems&&(h===p.maxItems||p[t]===!1);if(f.strictTuples&&!_){let y=`"${i}" is ${h}-tuple, but minItems or maxItems/${t} are not specified or different at path "${m}"`;(0,qy.checkStrictMode)(a,y,f.strictTuples)}}}R3.validateTuple=C3;R3.default=HBe});var I3=k(function(P3){Object.defineProperty(P3,"__esModule",{value:!0});var KBe=iO(),GBe={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>(0,KBe.validateTuple)(e,"items")};P3.default=GBe});var M3=k(function(L3){Object.defineProperty(L3,"__esModule",{value:!0});var D3=Ce(),qBe=Ke(),VBe=Nr(),ZBe=sO(),YBe={message:({params:{len:e}})=>D3.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>D3._`{limit: ${e}}`},JBe={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:YBe,code(e){let{schema:t,parentSchema:n,it:r}=e,{prefixItems:o}=n;if(r.items=!0,(0,qBe.alwaysValidSchema)(r,t))return;if(o)(0,ZBe.validateAdditionalItems)(e,o);else e.ok((0,VBe.validateArray)(e))}};L3.default=JBe});var U3=k(function(N3){Object.defineProperty(N3,"__esModule",{value:!0});var Ur=Ce(),Vy=Ke(),QBe={message:({params:{min:e,max:t}})=>t===void 0?Ur.str`must contain at least ${e} valid item(s)`:Ur.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?Ur._`{minContains: ${e}}`:Ur._`{minContains: ${e}, maxContains: ${t}}`},e2e={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:QBe,code(e){let{gen:t,schema:n,parentSchema:r,data:o,it:s}=e,i,a,{minContains:c,maxContains:l}=r;if(s.opts.next)i=c===void 0?1:c,a=l;else i=1;let u=t.const("len",Ur._`${o}.length`);if(e.setParams({min:i,max:a}),a===void 0&&i===0){(0,Vy.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){(0,Vy.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Vy.alwaysValidSchema)(s,n)){let _=Ur._`${u} >= ${i}`;if(a!==void 0)_=Ur._`${_} && ${u} <= ${a}`;e.pass(_);return}s.items=!0;let p=t.name("valid");if(a===void 0&&i===1)m(p,()=>t.if(p,()=>t.break()));else if(i===0){if(t.let(p,!0),a!==void 0)t.if(Ur._`${o}.length > 0`,f)}else t.let(p,!1),f();e.result(p,()=>e.reset());function f(){let _=t.name("_valid"),y=t.let("count",0);m(_,()=>t.if(_,()=>h(y)))}function m(_,y){t.forRange("i",0,u,(S)=>{e.subschema({keyword:"contains",dataProp:S,dataPropType:Vy.Type.Num,compositeRule:!0},_),y()})}function h(_){if(t.code(Ur._`${_}++`),a===void 0)t.if(Ur._`${_} >= ${i}`,()=>t.assign(p,!0).break());else if(t.if(Ur._`${_} > ${a}`,()=>t.assign(p,!1).break()),i===1)t.assign(p,!0);else t.if(Ur._`${_} >= ${i}`,()=>t.assign(p,!0))}}};N3.default=e2e});var B3=k(function($3){Object.defineProperty($3,"__esModule",{value:!0});$3.validateSchemaDeps=$3.validatePropertyDeps=$3.error=void 0;var aO=Ce(),n2e=Ke(),Gf=Nr();$3.error={message:({params:{property:e,depsCount:t,deps:n}})=>{let r=t===1?"property":"properties";return aO.str`must have ${r} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:n,missingProperty:r}})=>aO._`{property: ${e},
missingProperty: ${r},
depsCount: ${t},
deps: ${n}}`};var r2e={keyword:"dependencies",type:"object",schemaType:"object",error:$3.error,code(e){let[t,n]=o2e(e);F3(e,t),z3(e,n)}};function o2e({schema:e}){let t={},n={};for(let r in e){if(r==="__proto__")continue;let o=Array.isArray(e[r])?t:n;o[r]=e[r]}return[t,n]}function F3(e,t=e.schema){let{gen:n,data:r,it:o}=e;if(Object.keys(t).length===0)return;let s=n.let("missing");for(let i in t){let a=t[i];if(a.length===0)continue;let c=(0,Gf.propertyInData)(n,r,i,o.opts.ownProperties);if(e.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),o.allErrors)n.if(c,()=>{for(let l of a)(0,Gf.checkReportMissingProp)(e,l)});else n.if(aO._`${c} && (${(0,Gf.checkMissingProp)(e,a,s)})`),(0,Gf.reportMissingProp)(e,s),n.else()}}$3.validatePropertyDeps=F3;function z3(e,t=e.schema){let{gen:n,data:r,keyword:o,it:s}=e,i=n.name("valid");for(let a in t){if((0,n2e.alwaysValidSchema)(s,t[a]))continue;n.if((0,Gf.propertyInData)(n,r,a,s.opts.ownProperties),()=>{let c=e.subschema({keyword:o,schemaProp:a},i);e.mergeValidEvaluated(c,i)},()=>n.var(i,!0)),e.ok(i)}}$3.validateSchemaDeps=z3;$3.default=r2e});var W3=k(function(G3){Object.defineProperty(G3,"__esModule",{value:!0});var K3=Ce(),a2e=Ke(),c2e={message:"property name must be valid",params:({params:e})=>K3._`{propertyName: ${e.propertyName}}`},l2e={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:c2e,code(e){let{gen:t,schema:n,data:r,it:o}=e;if((0,a2e.alwaysValidSchema)(o,n))return;let s=t.name("valid");t.forIn("key",r,(i)=>{e.setParams({propertyName:i}),e.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},s),t.if((0,K3.not)(s),()=>{if(e.error(!0),!o.allErrors)t.break()})}),e.ok(s)}};G3.default=l2e});var cO=k(function(q3){Object.defineProperty(q3,"__esModule",{value:!0});var Zy=Nr(),go=Ce(),d2e=ps(),Yy=Ke(),p2e={message:"must NOT have additional properties",params:({params:e})=>go._`{additionalProperty: ${e.additionalProperty}}`},f2e={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:p2e,code(e){let{gen:t,schema:n,parentSchema:r,data:o,errsCount:s,it:i}=e;if(!s)throw Error("ajv implementation error");let{allErrors:a,opts:c}=i;if(i.props=!0,c.removeAdditional!=="all"&&(0,Yy.alwaysValidSchema)(i,n))return;let l=(0,Zy.allSchemaProperties)(r.properties),u=(0,Zy.allSchemaProperties)(r.patternProperties);p(),e.ok(go._`${s} === ${d2e.default.errors}`);function p(){t.forIn("key",o,(y)=>{if(!l.length&&!u.length)h(y);else t.if(f(y),()=>h(y))})}function f(y){let S;if(l.length>8){let b=(0,Yy.schemaRefOrVal)(i,r.properties,"properties");S=(0,Zy.isOwnProperty)(t,b,y)}else if(l.length)S=(0,go.or)(...l.map((b)=>go._`${y} === ${b}`));else S=go.nil;if(u.length)S=(0,go.or)(S,...u.map((b)=>go._`${(0,Zy.usePattern)(e,b)}.test(${y})`));return(0,go.not)(S)}function m(y){t.code(go._`delete ${o}[${y}]`)}function h(y){if(c.removeAdditional==="all"||c.removeAdditional&&n===!1){m(y);return}if(n===!1){if(e.setParams({additionalProperty:y}),e.error(),!a)t.break();return}if(typeof n=="object"&&!(0,Yy.alwaysValidSchema)(i,n)){let S=t.name("valid");if(c.removeAdditional==="failing")_(y,S,!1),t.if((0,go.not)(S),()=>{e.reset(),m(y)});else if(_(y,S),!a)t.if((0,go.not)(S),()=>t.break())}}function _(y,S,b){let x={keyword:"additionalProperties",dataProp:y,dataPropType:Yy.Type.Str};if(b===!1)Object.assign(x,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(x,S)}}};q3.default=f2e});var J3=k(function(Y3){Object.defineProperty(Y3,"__esModule",{value:!0});var h2e=Df(),V3=Nr(),lO=Ke(),Z3=cO(),g2e={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:n,parentSchema:r,data:o,it:s}=e;if(s.opts.removeAdditional==="all"&&r.additionalProperties===void 0)Z3.default.code(new h2e.KeywordCxt(s,Z3.default,"additionalProperties"));let i=(0,V3.allSchemaProperties)(n);for(let p of i)s.definedProperties.add(p);if(s.opts.unevaluated&&i.length&&s.props!==!0)s.props=lO.mergeEvaluated.props(t,(0,lO.toHash)(i),s.props);let a=i.filter((p)=>!(0,lO.alwaysValidSchema)(s,n[p]));if(a.length===0)return;let c=t.name("valid");for(let p of a){if(l(p))u(p);else{if(t.if((0,V3.propertyInData)(t,o,p,s.opts.ownProperties)),u(p),!s.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(p),e.ok(c)}function l(p){return s.opts.useDefaults&&!s.compositeRule&&n[p].default!==void 0}function u(p){e.subschema({keyword:"properties",schemaProp:p,dataProp:p},c)}}};Y3.default=g2e});var n9=k(function(t9){Object.defineProperty(t9,"__esModule",{value:!0});var X3=Nr(),Jy=Ce(),Q3=Ke(),e9=Ke(),y2e={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:n,data:r,parentSchema:o,it:s}=e,{opts:i}=s,a=(0,X3.allSchemaProperties)(n),c=a.filter((_)=>(0,Q3.alwaysValidSchema)(s,n[_]));if(a.length===0||c.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let l=i.strictSchema&&!i.allowMatchingProperties&&o.properties,u=t.name("valid");if(s.props!==!0&&!(s.props instanceof Jy.Name))s.props=(0,e9.evaluatedPropsToName)(t,s.props);let{props:p}=s;f();function f(){for(let _ of a){if(l)m(_);if(s.allErrors)h(_);else t.var(u,!0),h(_),t.if(u)}}function m(_){for(let y in l)if(new RegExp(_).test(y))(0,Q3.checkStrictMode)(s,`property ${y} matches pattern ${_} (use allowMatchingProperties)`)}function h(_){t.forIn("key",r,(y)=>{t.if(Jy._`${(0,X3.usePattern)(e,_)}.test(${y})`,()=>{let S=c.includes(_);if(!S)e.subschema({keyword:"patternProperties",schemaProp:_,dataProp:y,dataPropType:e9.Type.Str},u);if(s.opts.unevaluated&&p!==!0)t.assign(Jy._`${p}[${y}]`,!0);else if(!S&&!s.allErrors)t.if((0,Jy.not)(u),()=>t.break())})})}}};t9.default=y2e});var o9=k(function(r9){Object.defineProperty(r9,"__esModule",{value:!0});var S2e=Ke(),E2e={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:n,it:r}=e;if((0,S2e.alwaysValidSchema)(r,n)){e.fail();return}let o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};r9.default=E2e});var i9=k(function(s9){Object.defineProperty(s9,"__esModule",{value:!0});var v2e=Nr(),w2e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:v2e.validateUnion,error:{message:"must match a schema in anyOf"}};s9.default=w2e});var c9=k(function(a9){Object.defineProperty(a9,"__esModule",{value:!0});var Xy=Ce(),T2e=Ke(),k2e={message:"must match exactly one schema in oneOf",params:({params:e})=>Xy._`{passingSchemas: ${e.passing}}`},C2e={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:k2e,code(e){let{gen:t,schema:n,parentSchema:r,it:o}=e;if(!Array.isArray(n))throw Error("ajv implementation error");if(o.opts.discriminator&&r.discriminator)return;let s=n,i=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(l),e.result(i,()=>e.reset(),()=>e.error(!0));function l(){s.forEach((u,p)=>{let f;if((0,T2e.alwaysValidSchema)(o,u))t.var(c,!0);else f=e.subschema({keyword:"oneOf",schemaProp:p,compositeRule:!0},c);if(p>0)t.if(Xy._`${c} && ${i}`).assign(i,!1).assign(a,Xy._`[${a}, ${p}]`).else();t.if(c,()=>{if(t.assign(i,!0),t.assign(a,p),f)e.mergeEvaluated(f,Xy.Name)})})}}};a9.default=C2e});var u9=k(function(l9){Object.defineProperty(l9,"__esModule",{value:!0});var O2e=Ke(),P2e={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:n,it:r}=e;if(!Array.isArray(n))throw Error("ajv implementation error");let o=t.name("valid");n.forEach((s,i)=>{if((0,O2e.alwaysValidSchema)(r,s))return;let a=e.subschema({keyword:"allOf",schemaProp:i},o);e.ok(o),e.mergeEvaluated(a)})}};l9.default=P2e});var m9=k(function(f9){Object.defineProperty(f9,"__esModule",{value:!0});var Qy=Ce(),p9=Ke(),D2e={message:({params:e})=>Qy.str`must match "${e.ifClause}" schema`,params:({params:e})=>Qy._`{failingKeyword: ${e.ifClause}}`},L2e={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:D2e,code(e){let{gen:t,parentSchema:n,it:r}=e;if(n.then===void 0&&n.else===void 0)(0,p9.checkStrictMode)(r,'"if" without "then" and "else" is ignored');let o=d9(r,"then"),s=d9(r,"else");if(!o&&!s)return;let i=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),o&&s){let u=t.let("ifClause");e.setParams({ifClause:u}),t.if(a,l("then",u),l("else",u))}else if(o)t.if(a,l("then"));else t.if((0,Qy.not)(a),l("else"));e.pass(i,()=>e.error(!0));function c(){let u=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(u)}function l(u,p){return()=>{let f=e.subschema({keyword:u},a);if(t.assign(i,a),e.mergeValidEvaluated(f,i),p)t.assign(p,Qy._`${u}`);else e.setParams({ifClause:u})}}}};function d9(e,t){let n=e.schema[t];return n!==void 0&&!(0,p9.alwaysValidSchema)(e,n)}f9.default=L2e});var g9=k(function(h9){Object.defineProperty(h9,"__esModule",{value:!0});var N2e=Ke(),U2e={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){if(t.if===void 0)(0,N2e.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};h9.default=U2e});var y9=k(function(_9){Object.defineProperty(_9,"__esModule",{value:!0});var z2e=sO(),$2e=I3(),j2e=iO(),H2e=M3(),B2e=U3(),K2e=B3(),G2e=W3(),W2e=cO(),q2e=J3(),V2e=n9(),Z2e=o9(),Y2e=i9(),J2e=c9(),X2e=u9(),Q2e=m9(),eKe=g9();function tKe(e=!1){let t=[Z2e.default,Y2e.default,J2e.default,X2e.default,Q2e.default,eKe.default,G2e.default,W2e.default,K2e.default,q2e.default,V2e.default];if(e)t.push($2e.default,H2e.default);else t.push(z2e.default,j2e.default);return t.push(B2e.default),t}_9.default=tKe});var S9=k(function(b9){Object.defineProperty(b9,"__esModule",{value:!0});var Ut=Ce(),rKe={message:({schemaCode:e})=>Ut.str`must match format "${e}"`,params:({schemaCode:e})=>Ut._`{format: ${e}}`},oKe={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:rKe,code(e,t){let{gen:n,data:r,$data:o,schema:s,schemaCode:i,it:a}=e,{opts:c,errSchemaPath:l,schemaEnv:u,self:p}=a;if(!c.validateFormats)return;if(o)f();else m();function f(){let h=n.scopeValue("formats",{ref:p.formats,code:c.code.formats}),_=n.const("fDef",Ut._`${h}[${i}]`),y=n.let("fType"),S=n.let("format");n.if(Ut._`typeof ${_} == "object" && !(${_} instanceof RegExp)`,()=>n.assign(y,Ut._`${_}.type || "string"`).assign(S,Ut._`${_}.validate`),()=>n.assign(y,Ut._`"string"`).assign(S,_)),e.fail$data((0,Ut.or)(b(),x()));function b(){if(c.strictSchema===!1)return Ut.nil;return Ut._`${i} && !${S}`}function x(){let v=u.$async?Ut._`(${_}.async ? await ${S}(${r}) : ${S}(${r}))`:Ut._`${S}(${r})`,T=Ut._`(typeof ${S} == "function" ? ${v} : ${S}.test(${r}))`;return Ut._`${S} && ${S} !== true && ${y} === ${t} && !${T}`}}function m(){let h=p.formats[s];if(!h){b();return}if(h===!0)return;let[_,y,S]=x(h);if(_===t)e.pass(v());function b(){if(c.strictSchema===!1){p.logger.warn(T());return}throw Error(T());function T(){return`unknown format "${s}" ignored in schema at path "${l}"`}}function x(T){let U=T instanceof RegExp?(0,Ut.regexpCode)(T):c.code.formats?Ut._`${c.code.formats}${(0,Ut.getProperty)(s)}`:void 0,M=n.scopeValue("formats",{key:s,ref:T,code:U});if(typeof T=="object"&&!(T instanceof RegExp))return[T.type||"string",T.validate,Ut._`${M}.validate`];return["string",T,M]}function v(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!u.$async)throw Error("async format in sync schema");return Ut._`await ${S}(${r})`}return typeof y=="function"?Ut._`${S}(${r})`:Ut._`${S}.test(${r})`}}}};b9.default=oKe});var x9=k(function(E9){Object.defineProperty(E9,"__esModule",{value:!0});var iKe=S9(),aKe=[iKe.default];E9.default=aKe});var A9=k(function(v9){Object.defineProperty(v9,"__esModule",{value:!0});v9.contentVocabulary=v9.metadataVocabulary=void 0;v9.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];v9.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var C9=k(function(k9){Object.defineProperty(k9,"__esModule",{value:!0});var uKe=Y6(),dKe=v3(),pKe=y9(),fKe=x9(),T9=A9(),mKe=[uKe.default,dKe.default,(0,pKe.default)(),fKe.default,T9.metadataVocabulary,T9.contentVocabulary];k9.default=mKe});var I9=k(function(O9){Object.defineProperty(O9,"__esModule",{value:!0});O9.DiscrError=void 0;var R9;(function(e){e.Tag="tag",e.Mapping="mapping"})(R9||(O9.DiscrError=R9={}))});var M9=k(function(L9){Object.defineProperty(L9,"__esModule",{value:!0});var iu=Ce(),uO=I9(),D9=Ny(),gKe=Lf(),_Ke=Ke(),yKe={message:({params:{discrError:e,tagName:t}})=>e===uO.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>iu._`{error: ${e}, tag: ${n}, tagValue: ${t}}`},bKe={keyword:"discriminator",type:"object",schemaType:"object",error:yKe,code(e){let{gen:t,data:n,schema:r,parentSchema:o,it:s}=e,{oneOf:i}=o;if(!s.opts.discriminator)throw Error("discriminator: requires discriminator option");let a=r.propertyName;if(typeof a!="string")throw Error("discriminator: requires propertyName");if(r.mapping)throw Error("discriminator: mapping is not supported");if(!i)throw Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),l=t.const("tag",iu._`${n}${(0,iu.getProperty)(a)}`);t.if(iu._`typeof ${l} == "string"`,()=>u(),()=>e.error(!1,{discrError:uO.DiscrError.Tag,tag:l,tagName:a})),e.ok(c);function u(){let m=f();t.if(!1);for(let h in m)t.elseIf(iu._`${l} === ${h}`),t.assign(c,p(m[h]));t.else(),e.error(!1,{discrError:uO.DiscrError.Mapping,tag:l,tagName:a}),t.endIf()}function p(m){let h=t.name("valid"),_=e.subschema({keyword:"oneOf",schemaProp:m},h);return e.mergeEvaluated(_,iu.Name),h}function f(){var m;let h={},_=S(o),y=!0;for(let v=0;v<i.length;v++){let T=i[v];if((T===null||T===void 0?void 0:T.$ref)&&!(0,_Ke.schemaHasRulesButRef)(T,s.self.RULES)){let M=T.$ref;if(T=D9.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,M),T instanceof D9.SchemaEnv)T=T.schema;if(T===void 0)throw new gKe.default(s.opts.uriResolver,s.baseId,M)}let U=(m=T===null||T===void 0?void 0:T.properties)===null||m===void 0?void 0:m[a];if(typeof U!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(_||S(T)),b(U,v)}if(!y)throw Error(`discriminator: "${a}" must be required`);return h;function S({required:v}){return Array.isArray(v)&&v.includes(a)}function b(v,T){if(v.const)x(v.const,T);else if(v.enum)for(let U of v.enum)x(U,T);else throw Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function x(v,T){if(typeof v!="string"||v in h)throw Error(`discriminator: "${a}" values must be unique strings`);h[v]=T}}}};L9.default=bKe});var N9=k(function(BCt,EKe){EKe.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var pO=k(function(Xn,dO){Object.defineProperty(Xn,"__esModule",{value:!0});Xn.MissingRefError=Xn.ValidationError=Xn.CodeGen=Xn.Name=Xn.nil=Xn.stringify=Xn.str=Xn._=Xn.KeywordCxt=Xn.Ajv=void 0;var xKe=$6(),vKe=C9(),wKe=M9(),U9=N9(),AKe=["/properties"],eb="http://json-schema.org/draft-07/schema";class Wf extends xKe.default{_addVocabularies(){if(super._addVocabularies(),vKe.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(wKe.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(U9,AKe):U9;this.addMetaSchema(e,eb,!1),this.refs["http://json-schema.org/schema"]=eb}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(eb)?eb:void 0)}}Xn.Ajv=Wf;dO.exports=Xn=Wf;dO.exports.Ajv=Wf;Object.defineProperty(Xn,"__esModule",{value:!0});Xn.default=Wf;var TKe=Df();Object.defineProperty(Xn,"KeywordCxt",{enumerable:!0,get:function(){return TKe.KeywordCxt}});var au=Ce();Object.defineProperty(Xn,"_",{enumerable:!0,get:function(){return au._}});Object.defineProperty(Xn,"str",{enumerable:!0,get:function(){return au.str}});Object.defineProperty(Xn,"stringify",{enumerable:!0,get:function(){return au.stringify}});Object.defineProperty(Xn,"nil",{enumerable:!0,get:function(){return au.nil}});Object.defineProperty(Xn,"Name",{enumerable:!0,get:function(){return au.Name}});Object.defineProperty(Xn,"CodeGen",{enumerable:!0,get:function(){return au.CodeGen}});var kKe=Ly();Object.defineProperty(Xn,"ValidationError",{enumerable:!0,get:function(){return kKe.default}});var CKe=Lf();Object.defineProperty(Xn,"MissingRefError",{enumerable:!0,get:function(){return CKe.default}})});var q9=k(function(G9){Object.defineProperty(G9,"__esModule",{value:!0});G9.formatNames=G9.fastFormats=G9.fullFormats=void 0;function Fo(e,t){return{validate:e,compare:t}}G9.fullFormats={date:Fo(j9,gO),time:Fo(mO(!0),_O),"date-time":Fo(F9(!0),B9),"iso-time":Fo(mO(),H9),"iso-date-time":Fo(F9(),K9),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:NKe,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:BKe,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:UKe,int32:{type:"number",validate:$Ke},int64:{type:"number",validate:jKe},float:{type:"number",validate:$9},double:{type:"number",validate:$9},password:!0,binary:!0};G9.fastFormats={...G9.fullFormats,date:Fo(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,gO),time:Fo(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,_O),"date-time":Fo(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,B9),"iso-time":Fo(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,H9),"iso-date-time":Fo(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,K9),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};G9.formatNames=Object.keys(G9.fullFormats);function PKe(e){return e%4===0&&(e%100!==0||e%400===0)}var IKe=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,DKe=[0,31,28,31,30,31,30,31,31,30,31,30,31];function j9(e){let t=IKe.exec(e);if(!t)return!1;let n=+t[1],r=+t[2],o=+t[3];return r>=1&&r<=12&&o>=1&&o<=(r===2&&PKe(n)?29:DKe[r])}function gO(e,t){if(!(e&&t))return;if(e>t)return 1;if(e<t)return-1;return 0}var fO=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function mO(e){return function(n){let r=fO.exec(n);if(!r)return!1;let o=+r[1],s=+r[2],i=+r[3],a=r[4],c=r[5]==="-"?-1:1,l=+(r[6]||0),u=+(r[7]||0);if(l>23||u>59||e&&!a)return!1;if(o<=23&&s<=59&&i<60)return!0;let p=s-u*c,f=o-l*c-(p<0?1:0);return(f===23||f===-1)&&(p===59||p===-1)&&i<61}}function _O(e,t){if(!(e&&t))return;let n=new Date("2020-01-01T"+e).valueOf(),r=new Date("2020-01-01T"+t).valueOf();if(!(n&&r))return;return n-r}function H9(e,t){if(!(e&&t))return;let n=fO.exec(e),r=fO.exec(t);if(!(n&&r))return;if(e=n[1]+n[2]+n[3],t=r[1]+r[2]+r[3],e>t)return 1;if(e<t)return-1;return 0}var hO=/t|\s/i;function F9(e){let t=mO(e);return function(r){let o=r.split(hO);return o.length===2&&j9(o[0])&&t(o[1])}}function B9(e,t){if(!(e&&t))return;let n=new Date(e).valueOf(),r=new Date(t).valueOf();if(!(n&&r))return;return n-r}function K9(e,t){if(!(e&&t))return;let[n,r]=e.split(hO),[o,s]=t.split(hO),i=gO(n,o);if(i===void 0)return;return i||_O(r,s)}var LKe=/\/|:/,MKe=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function NKe(e){return LKe.test(e)&&MKe.test(e)}var z9=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function UKe(e){return z9.lastIndex=0,z9.test(e)}var FKe=-2147483648,zKe=2147483647;function $Ke(e){return Number.isInteger(e)&&e<=zKe&&e>=FKe}function jKe(e){return Number.isInteger(e)}function $9(){return!0}var HKe=/[^\\]\\Z/;function BKe(e){if(HKe.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}});var Z9=k(function(V9){Object.defineProperty(V9,"__esModule",{value:!0});V9.formatLimitDefinition=void 0;var GKe=pO(),_o=Ce(),mi=_o.operators,tb={formatMaximum:{okStr:"<=",ok:mi.LTE,fail:mi.GT},formatMinimum:{okStr:">=",ok:mi.GTE,fail:mi.LT},formatExclusiveMaximum:{okStr:"<",ok:mi.LT,fail:mi.GTE},formatExclusiveMinimum:{okStr:">",ok:mi.GT,fail:mi.LTE}},WKe={message:({keyword:e,schemaCode:t})=>_o.str`should be ${tb[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>_o._`{comparison: ${tb[e].okStr}, limit: ${t}}`};V9.formatLimitDefinition={keyword:Object.keys(tb),type:"string",schemaType:"string",$data:!0,error:WKe,code(e){let{gen:t,data:n,schemaCode:r,keyword:o,it:s}=e,{opts:i,self:a}=s;if(!i.validateFormats)return;let c=new GKe.KeywordCxt(s,a.RULES.all.format.definition,"format");if(c.$data)l();else u();function l(){let f=t.scopeValue("formats",{ref:a.formats,code:i.code.formats}),m=t.const("fmt",_o._`${f}[${c.schemaCode}]`);e.fail$data((0,_o.or)(_o._`typeof ${m} != "object"`,_o._`${m} instanceof RegExp`,_o._`typeof ${m}.compare != "function"`,p(m)))}function u(){let f=c.schema,m=a.formats[f];if(!m||m===!0)return;if(typeof m!="object"||m instanceof RegExp||typeof m.compare!="function")throw Error(`"${o}": format "${f}" does not define "compare" function`);let h=t.scopeValue("formats",{key:f,ref:m,code:i.code.formats?_o._`${i.code.formats}${(0,_o.getProperty)(f)}`:void 0});e.fail$data(p(h))}function p(f){return _o._`${f}.compare(${n}, ${r}) ${tb[o].fail} 0`}},dependencies:["format"]};var qKe=(e)=>(e.addKeyword(V9.formatLimitDefinition),e);V9.default=qKe});var Q9=k(function(qf,X9){Object.defineProperty(qf,"__esModule",{value:!0});var cu=q9(),ZKe=Z9(),SO=Ce(),Y9=new SO.Name("fullFormats"),YKe=new SO.Name("fastFormats"),EO=(e,t={keywords:!0})=>{if(Array.isArray(t))return J9(e,t,cu.fullFormats,Y9),e;let[n,r]=t.mode==="fast"?[cu.fastFormats,YKe]:[cu.fullFormats,Y9],o=t.formats||cu.formatNames;if(J9(e,o,n,r),t.keywords)(0,ZKe.default)(e);return e};EO.get=(e,t="full")=>{let r=(t==="fast"?cu.fastFormats:cu.fullFormats)[e];if(!r)throw Error(`Unknown format "${e}"`);return r};function J9(e,t,n,r){var o,s;(o=(s=e.opts.code).formats)!==null&&o!==void 0||(s.formats=SO._`require("ajv-formats/dist/formats").${r}`);for(let i of t)e.addFormat(i,n[i])}X9.exports=qf=EO;Object.defineProperty(qf,"__esModule",{value:!0});qf.default=EO});import{execFile as f6e}from"child_process";import{randomUUID as SP}from"crypto";import{createReadStream as m6e,realpathSync as h6e}from"fs";import{mkdir as gP,readdir as g6e,readFile as ZJ,rm as _6e,writeFile as YJ}from"fs/promises";import{createRequire as y6e}from"module";import{homedir as _P,tmpdir as b6e}from"os";import{dirname as yP,isAbsolute as JJ,join as mn,relative as XJ,resolve as mm,sep as EP}from"path";import{createInterface as S6e}from"readline";import{fileURLToPath as E6e}from"url";import{setMaxListeners as O8}from"events";var P8=50;function ku(e=P8){let t=new AbortController;return O8(e,t.signal),t}var B6e=new FinalizationRegistry(({parentSignalRef:e,handler:t})=>{e.deref()?.removeEventListener("abort",t)});var K6e={"user-cancel":new DOMException("user-cancel","AbortError"),"remote-cancel":new DOMException("remote-cancel","AbortError"),shutdown:new DOMException("shutdown","AbortError"),interrupt:new DOMException("interrupt","AbortError"),background:new DOMException("background","AbortError"),"refusal-fallback-edit":new DOMException("refusal-fallback-edit","AbortError"),"recovery-timeout":new DOMException("recovery-timeout","AbortError")};var I8="server-fallback-tombstone";var G6e=new DOMException(I8,"AbortError");var D8="subagent-park",W6e=new DOMException(D8,"AbortError");import{realpathSync as WP}from"fs";import{homedir as L8}from"os";import{basename as J6e,dirname as NP,isAbsolute as X6e,relative as Q6e,resolve as ja,sep as Ho}from"path";import*as zb from"path";function ct(e){return process.platform==="darwin"?e.normalize("NFC"):e}function Bo(e){return/^[\\/]{2}/.test(e)||bm(e)}function UP(e){if(/^[\\/]{2}[?.][\\/](?!unc[\\/])/i.test(e))return null;return e.match(/^[\\/]{2}(?:[?.][\\/]unc[\\/])?([^\\/]+)/i)?.[1]?.replace(/[A-Z]/g,(t)=>t.toLowerCase())??null}function Cu(e){return/(^|[\\/])\.{1,2}([\\/]|$)/.test(e)}function Ha(e){return/^[\\/]{2}[?.][\\/]/.test(e)}function M8(e){return/^[\\/](GLOBAL\?\?|GLOBALROOT|DosDevices|Device)[\\/]/i.test(e)}function qP(e,t){if(!Bo(e))return!1;if(Ha(e)||bm(e))return!0;if(Cu(e))return!0;let n=UP(e);return n===null||n!==UP(t)}function FP(e){if(process.platform==="win32"||!e.startsWith("/"))return null;let t=[];for(let n of e.split("/")){if(n===""||n===".")continue;if(n===".."){t.pop();continue}if(t.push(n),t.length===2&&zP(t[0])==="net")return zP(n)}return null}function zP(e){return e.replace(/[A-Z]/g,(t)=>t.toLowerCase())}function VP(e,t){if(!Ba(e))return!1;let n=FP(e);return n===null||n!==FP(t)}function Ba(e){if(process.platform==="win32")return!1;return _s(e)}function _s(e){return $b(e)!==null}function $b(e){if(!e.startsWith("/"))return null;let t=[];for(let n of e.split("/")){if(n===""||n===".")continue;if(n===".."){t.pop();continue}if(t.push(n),t.length===2&&t[0].toLowerCase()==="net")return"/"+t.join("/")}return null}function ZP(e){return _s(e)||/^\/Network\//i.test(e)}function jb(e){return Hb(e)||_s(e)||Ha(e)||bm(e)||M8(e)}function Ei(e){return/^[\\/]{2}wsl(\$|\.localhost)[\\/]/i.test(e)}function Hb(e){return Bo(e)&&!Ei(e)}function Bb(e){if(e.startsWith("\\\\?\\UNC\\"))return"\\\\"+e.slice(8);if(e.startsWith("\\\\?\\")&&e.length>=7&&e[5]===":")return e.slice(4);return e}function YP(e){if(/^\\\\\?\\volume\{/i.test(e))return $P(e);if(bm(e))return!0;let t=Bb(e);if(t!==e&&$P(t))return!0;return Bo(t)&&!Ei(t)}function $P(e){return Cu(e)||e.includes("/")}function Kb(e){try{return Bb(WP.native(e))}catch{return null}}var N8=new Set(["EPERM","EBUSY","EACCES"]),U8=4,F8=50,jP;function gm(e){for(let t=0;;t++)try{return Bb(WP.native(e))}catch(n){let r=n!=null&&typeof n==="object"&&"code"in n&&typeof n.code==="string"?n.code:void 0;if(r===void 0||!N8.has(r)||t>=U8-1)return null;jP??=new Int32Array(new SharedArrayBuffer(4)),Atomics.wait(jP,0,0,F8)}}function ym(e,t){let n=ja(t).toLowerCase(),r=NP(ja(e)).toLowerCase();if(r===n||HP(r,n)||BP(r,n,"lexical"))return!0;let o=gm(t)?.toLowerCase();if(o==null)return!1;let s=gm(NP(ja(e)))?.toLowerCase();if(s==null)return!0;return s===o||HP(s,o)||BP(s,o,"canonical")}var z8=new Set(["node_modules",".venv","venv","env",".env","virtualenv",".tox",".nox",".direnv","__pypackages__"]);function HP(e,t){if(!e.startsWith(_m(t)+Ho))return!1;return e.split(Ho).some((n)=>z8.has(n))}function _m(e){return e.endsWith(Ho)?e.slice(0,-1):e}var Ub;function BP(e,t,n){let r=L8(),o=(process.env.LOCALAPPDATA??"").trim();if(n==="lexical")return Fb(KP(r,o,(c)=>ja(c).toLowerCase()),e,t);let s=r+"\x00"+o;if(Ub?.key===s)return Fb(Ub.aliasDirs,e,t);let i=!0,a=KP(r,o,(c)=>{if(!$8(c))return ja(c).toLowerCase();let l=gm(c)?.toLowerCase();if(l==null)return i=!1,ja(c).toLowerCase();return l});if(i)Ub={key:s,aliasDirs:a};return Fb(a,e,t)}function KP(e,t,n){let r=[];if(e)r.push(_m(n(e))+Ho+["appdata","local","microsoft","windowsapps"].join(Ho));if(t){let o=_m(n(t))+Ho+["microsoft","windowsapps"].join(Ho);if(!r.includes(o))r.push(o)}return r}function $8(e){return process.platform==="win32"?/^[A-Za-z]:[\\/](?![\\/])/.test(e):e.startsWith("/")&&!Bo(e)}function Fb(e,t,n){let r=_m(n);for(let o of e){if(!(o===r||o.startsWith(r+Ho)))continue;if(t===o||t.startsWith(o+Ho))return!0}return!1}function bm(e){return GP.test(e)||e.includes("??")&&GP.test(j8(e))}var GP=/^[\\/]\?\?[\\/]/;function j8(e){return zb.win32?zb.win32.normalize(e):e}function Hr(e,t,n){return new Promise((r,o)=>{if(t?.aborted){if(n?.throwOnAbort||n?.abortError)o(n.abortError?.()??Error("aborted"));else r();return}let s=setTimeout((a,c,l)=>{a?.removeEventListener("abort",c),l()},e,t,i,r);function i(){if(clearTimeout(s),n?.throwOnAbort||n?.abortError)o(n.abortError?.()??Error("aborted"));else r()}if(t?.addEventListener("abort",i,{once:!0}),n?.unref)s.unref()})}function H8(e,t){e(Error(t))}function Er(e,t,n){let r,o=new Promise((s,i)=>{r=setTimeout(H8,t,i,n)});return Promise.race([e,o]).finally(()=>{if(r!==void 0)clearTimeout(r)})}import{spawn as TIe}from"child_process";import{existsSync as kIe}from"fs";import{createInterface as CIe}from"readline";import{StringDecoder as RIe}from"string_decoder";var Ka=["PreToolUse","PostToolUse","PostToolUseFailure","PostToolBatch","Notification","UserPromptSubmit","UserPromptExpansion","SessionStart","SessionEnd","Stop","StopFailure","SubagentStart","SubagentStop","PreCompact","PostCompact","PermissionRequest","PermissionDenied","Setup","TeammateIdle","TaskCreated","TaskCompleted","Elicitation","ElicitationResult","ConfigChange","WorktreeCreate","WorktreeRemove","InstructionsLoaded","CwdChanged","FileChanged","DirectoryAdded","MessageDisplay"],B8=["clear","resume","logout","prompt_input_exit","other"],K8="__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__";function Ru(e){return e.charAt(0).toUpperCase()+e.slice(1)}function JP(e,t,n=t+"s"){return e===1?t:n}function Ou(e,t){if(t<=0)return"";if(e.length<=t)return e;let n=e.slice(0,t),r=n.charCodeAt(t-1);return XP(r>=55296&&r<=56319?n.slice(0,-1):n)}function Gb(e,t){if(t<=0)return"";if(e.length<=t)return e;let n=e.slice(-t),r=n.charCodeAt(0);return XP(r>=56320&&r<=57343?n.slice(1):n)}function XP(e){if(typeof Buffer<"u")return Buffer.from(e,"utf16le").toString("utf16le");return G8(e)}function G8(e){let n=[];for(let r=0;r<e.length;r+=8192){let o=Math.min(r+8192,e.length),s=new Uint16Array(o-r);for(let i=r;i<o;i++)s[i-r]=e.charCodeAt(i);n.push(String.fromCharCode(...s))}return n.join("")}var W8=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/,q8=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,Sm=typeof String.prototype.isWellFormed==="function"?Function.prototype.call.bind(String.prototype.isWellFormed):void 0,o3e=typeof String.prototype.toWellFormed==="function"?Function.prototype.call.bind(String.prototype.toWellFormed):void 0;function Em(e){if(Sm)return Sm(e);return!W8.test(e)}function Wb(e){if(Sm&&Sm(e))return e;return e.replace(q8,"")}function qb(e,t){let n=e.indexOf(t);return n===-1?e:e.slice(0,n)}var V8=/^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/,Z8=/<command-name>(.*?)<\/command-name>/;function Pu(e,t){if(e.type!=="user")return;if(e.isMeta===!0||e.isCompactSummary===!0)return;let n=e.message;if(!n)return;let r=n.content,o=[];if(typeof r==="string")o.push(r);else if(Array.isArray(r))for(let s of r){if(!s||typeof s!=="object")continue;if(s.type==="tool_result")return;if(s.type==="text"&&typeof s.text==="string")o.push(s.text)}for(let s of o){let i=s.replaceAll(`
`," ").trim();if(!i)continue;let a=Z8.exec(i);if(a){if(!t.commandFallback)t.commandFallback=a[1];continue}let c=/<bash-input>([\s\S]*?)<\/bash-input>/.exec(i);if(c)return`! ${c[1].trim()}`;if(V8.test(i))continue;if(i.length>200)i=Ou(i,200).trim()+"…";return i}return}var Y8={customTitle:"customTitle",aiTitle:"aiTitle",lastPrompt:"lastPrompt",summary:"summaryHint",gitBranch:"gitBranch"};function xm(e,t,n,r){let o=r?.mtime??e?.mtime??0,s=e!==void 0?{sessionId:e.sessionId,mtime:o,data:{...e.data}}:{sessionId:t.sessionId,mtime:o,data:{}},i=s.data;for(let a of n){let c=X8(a.timestamp);if(i.isSidechain===void 0)i.isSidechain=a.isSidechain===!0;if(i.createdAt===void 0&&c!==void 0)i.createdAt=c;if(i.cwd===void 0){let l=a.cwd;if(typeof l==="string"&&l)i.cwd=l}Q8(i,a);for(let[l,u]of Object.entries(Y8)){let p=a[l];if(typeof p==="string")i[u]=p}if(a.type==="tag"){let l=a.tag;if(typeof l==="string"&&l)i.tag=l;else delete i.tag}if(a.type==="relocated"){let l=a.relocatedCwd;if(typeof l==="string"&&l)i.cwd=l}}return s}function QP(e,t){let n=e.data;if(n.isSidechain===!0)return null;let r=ys(n.firstPromptLocked===!0?n.firstPrompt:n.commandFallback)||void 0,o=ys(n.customTitle)||ys(n.aiTitle)||void 0,s=o||ys(n.lastPrompt)||ys(n.summaryHint)||r;if(!s)return null;return{sessionId:e.sessionId,summary:s,lastModified:e.mtime,fileSize:void 0,customTitle:o,firstPrompt:r,gitBranch:ys(n.gitBranch)||void 0,cwd:ys(n.cwd)||t||void 0,tag:ys(n.tag)||void 0,createdAt:J8(n.createdAt)}}function ys(e){return typeof e==="string"?e:void 0}function J8(e){return typeof e==="number"?e:void 0}function X8(e){if(typeof e!=="string")return;let t=Date.parse(e);return Number.isNaN(t)?void 0:t}function Q8(e,t){if(e.firstPromptLocked)return;let n={commandFallback:e.commandFallback??""},r=Pu(t,n);if(n.commandFallback&&!e.commandFallback)e.commandFallback=n.commandFallback;if(r!==void 0)e.firstPrompt=r,e.firstPromptLocked=!0}class Vb{store=new Map;mtimes=new Map;summaries=new Map;lastMtime=0;keyToString(e){let t=[e.projectKey,e.sessionId];if(e.subpath)t.push(e.subpath);return t.join("/")}async append(e,t){let n=this.keyToString(e),r=this.store.get(n)??[];r.push(...t),this.store.set(n,r);let o=Math.max(Date.now(),this.lastMtime+1);if(this.lastMtime=o,this.mtimes.set(n,o),e.subpath===void 0){let s=`${e.projectKey}/${e.sessionId}`,i=xm(this.summaries.get(s),e,t,{mtime:o});this.summaries.set(s,i)}}async load(e){let t=this.keyToString(e);return this.store.get(t)??null}async listSessions(e){let t=[],n=e+"/";for(let[r]of this.store)if(r.startsWith(n)){let o=r.slice(n.length);if(!o.includes("/"))t.push({sessionId:o,mtime:this.mtimes.get(r)??0})}return t}async listSessionSummaries(e){let t=[],n=e+"/";for(let[r,o]of this.summaries)if(r.startsWith(n))t.push(o);return t}async delete(e){let t=this.keyToString(e);if(this.store.delete(t),this.mtimes.delete(t),e.subpath===void 0){this.summaries.delete(`${e.projectKey}/${e.sessionId}`);let n=`${e.projectKey}/${e.sessionId}/`;for(let r of this.store.keys())if(r.startsWith(n))this.store.delete(r),this.mtimes.delete(r)}}async listSubkeys(e){let t=`${e.projectKey}/${e.sessionId}/`,n=[];for(let r of this.store.keys())if(r.startsWith(t))n.push(r.slice(t.length));return n}getEntries(e){return this.store.get(this.keyToString(e))??[]}get size(){let e=0;for(let t of this.store.keys()){let n=t.indexOf("/");if(n!==-1&&!t.slice(n+1).includes("/"))e++}return e}clear(){this.store.clear(),this.mtimes.clear(),this.summaries.clear()}}function Ko(e){return!Array.isArray?aI(e)==="[object Array]":Array.isArray(e)}var eX=1/0;function tX(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-eX?"-0":t}function nX(e){return e==null?"":tX(e)}function Eo(e){return typeof e==="string"}function sI(e){return typeof e==="number"}function rX(e){return e===!0||e===!1||oX(e)&&aI(e)=="[object Boolean]"}function iI(e){return typeof e==="object"}function oX(e){return iI(e)&&e!==null}function rr(e){return e!==void 0&&e!==null}function Zb(e){return!e.trim().length}function aI(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var sX="Incorrect 'index' type",iX=(e)=>`Invalid value for key ${e}`,aX=(e)=>`Pattern length exceeds max of ${e}.`,cX=(e)=>`Missing ${e} property in key`,lX=(e)=>`Property 'weight' in key '${e}' must be a positive integer`,eI=Object.prototype.hasOwnProperty;class cI{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach((n)=>{let r=lI(n);this._keys.push(r),this._keyMap[r.id]=r,t+=r.weight}),this._keys.forEach((n)=>{n.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function lI(e){let t=null,n=null,r=null,o=1,s=null;if(Eo(e)||Ko(e))r=e,t=tI(e),n=Yb(e);else{if(!eI.call(e,"name"))throw Error(cX("name"));let i=e.name;if(r=i,eI.call(e,"weight")){if(o=e.weight,o<=0)throw Error(lX(i))}t=tI(i),n=Yb(i),s=e.getFn}return{path:t,id:n,weight:o,src:r,getFn:s}}function tI(e){return Ko(e)?e:e.split(".")}function Yb(e){return Ko(e)?e.join("."):e}function uX(e,t){let n=[],r=!1,o=(s,i,a)=>{if(!rr(s))return;if(!i[a])n.push(s);else{let c=i[a],l=s[c];if(!rr(l))return;if(a===i.length-1&&(Eo(l)||sI(l)||rX(l)))n.push(nX(l));else if(Ko(l)){r=!0;for(let u=0,p=l.length;u<p;u+=1)o(l[u],i,a+1)}else if(i.length)o(l,i,a+1)}};return o(e,Eo(t)?t.split("."):t,0),r?n:n[0]}var dX={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},pX={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},fX={location:0,threshold:0.6,distance:100},mX={useExtendedSearch:!1,getFn:uX,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},ye={...pX,...dX,...fX,...mX},hX=/[^ ]+/g;function gX(e=1,t=3){let n=new Map,r=Math.pow(10,t);return{get(o){let s=o.match(hX).length;if(n.has(s))return n.get(s);let i=1/Math.pow(s,0.5*e),a=parseFloat(Math.round(i*r)/r);return n.set(s,a),a},clear(){n.clear()}}}class Am{constructor({getFn:e=ye.getFn,fieldNormWeight:t=ye.fieldNormWeight}={}){this.norm=gX(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((t,n)=>{this._keysMap[t.id]=n})}create(){if(this.isCreated||!this.docs.length)return;if(this.isCreated=!0,Eo(this.docs[0]))this.docs.forEach((e,t)=>{this._addString(e,t)});else this.docs.forEach((e,t)=>{this._addObject(e,t)});this.norm.clear()}add(e){let t=this.size();if(Eo(e))this._addString(e,t);else this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,n=this.size();t<n;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!rr(e)||Zb(e))return;let n={v:e,i:t,n:this.norm.get(e)};this.records.push(n)}_addObject(e,t){let n={i:t,$:{}};this.keys.forEach((r,o)=>{let s=r.getFn?r.getFn(e):this.getFn(e,r.path);if(!rr(s))return;if(Ko(s)){let i=[],a=[{nestedArrIndex:-1,value:s}];while(a.length){let{nestedArrIndex:c,value:l}=a.pop();if(!rr(l))continue;if(Eo(l)&&!Zb(l)){let u={v:l,i:c,n:this.norm.get(l)};i.push(u)}else if(Ko(l))l.forEach((u,p)=>{a.push({nestedArrIndex:p,value:u})})}n.$[o]=i}else if(Eo(s)&&!Zb(s)){let i={v:s,n:this.norm.get(s)};n.$[o]=i}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function uI(e,t,{getFn:n=ye.getFn,fieldNormWeight:r=ye.fieldNormWeight}={}){let o=new Am({getFn:n,fieldNormWeight:r});return o.setKeys(e.map(lI)),o.setSources(t),o.create(),o}function _X(e,{getFn:t=ye.getFn,fieldNormWeight:n=ye.fieldNormWeight}={}){let{keys:r,records:o}=e,s=new Am({getFn:t,fieldNormWeight:n});return s.setKeys(r),s.setIndexRecords(o),s}function vm(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:o=ye.distance,ignoreLocation:s=ye.ignoreLocation}={}){let i=t/e.length;if(s)return i;let a=Math.abs(r-n);if(!o)return a?1:i;return i+a/o}function yX(e=[],t=ye.minMatchCharLength){let n=[],r=-1,o=-1,s=0;for(let i=e.length;s<i;s+=1){let a=e[s];if(a&&r===-1)r=s;else if(!a&&r!==-1){if(o=s-1,o-r+1>=t)n.push([r,o]);r=-1}}if(e[s-1]&&s-r>=t)n.push([r,s-1]);return n}var xi=32;function bX(e,t,n,{location:r=ye.location,distance:o=ye.distance,threshold:s=ye.threshold,findAllMatches:i=ye.findAllMatches,minMatchCharLength:a=ye.minMatchCharLength,includeMatches:c=ye.includeMatches,ignoreLocation:l=ye.ignoreLocation}={}){if(t.length>xi)throw Error(aX(xi));let u=t.length,p=e.length,f=Math.max(0,Math.min(r,p)),m=s,h=f,_=a>1||c,y=_?Array(p):[],S;while((S=e.indexOf(t,h))>-1){let M=vm(t,{currentLocation:S,expectedLocation:f,distance:o,ignoreLocation:l});if(m=Math.min(M,m),h=S+u,_){let F=0;while(F<u)y[S+F]=1,F+=1}}h=-1;let b=[],x=1,v=u+p,T=1<<u-1;for(let M=0;M<u;M+=1){let F=0,W=v;while(F<W){if(vm(t,{errors:M,currentLocation:f+W,expectedLocation:f,distance:o,ignoreLocation:l})<=m)F=W;else v=W;W=Math.floor((v-F)/2+F)}v=W;let ce=Math.max(1,f-W+1),ne=i?p:Math.min(f+W,p)+u,se=Array(ne+2);se[ne+1]=(1<<M)-1;for(let Te=ne;Te>=ce;Te-=1){let St=Te-1,Y=n[e.charAt(St)];if(_)y[St]=+!!Y;if(se[Te]=(se[Te+1]<<1|1)&Y,M)se[Te]|=(b[Te+1]|b[Te])<<1|1|b[Te+1];if(se[Te]&T){if(x=vm(t,{errors:M,currentLocation:St,expectedLocation:f,distance:o,ignoreLocation:l}),x<=m){if(m=x,h=St,h<=f)break;ce=Math.max(1,2*f-h)}}}if(vm(t,{errors:M+1,currentLocation:f,expectedLocation:f,distance:o,ignoreLocation:l})>m)break;b=se}let U={isMatch:h>=0,score:Math.max(0.001,x)};if(_){let M=yX(y,a);if(!M.length)U.isMatch=!1;else if(c)U.indices=M}return U}function SX(e){let t={};for(let n=0,r=e.length;n<r;n+=1){let o=e.charAt(n);t[o]=(t[o]||0)|1<<r-n-1}return t}class nS{constructor(e,{location:t=ye.location,threshold:n=ye.threshold,distance:r=ye.distance,includeMatches:o=ye.includeMatches,findAllMatches:s=ye.findAllMatches,minMatchCharLength:i=ye.minMatchCharLength,isCaseSensitive:a=ye.isCaseSensitive,ignoreLocation:c=ye.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:o,findAllMatches:s,minMatchCharLength:i,isCaseSensitive:a,ignoreLocation:c},this.pattern=a?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;let l=(p,f)=>{this.chunks.push({pattern:p,alphabet:SX(p),startIndex:f})},u=this.pattern.length;if(u>xi){let p=0,f=u%xi,m=u-f;while(p<m)l(this.pattern.substr(p,xi),p),p+=xi;if(f){let h=u-xi;l(this.pattern.substr(h),h)}}else l(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,includeMatches:n}=this.options;if(!t)e=e.toLowerCase();if(this.pattern===e){let m={isMatch:!0,score:0};if(n)m.indices=[[0,e.length-1]];return m}let{location:r,distance:o,threshold:s,findAllMatches:i,minMatchCharLength:a,ignoreLocation:c}=this.options,l=[],u=0,p=!1;this.chunks.forEach(({pattern:m,alphabet:h,startIndex:_})=>{let{isMatch:y,score:S,indices:b}=bX(e,m,h,{location:r+_,distance:o,threshold:s,findAllMatches:i,minMatchCharLength:a,includeMatches:n,ignoreLocation:c});if(y)p=!0;if(u+=S,y&&b)l=[...l,...b]});let f={isMatch:p,score:p?u/this.chunks.length:1};if(p&&n)f.indices=l;return f}}class Go{constructor(e){this.pattern=e}static isMultiMatch(e){return nI(e,this.multiRegex)}static isSingleMatch(e){return nI(e,this.singleRegex)}search(){}}function nI(e,t){let n=e.match(t);return n?n[1]:null}class dI extends Go{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){let t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}class pI extends Go{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){let n=e.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class fI extends Go{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){let t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}class mI extends Go{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){let t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class hI extends Go{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){let t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class gI extends Go{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){let t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class rS extends Go{constructor(e,{location:t=ye.location,threshold:n=ye.threshold,distance:r=ye.distance,includeMatches:o=ye.includeMatches,findAllMatches:s=ye.findAllMatches,minMatchCharLength:i=ye.minMatchCharLength,isCaseSensitive:a=ye.isCaseSensitive,ignoreLocation:c=ye.ignoreLocation}={}){super(e);this._bitapSearch=new nS(e,{location:t,threshold:n,distance:r,includeMatches:o,findAllMatches:s,minMatchCharLength:i,isCaseSensitive:a,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class oS extends Go{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t=0,n,r=[],o=this.pattern.length;while((n=e.indexOf(this.pattern,t))>-1)t=n+o,r.push([n,t-1]);let s=!!r.length;return{isMatch:s,score:s?0:1,indices:r}}}var Jb=[dI,oS,fI,mI,gI,hI,pI,rS],rI=Jb.length,EX=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,xX="|";function vX(e,t={}){return e.split(xX).map((n)=>{let r=n.trim().split(EX).filter((s)=>s&&!!s.trim()),o=[];for(let s=0,i=r.length;s<i;s+=1){let a=r[s],c=!1,l=-1;while(!c&&++l<rI){let u=Jb[l],p=u.isMultiMatch(a);if(p)o.push(new u(p,t)),c=!0}if(c)continue;l=-1;while(++l<rI){let u=Jb[l],p=u.isSingleMatch(a);if(p){o.push(new u(p,t));break}}}return o})}var wX=new Set([rS.type,oS.type]);class _I{constructor(e,{isCaseSensitive:t=ye.isCaseSensitive,includeMatches:n=ye.includeMatches,minMatchCharLength:r=ye.minMatchCharLength,ignoreLocation:o=ye.ignoreLocation,findAllMatches:s=ye.findAllMatches,location:i=ye.location,threshold:a=ye.threshold,distance:c=ye.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:n,minMatchCharLength:r,findAllMatches:s,ignoreLocation:o,location:i,threshold:a,distance:c},this.pattern=t?e:e.toLowerCase(),this.query=vX(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:n,isCaseSensitive:r}=this.options;e=r?e:e.toLowerCase();let o=0,s=[],i=0;for(let a=0,c=t.length;a<c;a+=1){let l=t[a];s.length=0,o=0;for(let u=0,p=l.length;u<p;u+=1){let f=l[u],{isMatch:m,indices:h,score:_}=f.search(e);if(m){if(o+=1,i+=_,n){let y=f.constructor.type;if(wX.has(y))s=[...s,...h];else s.push(h)}}else{i=0,o=0,s.length=0;break}}if(o){let u={isMatch:!0,score:i/o};if(n)u.indices=s;return u}}return{isMatch:!1,score:1}}}var Xb=[];function AX(...e){Xb.push(...e)}function Qb(e,t){for(let n=0,r=Xb.length;n<r;n+=1){let o=Xb[n];if(o.condition(e,t))return new o(e,t)}return new nS(e,t)}var wm={AND:"$and",OR:"$or"},eS={PATH:"$path",PATTERN:"$val"},tS=(e)=>!!(e[wm.AND]||e[wm.OR]),TX=(e)=>!!e[eS.PATH],kX=(e)=>!Ko(e)&&iI(e)&&!tS(e),oI=(e)=>({[wm.AND]:Object.keys(e).map((t)=>({[t]:e[t]}))});function yI(e,t,{auto:n=!0}={}){let r=(o)=>{let s=Object.keys(o),i=TX(o);if(!i&&s.length>1&&!tS(o))return r(oI(o));if(kX(o)){let c=i?o[eS.PATH]:s[0],l=i?o[eS.PATTERN]:o[c];if(!Eo(l))throw Error(iX(c));let u={keyId:Yb(c),pattern:l};if(n)u.searcher=Qb(l,t);return u}let a={children:[],operator:s[0]};return s.forEach((c)=>{let l=o[c];if(Ko(l))l.forEach((u)=>{a.children.push(r(u))})}),a};if(!tS(e))e=oI(e);return r(e)}function CX(e,{ignoreFieldNorm:t=ye.ignoreFieldNorm}){e.forEach((n)=>{let r=1;n.matches.forEach(({key:o,norm:s,score:i})=>{let a=o?o.weight:null;r*=Math.pow(i===0&&a?Number.EPSILON:i,(a||1)*(t?1:s))}),n.score=r})}function RX(e,t){let n=e.matches;if(t.matches=[],!rr(n))return;n.forEach((r)=>{if(!rr(r.indices)||!r.indices.length)return;let{indices:o,value:s}=r,i={indices:o,value:s};if(r.key)i.key=r.key.src;if(r.idx>-1)i.refIndex=r.idx;t.matches.push(i)})}function OX(e,t){t.score=e.score}function PX(e,t,{includeMatches:n=ye.includeMatches,includeScore:r=ye.includeScore}={}){let o=[];if(n)o.push(RX);if(r)o.push(OX);return e.map((s)=>{let{idx:i}=s,a={item:t[i],refIndex:i};if(o.length)o.forEach((c)=>{c(s,a)});return a})}class bs{constructor(e,t={},n){this.options={...ye,...t},this.options.useExtendedSearch,this._keyStore=new cI(this.options.keys),this.setCollection(e,n)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof Am))throw Error(sX);this._myIndex=t||uI(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){if(!rr(e))return;this._docs.push(e),this._myIndex.add(e)}remove(e=()=>!1){let t=[];for(let n=0,r=this._docs.length;n<r;n+=1){let o=this._docs[n];if(e(o,n))this.removeAt(n),n-=1,r-=1,t.push(o)}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){let{includeMatches:n,includeScore:r,shouldSort:o,sortFn:s,ignoreFieldNorm:i}=this.options,a=Eo(e)?Eo(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);if(CX(a,{ignoreFieldNorm:i}),o)a.sort(s);if(sI(t)&&t>-1)a=a.slice(0,t);return PX(a,this._docs,{includeMatches:n,includeScore:r})}_searchStringList(e){let t=Qb(e,this.options),{records:n}=this._myIndex,r=[];return n.forEach(({v:o,i:s,n:i})=>{if(!rr(o))return;let{isMatch:a,score:c,indices:l}=t.searchIn(o);if(a)r.push({item:o,idx:s,matches:[{score:c,value:o,norm:i,indices:l}]})}),r}_searchLogical(e){let t=yI(e,this.options),n=(i,a,c)=>{if(!i.children){let{keyId:u,searcher:p}=i,f=this._findMatches({key:this._keyStore.get(u),value:this._myIndex.getValueForItemAtKeyId(a,u),searcher:p});if(f&&f.length)return[{idx:c,item:a,matches:f}];return[]}let l=[];for(let u=0,p=i.children.length;u<p;u+=1){let f=i.children[u],m=n(f,a,c);if(m.length)l.push(...m);else if(i.operator===wm.AND)return[]}return l},r=this._myIndex.records,o={},s=[];return r.forEach(({$:i,i:a})=>{if(rr(i)){let c=n(t,i,a);if(c.length){if(!o[a])o[a]={idx:a,item:i,matches:[]},s.push(o[a]);c.forEach(({matches:l})=>{o[a].matches.push(...l)})}}}),s}_searchObjectList(e){let t=Qb(e,this.options),{keys:n,records:r}=this._myIndex,o=[];return r.forEach(({$:s,i})=>{if(!rr(s))return;let a=[];if(n.forEach((c,l)=>{a.push(...this._findMatches({key:c,value:s[l],searcher:t}))}),a.length)o.push({idx:i,item:s,matches:a})}),o}_findMatches({key:e,value:t,searcher:n}){if(!rr(t))return[];let r=[];if(Ko(t))t.forEach(({v:o,i:s,n:i})=>{if(!rr(o))return;let{isMatch:a,score:c,indices:l}=n.searchIn(o);if(a)r.push({score:c,key:e,value:o,idx:s,norm:i,indices:l})});else{let{v:o,n:s}=t,{isMatch:i,score:a,indices:c}=n.searchIn(o);if(i)r.push({score:a,key:e,value:o,norm:s,indices:c})}return r}}bs.version="7.0.0";bs.createIndex=uI;bs.parseIndex=_X;bs.config=ye;bs.parseQuery=yI;AX(_I);var bI=/[:_-]/g;class sS{fuse;constructor(e){let t=e.map((n)=>{let{name:r,displayName:o}=n,s=r.split(bI).filter(Boolean),i=o!==r?o.split(bI).filter(Boolean):[];return{descriptionKey:(n.description??"").split(" ").map((a)=>a.toLowerCase().replace(/[^a-z0-9]/g,"")).filter(Boolean),partKey:s.length>1?s:void 0,displayPartKey:i.length>1?i:void 0,commandName:r,displayName:o,candidate:n,aliasKey:n.aliases}});this.fuse=new bs(t,{includeScore:!0,threshold:0.3,location:0,distance:100,keys:[{name:"commandName",weight:3},{name:"displayName",weight:2},{name:"partKey",weight:2},{name:"aliasKey",weight:2},{name:"displayPartKey",weight:1},{name:"descriptionKey",weight:0.5}]})}search(e,t){let{getScoreBoost:n,filter:r}=t??{},o=e.trim().toLowerCase(),s=this.fuse.search(o);if(r)s=s.filter((c)=>r(c.item.candidate));return s.map((c)=>{let l=c.item.commandName.toLowerCase(),u=c.item.displayName.toLowerCase(),p=c.item.aliasKey?.map((m)=>m.toLowerCase())??[],f=n?n(c.item.candidate):0;return{r:c,name:l,display:u,aliases:p,boost:f}}).sort((c,l)=>{let u=c.name,p=l.name,f=c.aliases,m=l.aliases,h=u===o||c.display===o,_=p===o||l.display===o;if(h&&!_)return-1;if(_&&!h)return 1;let y=f.some((ne)=>ne===o),S=m.some((ne)=>ne===o);if(y&&!S)return-1;if(S&&!y)return 1;let b=(ne,se)=>Math.min(ne.startsWith(o)?ne.length:1/0,se.startsWith(o)?se.length:1/0),x=b(u,c.display),v=b(p,l.display),T=x<1/0,U=v<1/0;if(T&&!U)return-1;if(U&&!T)return 1;if(T&&U&&x!==v)return x-v;let M=f.find((ne)=>ne.startsWith(o)),F=m.find((ne)=>ne.startsWith(o));if(M&&!F)return-1;if(F&&!M)return 1;if(M&&F&&M.length!==F.length)return M.length-F.length;let W=Math.floor((c.r.score??0)*10),ce=Math.floor((l.r.score??0)*10);if(W!==ce)return W-ce;return l.boost-c.boost}).map((c)=>c.r.item.candidate)}}function iS(){if(typeof setImmediate==="function")return new Promise((e)=>setImmediate(e));if(typeof MessageChannel==="function")return new Promise((e)=>{let t=new MessageChannel;t.port1.onmessage=()=>{t.port1.close(),e()},t.port2.postMessage(null)});return Hr(0)}var SI=16,wI=8,IX=6,DX=4,AI=8,LX=3,MX=1,NX=100,EI=64,xI=4;class aS{paths=[];lowerPaths=[];charBits=new Int32Array(0);pathLens=new Uint16Array(0);topLevelCache=null;matchPositions=new Int32Array(EI);readyCount=0;buildGen=0;loadFromFileList(e){let t=new Set,n=[];for(let r of e)if(r.length>0&&!t.has(r))t.add(r),n.push(r);this.buildIndex(n)}loadFromFileListAsync(e){let t=()=>{},n=new Promise((o)=>{t=o}),r=this.buildAsync(e,t);return{queryable:n,done:r}}async buildAsync(e,t){let n=++this.buildGen,r=new Set,o=[],s=performance.now();for(let a=0;a<e.length;a++){let c=e[a];if(c.length>0&&!r.has(c))r.add(c),o.push(c);if((a&255)===255&&performance.now()-s>xI){if(await iS(),this.buildGen!==n)return t(),!1;s=performance.now()}}this.resetArrays(o),s=performance.now();let i=!0;for(let a=0;a<o.length;a++)if(this.indexPath(a),(a&255)===255&&performance.now()-s>xI){if(this.readyCount=a+1,i)t(),i=!1;if(await iS(),this.buildGen!==n)return!1;s=performance.now()}return this.readyCount=o.length,t(),!0}buildIndex(e){this.buildGen++,this.resetArrays(e);for(let t=0;t<e.length;t++)this.indexPath(t);this.readyCount=e.length}resetArrays(e){let t=e.length;this.paths=e,this.lowerPaths=Array(t),this.charBits=new Int32Array(t),this.pathLens=new Uint16Array(t),this.readyCount=0,this.topLevelCache=jX(e,NX)}indexPath(e){let t=this.paths[e].toLowerCase();this.lowerPaths[e]=t;let n=t.length;this.pathLens[e]=n;let r=0;for(let o=0;o<n;o++){let s=t.charCodeAt(o);if(s>=97&&s<=122)r|=1<<s-97}this.charBits[e]=r}search(e,t){if(t<=0)return[];if(e.length===0){if(this.topLevelCache)return this.topLevelCache.slice(0,t).map(({path:x,score:v})=>({path:x,score:v,positions:[]}));return[]}let n=e!==e.toLowerCase(),r=n?e:e.toLowerCase(),o=Math.min(r.length,EI),s=Array(o),i=0;for(let x=0;x<o;x++){let v=r.charAt(x);s[x]=v;let T=v.charCodeAt(0);if(T>=97&&T<=122)i|=1<<T-97}let a=o*(SI+wI)+AI+32,c=[],l=-1/0,{paths:u,lowerPaths:p,charBits:f,pathLens:m,readyCount:h}=this,_=this.matchPositions;e:for(let x=0;x<h;x++){if((f[x]&i)!==i)continue;let v=n?u[x]:p[x],T=v.indexOf(s[0]);if(T===-1)continue;_[0]=T;let U=0,M=0,F=T;for(let se=1;se<o;se++){if(T=v.indexOf(s[se],F+1),T===-1)continue e;_[se]=T;let Se=T-F-1;if(Se===0)M+=DX;else U+=LX+Se*MX;F=T}if(c.length===t&&a+M-U<=l)continue;let W=u[x],ce=m[x],ne=o*SI+M-U;ne+=vI(W,_[0],!0);for(let se=1;se<o;se++)ne+=vI(W,_[se],!1);if(ne+=Math.max(0,32-(ce>>2)),c.length<t){if(c.push({pathIndex:x,fuzzScore:ne}),c.length===t)c.sort((se,Se)=>se.fuzzScore-Se.fuzzScore),l=c[0].fuzzScore}else if(ne>l){let se=0,Se=c.length;while(se<Se){let Te=se+Se>>1;if(c[Te].fuzzScore<ne)se=Te+1;else Se=Te}c.splice(se,0,{pathIndex:x,fuzzScore:ne}),c.shift(),l=c[0].fuzzScore}}c.sort((x,v)=>v.fuzzScore-x.fuzzScore);let y=c.length,S=Math.max(y,1),b=Array(y);for(let x=0;x<y;x++){let v=c[x].pathIndex,T=u[v],U=p[v],M=n?T:U,F=Array(o),W=0;for(let se=0;se<o;se++){let Se=M.indexOf(s[se],W);F[se]=Se,W=Se+1}if(!n&&U.length!==T.length)$X(T,F);let ce=x/S,ne=T.includes("test")?Math.min(ce*1.05,1):ce;b[x]={path:T,score:ne,positions:F}}return b}}function vI(e,t,n){if(t===0)return n?AI:0;let r=e.charCodeAt(t-1);if(UX(r))return wI;if(FX(r)&&zX(e.charCodeAt(t)))return IX;return 0}function UX(e){return e===47||e===92||e===45||e===95||e===46||e===32}function FX(e){return e>=97&&e<=122}function zX(e){return e>=65&&e<=90}function $X(e,t){let n=0,r=0,o=0;while(o<t.length&&n<e.length){let s=e.codePointAt(n),i=s>65535?2:1,a=String.fromCodePoint(s).toLowerCase().length;while(o<t.length&&t[o]<r+a)t[o]=n,o++;n+=i,r+=a}}function jX(e,t){let n=new Set;for(let o of e){let s=o.length;for(let a=0;a<o.length;a++){let c=o.charCodeAt(a);if(c===47||c===92){s=a;break}}let i=o.slice(0,s);if(i.length>0){if(n.add(i),n.size>=t)break}}let r=Array.from(n);return r.sort((o,s)=>{let i=o.length-s.length;if(i!==0)return i;return o<s?-1:o>s?1:0}),r.slice(0,t).map((o)=>({path:o,score:0,positions:[]}))}var TI=["You've hit your","You've reached your","You're out of usage credits","Your org is out of usage · add funds to continue","Your org is out of usage · contact your admin","Your seat type doesn't include usage credits","Your seat type doesn't include usage","Your usage allocation has been disabled by your admin","Your group's usage limit is set to $0","Fable 5 requires usage credits","You're out of extra usage","Your seat type doesn't include extra usage"],kI=["This service is disabled for your org"],CI=["You've used","You're close to"],RI=["You're now using usage credits","You're now using your usage allocation","Now using your usage allocation","Now using usage credits","You're now using extra usage","Now using extra usage"];class or extends Error{}function Ga(){return process.versions.bun!==void 0}Iu();var HX=typeof global=="object"&&global&&global.Object===Object&&global,km=HX;var BX=typeof self=="object"&&self&&self.Object===Object&&self,KX=km||BX||Function("return this")(),$t=KX;var GX=$t.Symbol,vn=GX;var DI=Object.prototype,WX=DI.hasOwnProperty,qX=DI.toString,Du=vn?vn.toStringTag:void 0;function VX(e){var t=WX.call(e,Du),n=e[Du];try{e[Du]=void 0;var r=!0}catch(s){}var o=qX.call(e);if(r)if(t)e[Du]=n;else delete e[Du];return o}var LI=VX;var ZX=Object.prototype,YX=ZX.toString;function JX(e){return YX.call(e)}var MI=JX;var XX="[object Null]",QX="[object Undefined]",NI=vn?vn.toStringTag:void 0;function e7(e){if(e==null)return e===void 0?QX:XX;return NI&&NI in Object(e)?LI(e):MI(e)}var sr=e7;function t7(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Kt=t7;var n7="[object AsyncFunction]",r7="[object Function]",o7="[object GeneratorFunction]",s7="[object Proxy]";function i7(e){if(!Kt(e))return!1;var t=sr(e);return t==r7||t==o7||t==n7||t==s7}var Wa=i7;var a7=$t["__core-js_shared__"],Cm=a7;var UI=function(){var e=/[^.]+$/.exec(Cm&&Cm.keys&&Cm.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function c7(e){return!!UI&&UI in e}var FI=c7;var l7=Function.prototype,u7=l7.toString;function d7(e){if(e!=null){try{return u7.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var Wo=d7;var p7=/[\\^$.*+?()[\]{}|]/g,f7=/^\[object .+?Constructor\]$/,m7=Function.prototype,h7=Object.prototype,g7=m7.toString,_7=h7.hasOwnProperty,y7=RegExp("^"+g7.call(_7).replace(p7,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function b7(e){if(!Kt(e)||FI(e))return!1;var t=Wa(e)?y7:f7;return t.test(Wo(e))}var zI=b7;function S7(e,t){return e==null?void 0:e[t]}var $I=S7;function E7(e,t){var n=$I(e,t);return zI(n)?n:void 0}var Dn=E7;var x7=Dn(Object,"create"),qo=x7;function v7(){this.__data__=qo?qo(null):{},this.size=0}var jI=v7;function w7(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var HI=w7;var A7="__lodash_hash_undefined__",T7=Object.prototype,k7=T7.hasOwnProperty;function C7(e){var t=this.__data__;if(qo){var n=t[e];return n===A7?void 0:n}return k7.call(t,e)?t[e]:void 0}var BI=C7;var R7=Object.prototype,O7=R7.hasOwnProperty;function P7(e){var t=this.__data__;return qo?t[e]!==void 0:O7.call(t,e)}var KI=P7;var I7="__lodash_hash_undefined__";function D7(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=qo&&t===void 0?I7:t,this}var GI=D7;function qa(e){var t=-1,n=e==null?0:e.length;this.clear();while(++t<n){var r=e[t];this.set(r[0],r[1])}}qa.prototype.clear=jI;qa.prototype.delete=HI;qa.prototype.get=BI;qa.prototype.has=KI;qa.prototype.set=GI;var uS=qa;function L7(){this.__data__=[],this.size=0}var WI=L7;function M7(e,t){return e===t||e!==e&&t!==t}var xo=M7;function N7(e,t){var n=e.length;while(n--)if(xo(e[n][0],t))return n;return-1}var Ss=N7;var U7=Array.prototype,F7=U7.splice;function z7(e){var t=this.__data__,n=Ss(t,e);if(n<0)return!1;var r=t.length-1;if(n==r)t.pop();else F7.call(t,n,1);return--this.size,!0}var qI=z7;function $7(e){var t=this.__data__,n=Ss(t,e);return n<0?void 0:t[n][1]}var VI=$7;function j7(e){return Ss(this.__data__,e)>-1}var ZI=j7;function H7(e,t){var n=this.__data__,r=Ss(n,e);if(r<0)++this.size,n.push([e,t]);else n[r][1]=t;return this}var YI=H7;function Va(e){var t=-1,n=e==null?0:e.length;this.clear();while(++t<n){var r=e[t];this.set(r[0],r[1])}}Va.prototype.clear=WI;Va.prototype.delete=qI;Va.prototype.get=VI;Va.prototype.has=ZI;Va.prototype.set=YI;var Es=Va;var B7=Dn($t,"Map"),xs=B7;function K7(){this.size=0,this.__data__={hash:new uS,map:new(xs||Es),string:new uS}}var JI=K7;function G7(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var XI=G7;function W7(e,t){var n=e.__data__;return XI(t)?n[typeof t=="string"?"string":"hash"]:n.map}var vs=W7;function q7(e){var t=vs(this,e).delete(e);return this.size-=t?1:0,t}var QI=q7;function V7(e){return vs(this,e).get(e)}var eD=V7;function Z7(e){return vs(this,e).has(e)}var tD=Z7;function Y7(e,t){var n=vs(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var nD=Y7;function Za(e){var t=-1,n=e==null?0:e.length;this.clear();while(++t<n){var r=e[t];this.set(r[0],r[1])}}Za.prototype.clear=JI;Za.prototype.delete=QI;Za.prototype.get=eD;Za.prototype.has=tD;Za.prototype.set=nD;var vi=Za;var J7="Expected a function";function dS(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw TypeError(J7);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],s=n.cache;if(s.has(o))return s.get(o);var i=e.apply(this,r);return n.cache=s.set(o,i)||s,i};return n.cache=new(dS.Cache||vi),n}dS.Cache=vi;var Ya=dS;import{homedir as pte}from"os";import{basename as B5e,dirname as K5e,join as fte,resolve as iL}from"path";var X7=/^[+-]?(\d+(\.\d*)?|\.\d+)[eE][+-]?\d+$/,Q7=/^[+-]?\d{1,3}([_,\u00A0\u202F ])\d{3}(?:\1\d{3})*$/,eQ=/[_,\u00A0\u202F ]/g;function tQ(e){if(e.length<=32){if(X7.test(e)){let t=Number(e);return Number.isInteger(t)?t:NaN}if(Q7.test(e))return parseInt(e.replace(eQ,""),10)}return}function pS(e){let t=String(e).trim();return tQ(t)??parseInt(t,10)}var rD=Object.freeze({status:"aborted"});function P(e,t,n){function r(a,c){var l;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(l=a._zod).traits??(l.traits=new Set),a._zod.traits.add(e),t(a,c);for(let u in i.prototype)if(!(u in a))Object.defineProperty(a,u,{value:i.prototype[u].bind(a)});a._zod.constr=i,a._zod.def=c}let o=n?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var c;let l=n?.Parent?new s:this;r(l,a),(c=l._zod).deferred??(c.deferred=[]);for(let u of l._zod.deferred)u();return l}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:(a)=>{if(n?.Parent&&a instanceof n.Parent)return!0;return a?._zod?.traits?.has(e)}}),Object.defineProperty(i,"name",{value:e}),i}var oD=Symbol("zod_brand");class ws extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}var Rm={};function Ln(e){if(e)Object.assign(Rm,e);return Rm}var ke={};Xt(ke,{BIGINT_FORMAT_RANGES:()=>iD,Class:()=>cD,NUMBER_FORMAT_RANGES:()=>SS,aborted:()=>Ai,allowsEval:()=>_S,assert:()=>iQ,assertEqual:()=>nQ,assertIs:()=>oQ,assertNever:()=>sQ,assertNotEqual:()=>rQ,assignProp:()=>gS,cached:()=>Nu,captureStackTrace:()=>Pm,cleanEnum:()=>bQ,cleanRegex:()=>Fu,clone:()=>Mn,createTransparentProxy:()=>pQ,defineLazy:()=>Ve,esc:()=>wi,escapeRegex:()=>As,extend:()=>hQ,finalizeIssue:()=>Br,floatSafeRemainder:()=>hS,getElementAtPath:()=>aQ,getEnumValues:()=>Mu,getLengthableOrigin:()=>zu,getParsedType:()=>dQ,getSizableOrigin:()=>aD,isObject:()=>Ja,isPlainObject:()=>Xa,issue:()=>ES,joinValues:()=>Om,jsonStringifyReplacer:()=>mS,merge:()=>gQ,normalizeParams:()=>ue,nullish:()=>Uu,numKeys:()=>uQ,omit:()=>mQ,optionalKeys:()=>bS,partial:()=>_Q,pick:()=>fQ,prefixIssues:()=>vo,primitiveTypes:()=>sD,promiseAllObject:()=>cQ,propertyKeyTypes:()=>yS,randomString:()=>lQ,required:()=>yQ,stringifyPrimitive:()=>Im,unwrapMessage:()=>Lu});function nQ(e){return e}function rQ(e){return e}function oQ(e){}function sQ(e){throw Error()}function iQ(e){}function Mu(e){let t=Object.values(e).filter((r)=>typeof r==="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function Om(e,t="|"){return e.map((n)=>Im(n)).join(t)}function mS(e,t){if(typeof t==="bigint")return t.toString();return t}function Nu(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw Error("cached value already set")}}}function Uu(e){return e===null||e===void 0}function Fu(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function hS(e,t){let n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return s%i/10**o}function Ve(e,t,n){Object.defineProperty(e,t,{get(){{let o=n();return e[t]=o,o}throw Error("cached value already set")},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function gS(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function aQ(e,t){if(!t)return e;return t.reduce((n,r)=>n?.[r],e)}function cQ(e){let t=Object.keys(e),n=t.map((r)=>e[r]);return Promise.all(n).then((r)=>{let o={};for(let s=0;s<t.length;s++)o[t[s]]=r[s];return o})}function lQ(e=10){let n="";for(let r=0;r<e;r++)n+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return n}function wi(e){return JSON.stringify(e)}var Pm=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Ja(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var _S=Nu(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Xa(e){if(Ja(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;if(Ja(n)===!1)return!1;if(Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)return!1;return!0}function uQ(e){let t=0;for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n))t++;return t}var dQ=(e)=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(e===null)return"null";if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return"promise";if(typeof Map<"u"&&e instanceof Map)return"map";if(typeof Set<"u"&&e instanceof Set)return"set";if(typeof Date<"u"&&e instanceof Date)return"date";if(typeof File<"u"&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},yS=new Set(["string","number","symbol"]),sD=new Set(["string","number","bigint","boolean","symbol","undefined"]);function As(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Mn(e,t,n){let r=new e._zod.constr(t??e._zod.def);if(!t||n?.parent)r._zod.parent=e;return r}function ue(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function pQ(e){let t;return new Proxy({},{get(n,r,o){return t??(t=e()),Reflect.get(t,r,o)},set(n,r,o,s){return t??(t=e()),Reflect.set(t,r,o,s)},has(n,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(n,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,o){return t??(t=e()),Reflect.defineProperty(t,r,o)}})}function Im(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function bS(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var SS={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},iD={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function fQ(e,t){let n={},r=e._zod.def;for(let o in t){if(!(o in r.shape))throw Error(`Unrecognized key: "${o}"`);if(!t[o])continue;n[o]=r.shape[o]}return Mn(e,{...e._zod.def,shape:n,checks:[]})}function mQ(e,t){let n={...e._zod.def.shape},r=e._zod.def;for(let o in t){if(!(o in r.shape))throw Error(`Unrecognized key: "${o}"`);if(!t[o])continue;delete n[o]}return Mn(e,{...e._zod.def,shape:n,checks:[]})}function hQ(e,t){if(!Xa(t))throw Error("Invalid input to extend: expected a plain object");let n={...e._zod.def,get shape(){let r={...e._zod.def.shape,...t};return gS(this,"shape",r),r},checks:[]};return Mn(e,n)}function gQ(e,t){return Mn(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return gS(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})}function _Q(e,t,n){let r=t._zod.def.shape,o={...r};if(n)for(let s in n){if(!(s in r))throw Error(`Unrecognized key: "${s}"`);if(!n[s])continue;o[s]=e?new e({type:"optional",innerType:r[s]}):r[s]}else for(let s in r)o[s]=e?new e({type:"optional",innerType:r[s]}):r[s];return Mn(t,{...t._zod.def,shape:o,checks:[]})}function yQ(e,t,n){let r=t._zod.def.shape,o={...r};if(n)for(let s in n){if(!(s in o))throw Error(`Unrecognized key: "${s}"`);if(!n[s])continue;o[s]=new e({type:"nonoptional",innerType:r[s]})}else for(let s in r)o[s]=new e({type:"nonoptional",innerType:r[s]});return Mn(t,{...t._zod.def,shape:o,checks:[]})}function Ai(e,t=0){for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function vo(e,t){return t.map((n)=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Lu(e){return typeof e==="string"?e:e?.message}function Br(e,t,n){let r={...e,path:e.path??[]};if(!e.message){let o=Lu(e.inst?._zod.def?.error?.(e))??Lu(t?.error?.(e))??Lu(n.customError?.(e))??Lu(n.localeError?.(e))??"Invalid input";r.message=o}if(delete r.inst,delete r.continue,!t?.reportInput)delete r.input;return r}function aD(e){if(e instanceof Set)return"set";if(e instanceof Map)return"map";if(e instanceof File)return"file";return"unknown"}function zu(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function ES(...e){let[t,n,r]=e;if(typeof t==="string")return{message:t,code:"custom",input:n,inst:r};return{...t}}function bQ(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map((t)=>t[1])}class cD{constructor(...e){}}var lD=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,mS,2)},enumerable:!0})},Dm=P("$ZodError",lD),$u=P("$ZodError",lD,{Parent:Error});function Lm(e,t=(n)=>n.message){let n={},r=[];for(let o of e.issues)if(o.path.length>0)n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o));else r.push(t(o));return{formErrors:r,fieldErrors:n}}function Mm(e,t){let n=t||function(s){return s.message},r={_errors:[]},o=(s)=>{for(let i of s.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map((a)=>o({issues:a}));else if(i.code==="invalid_key")o({issues:i.issues});else if(i.code==="invalid_element")o({issues:i.issues});else if(i.path.length===0)r._errors.push(n(i));else{let a=r,c=0;while(c<i.path.length){let l=i.path[c];if(c!==i.path.length-1)a[l]=a[l]||{_errors:[]};else a[l]=a[l]||{_errors:[]},a[l]._errors.push(n(i));a=a[l],c++}}};return o(e),r}var xS=(e)=>(t,n,r,o)=>{let s=r?Object.assign(r,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new ws;if(i.issues.length){let a=new(o?.Err??e)(i.issues.map((c)=>Br(c,s,Ln())));throw Pm(a,o?.callee),a}return i.value},vS=xS($u),wS=(e)=>async(t,n,r,o)=>{let s=r?Object.assign(r,{async:!0}):{async:!0},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)i=await i;if(i.issues.length){let a=new(o?.Err??e)(i.issues.map((c)=>Br(c,s,Ln())));throw Pm(a,o?.callee),a}return i.value},AS=wS($u),TS=(e)=>(t,n,r)=>{let o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new ws;return s.issues.length?{success:!1,error:new(e??Dm)(s.issues.map((i)=>Br(i,o,Ln())))}:{success:!0,data:s.value}},Ti=TS($u),kS=(e)=>async(t,n,r)=>{let o=r?Object.assign(r,{async:!0}):{async:!0},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)s=await s;return s.issues.length?{success:!1,error:new e(s.issues.map((i)=>Br(i,o,Ln())))}:{success:!0,data:s.value}},ki=kS($u);var uD=/^[cC][^\s-]{8,}$/,dD=/^[0-9a-z]+$/,pD=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,fD=/^[0-9a-vA-V]{20}$/,mD=/^[A-Za-z0-9]{27}$/,hD=/^[a-zA-Z0-9_-]{21}$/,gD=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var _D=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,CS=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var yD=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function bD(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var SD=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ED=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,xD=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,vD=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,wD=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,RS=/^[A-Za-z0-9_-]*$/,AD=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;var TD=/^\+(?:[0-9]){6,14}[0-9]$/,kD="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",CD=new RegExp(`^${kD}$`);function RD(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function OD(e){return new RegExp(`^${RD(e)}$`)}function PD(e){let t=RD({precision:e.precision}),n=["Z"];if(e.local)n.push("");if(e.offset)n.push("([+-]\\d{2}:\\d{2})");let r=`${t}(?:${n.join("|")})`;return new RegExp(`^${kD}T(?:${r})$`)}var ID=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},DD=/^\d+n?$/,LD=/^\d+$/,MD=/^-?\d+(?:\.\d+)?/i,ND=/true|false/i,UD=/null/i;var FD=/undefined/i;var zD=/^[^A-Z]*$/,$D=/^[^a-z]*$/;var rn=P("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),jD={number:"number",bigint:"bigint",object:"date"},OS=P("$ZodCheckLessThan",(e,t)=>{rn.init(e,t);let n=jD[typeof t.value];e._zod.onattach.push((r)=>{let o=r._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<s)if(t.inclusive)o.maximum=t.value;else o.exclusiveMaximum=t.value}),e._zod.check=(r)=>{if(t.inclusive?r.value<=t.value:r.value<t.value)return;r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),PS=P("$ZodCheckGreaterThan",(e,t)=>{rn.init(e,t);let n=jD[typeof t.value];e._zod.onattach.push((r)=>{let o=r._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>s)if(t.inclusive)o.minimum=t.value;else o.exclusiveMinimum=t.value}),e._zod.check=(r)=>{if(t.inclusive?r.value>=t.value:r.value>t.value)return;r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),HD=P("$ZodCheckMultipleOf",(e,t)=>{rn.init(e,t),e._zod.onattach.push((n)=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=(n)=>{if(typeof n.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof n.value==="bigint"?n.value%t.value===BigInt(0):hS(n.value,t.value)===0)return;n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),BD=P("$ZodCheckNumberFormat",(e,t)=>{rn.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[o,s]=SS[t.format];e._zod.onattach.push((i)=>{let a=i._zod.bag;if(a.format=t.format,a.minimum=o,a.maximum=s,n)a.pattern=LD}),e._zod.check=(i)=>{let a=i.value;if(n){if(!Number.isInteger(a)){i.issues.push({expected:r,format:t.format,code:"invalid_type",input:a,inst:e});return}if(!Number.isSafeInteger(a)){if(a>0)i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort});else i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort});return}}if(a<o)i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort});if(a>s)i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inst:e})}});var KD=P("$ZodCheckMaxLength",(e,t)=>{rn.init(e,t),e._zod.when=(n)=>{let r=n.value;return!Uu(r)&&r.length!==void 0},e._zod.onattach.push((n)=>{let r=n._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<r)n._zod.bag.maximum=t.maximum}),e._zod.check=(n)=>{let r=n.value;if(r.length<=t.maximum)return;let s=zu(r);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),GD=P("$ZodCheckMinLength",(e,t)=>{rn.init(e,t),e._zod.when=(n)=>{let r=n.value;return!Uu(r)&&r.length!==void 0},e._zod.onattach.push((n)=>{let r=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>r)n._zod.bag.minimum=t.minimum}),e._zod.check=(n)=>{let r=n.value;if(r.length>=t.minimum)return;let s=zu(r);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),WD=P("$ZodCheckLengthEquals",(e,t)=>{rn.init(e,t),e._zod.when=(n)=>{let r=n.value;return!Uu(r)&&r.length!==void 0},e._zod.onattach.push((n)=>{let r=n._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=(n)=>{let r=n.value,o=r.length;if(o===t.length)return;let s=zu(r),i=o>t.length;n.issues.push({origin:s,...i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Hu=P("$ZodCheckStringFormat",(e,t)=>{var n,r;if(rn.init(e,t),e._zod.onattach.push((o)=>{let s=o._zod.bag;if(s.format=t.format,t.pattern)s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern)}),t.pattern)(n=e._zod).check??(n.check=(o)=>{if(t.pattern.lastIndex=0,t.pattern.test(o.value))return;o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(r=e._zod).check??(r.check=()=>{})}),qD=P("$ZodCheckRegex",(e,t)=>{Hu.init(e,t),e._zod.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),VD=P("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=zD),Hu.init(e,t)}),ZD=P("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=$D),Hu.init(e,t)}),YD=P("$ZodCheckIncludes",(e,t)=>{rn.init(e,t);let n=As(t.includes),r=new RegExp(typeof t.position==="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push((o)=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=(o)=>{if(o.value.includes(t.includes,t.position))return;o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),JD=P("$ZodCheckStartsWith",(e,t)=>{rn.init(e,t);let n=new RegExp(`^${As(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((r)=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=(r)=>{if(r.value.startsWith(t.prefix))return;r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),XD=P("$ZodCheckEndsWith",(e,t)=>{rn.init(e,t);let n=new RegExp(`.*${As(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((r)=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=(r)=>{if(r.value.endsWith(t.suffix))return;r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});var QD=P("$ZodCheckOverwrite",(e,t)=>{rn.init(e,t),e._zod.check=(n)=>{n.value=t.tx(n.value)}});class IS{constructor(e=[]){if(this.content=[],this.indent=0,this)this.args=e}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
`).filter((s)=>s),r=Math.min(...n.map((s)=>s.length-s.trimStart().length)),o=n.map((s)=>s.slice(r)).map((s)=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let e=Function,t=this?.args,r=[...(this?.content??[""]).map((o)=>` ${o}`)];return new e(...t,r.join(`
`))}}var t0={major:4,minor:0,patch:0};var We=P("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=t0;let r=[...e._zod.def.checks??[]];if(e._zod.traits.has("$ZodCheck"))r.unshift(e);for(let o of r)for(let s of o._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=(s,i,a)=>{let c=Ai(s),l;for(let u of i){if(u._zod.when){if(!u._zod.when(s))continue}else if(c)continue;let p=s.issues.length,f=u._zod.check(s);if(f instanceof Promise&&a?.async===!1)throw new ws;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{if(await f,s.issues.length===p)return;if(!c)c=Ai(s,p)});else{if(s.issues.length===p)continue;if(!c)c=Ai(s,p)}}if(l)return l.then(()=>s);return s};e._zod.run=(s,i)=>{let a=e._zod.parse(s,i);if(a instanceof Promise){if(i.async===!1)throw new ws;return a.then((c)=>o(c,r,i))}return o(a,r,i)}}e["~standard"]={validate:(o)=>{try{let s=Ti(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch(s){return ki(e,o).then((i)=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}}),Bu=P("$ZodString",(e,t)=>{We.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ID(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(o){}if(typeof n.value==="string")return n;return n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),lt=P("$ZodStringFormat",(e,t)=>{Hu.init(e,t),Bu.init(e,t)}),LS=P("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=_D),lt.init(e,t)}),MS=P("$ZodUUID",(e,t)=>{if(t.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=CS(r))}else t.pattern??(t.pattern=CS());lt.init(e,t)}),NS=P("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=yD),lt.init(e,t)}),US=P("$ZodURL",(e,t)=>{lt.init(e,t),e._zod.check=(n)=>{try{let r=n.value,o=new URL(r),s=o.href;if(t.hostname){if(t.hostname.lastIndex=0,!t.hostname.test(o.hostname))n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:AD.source,input:n.value,inst:e,continue:!t.abort})}if(t.protocol){if(t.protocol.lastIndex=0,!t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol))n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})}if(!r.endsWith("/")&&s.endsWith("/"))n.value=s.slice(0,-1);else n.value=s;return}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),FS=P("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=bD()),lt.init(e,t)}),zS=P("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=hD),lt.init(e,t)}),$S=P("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=uD),lt.init(e,t)}),jS=P("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=dD),lt.init(e,t)}),HS=P("$ZodULID",(e,t)=>{t.pattern??(t.pattern=pD),lt.init(e,t)}),BS=P("$ZodXID",(e,t)=>{t.pattern??(t.pattern=fD),lt.init(e,t)}),KS=P("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=mD),lt.init(e,t)}),d0=P("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=PD(t)),lt.init(e,t)}),p0=P("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=CD),lt.init(e,t)}),f0=P("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=OD(t)),lt.init(e,t)}),m0=P("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=gD),lt.init(e,t)}),GS=P("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=SD),lt.init(e,t),e._zod.onattach.push((n)=>{let r=n._zod.bag;r.format="ipv4"})}),WS=P("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ED),lt.init(e,t),e._zod.onattach.push((n)=>{let r=n._zod.bag;r.format="ipv6"}),e._zod.check=(n)=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),qS=P("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=xD),lt.init(e,t)}),VS=P("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=vD),lt.init(e,t),e._zod.check=(n)=>{let[r,o]=n.value.split("/");try{if(!o)throw Error();let s=Number(o);if(`${s}`!==o)throw Error();if(s<0||s>128)throw Error();new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function h0(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var ZS=P("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=wD),lt.init(e,t),e._zod.onattach.push((n)=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=(n)=>{if(h0(n.value))return;n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function EQ(e){if(!RS.test(e))return!1;let t=e.replace(/[-_]/g,(r)=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return h0(n)}var YS=P("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=RS),lt.init(e,t),e._zod.onattach.push((n)=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=(n)=>{if(EQ(n.value))return;n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),JS=P("$ZodE164",(e,t)=>{t.pattern??(t.pattern=TD),lt.init(e,t)});function xQ(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let o=JSON.parse(atob(r));if("typ"in o&&o?.typ!=="JWT")return!1;if(!o.alg)return!1;if(t&&(!("alg"in o)||o.alg!==t))return!1;return!0}catch{return!1}}var XS=P("$ZodJWT",(e,t)=>{lt.init(e,t),e._zod.check=(n)=>{if(xQ(n.value,t.alg))return;n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}});var Um=P("$ZodNumber",(e,t)=>{We.init(e,t),e._zod.pattern=e._zod.bag.pattern??MD,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(i){}let o=n.value;if(typeof o==="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;let s=typeof o==="number"?Number.isNaN(o)?"NaN":!Number.isFinite(o)?"Infinity":void 0:void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),QS=P("$ZodNumber",(e,t)=>{BD.init(e,t),Um.init(e,t)}),eE=P("$ZodBoolean",(e,t)=>{We.init(e,t),e._zod.pattern=ND,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(s){}let o=n.value;if(typeof o==="boolean")return n;return n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),tE=P("$ZodBigInt",(e,t)=>{We.init(e,t),e._zod.pattern=DD,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch(o){}if(typeof n.value==="bigint")return n;return n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}});var nE=P("$ZodUndefined",(e,t)=>{We.init(e,t),e._zod.pattern=FD,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,r)=>{let o=n.value;if(typeof o>"u")return n;return n.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:e}),n}}),rE=P("$ZodNull",(e,t)=>{We.init(e,t),e._zod.pattern=UD,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{let o=n.value;if(o===null)return n;return n.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),n}});var oE=P("$ZodUnknown",(e,t)=>{We.init(e,t),e._zod.parse=(n)=>n}),sE=P("$ZodNever",(e,t)=>{We.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});var iE=P("$ZodDate",(e,t)=>{We.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(a){}let o=n.value,s=o instanceof Date;if(s&&!Number.isNaN(o.getTime()))return n;return n.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:e}),n}});function n0(e,t,n){if(e.issues.length)t.issues.push(...vo(n,e.issues));t.value[n]=e.value}var aE=P("$ZodArray",(e,t)=>{We.init(e,t),e._zod.parse=(n,r)=>{let o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);let s=[];for(let i=0;i<o.length;i++){let a=o[i],c=t.element._zod.run({value:a,issues:[]},r);if(c instanceof Promise)s.push(c.then((l)=>n0(l,n,i)));else n0(c,n,i)}if(s.length)return Promise.all(s).then(()=>n);return n}});function Nm(e,t,n){if(e.issues.length)t.issues.push(...vo(n,e.issues));t.value[n]=e.value}function r0(e,t,n,r){if(e.issues.length)if(r[n]===void 0)if(n in r)t.value[n]=void 0;else t.value[n]=e.value;else t.issues.push(...vo(n,e.issues));else if(e.value===void 0){if(n in r)t.value[n]=void 0}else t.value[n]=e.value}var Fm=P("$ZodObject",(e,t)=>{We.init(e,t);let n=Nu(()=>{let p=Object.keys(t.shape);for(let m of p)if(!(t.shape[m]instanceof We))throw Error(`Invalid element at key "${m}": expected a Zod schema`);let f=bS(t.shape);return{shape:t.shape,keys:p,keySet:new Set(p),numKeys:p.length,optionalKeys:new Set(f)}});Ve(e._zod,"propValues",()=>{let p=t.shape,f={};for(let m in p){let h=p[m]._zod;if(h.values){f[m]??(f[m]=new Set);for(let _ of h.values)f[m].add(_)}}return f});let r=(p)=>{let f=new IS(["shape","payload","ctx"]),m=n.value,h=(b)=>{let x=wi(b);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};f.write("const input = payload.value;");let _=Object.create(null),y=0;for(let b of m.keys)_[b]=`key_${y++}`;f.write("const newResult = {}");for(let b of m.keys)if(m.optionalKeys.has(b)){let x=_[b];f.write(`const ${x} = ${h(b)};`);let v=wi(b);f.write(`
if (${x}.issues.length) {
if (input[${v}] === undefined) {
if (${v} in input) {
newResult[${v}] = undefined;
}
} else {
payload.issues = payload.issues.concat(
${x}.issues.map((iss) => ({
...iss,
path: iss.path ? [${v}, ...iss.path] : [${v}],
}))
);
}
} else if (${x}.value === undefined) {
if (${v} in input) newResult[${v}] = undefined;
} else {
newResult[${v}] = ${x}.value;
}
`)}else{let x=_[b];f.write(`const ${x} = ${h(b)};`),f.write(`
if (${x}.issues.length) payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
...iss,
path: iss.path ? [${wi(b)}, ...iss.path] : [${wi(b)}]
})));`),f.write(`newResult[${wi(b)}] = ${x}.value`)}f.write("payload.value = newResult;"),f.write("return payload;");let S=f.compile();return(b,x)=>S(p,b,x)},o,s=Ja,i=!Rm.jitless,c=i&&_S.value,l=t.catchall,u;e._zod.parse=(p,f)=>{u??(u=n.value);let m=p.value;if(!s(m))return p.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),p;let h=[];if(i&&c&&f?.async===!1&&f.jitless!==!0){if(!o)o=r(t.shape);p=o(p,f)}else{p.value={};let x=u.shape;for(let v of u.keys){let T=x[v],U=T._zod.run({value:m[v],issues:[]},f),M=T._zod.optin==="optional"&&T._zod.optout==="optional";if(U instanceof Promise)h.push(U.then((F)=>M?r0(F,p,v,m):Nm(F,p,v)));else if(M)r0(U,p,v,m);else Nm(U,p,v)}}if(!l)return h.length?Promise.all(h).then(()=>p):p;let _=[],y=u.keySet,S=l._zod,b=S.def.type;for(let x of Object.keys(m)){if(y.has(x))continue;if(b==="never"){_.push(x);continue}let v=S.run({value:m[x],issues:[]},f);if(v instanceof Promise)h.push(v.then((T)=>Nm(T,p,x)));else Nm(v,p,x)}if(_.length)p.issues.push({code:"unrecognized_keys",keys:_,input:m,inst:e});if(!h.length)return p;return Promise.all(h).then(()=>p)}});function o0(e,t,n,r){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((o)=>o.issues.map((s)=>Br(s,r,Ln())))}),t}var zm=P("$ZodUnion",(e,t)=>{We.init(e,t),Ve(e._zod,"optin",()=>t.options.some((n)=>n._zod.optin==="optional")?"optional":void 0),Ve(e._zod,"optout",()=>t.options.some((n)=>n._zod.optout==="optional")?"optional":void 0),Ve(e._zod,"values",()=>{if(t.options.every((n)=>n._zod.values))return new Set(t.options.flatMap((n)=>Array.from(n._zod.values)));return}),Ve(e._zod,"pattern",()=>{if(t.options.every((n)=>n._zod.pattern)){let n=t.options.map((r)=>r._zod.pattern);return new RegExp(`^(${n.map((r)=>Fu(r.source)).join("|")})$`)}return}),e._zod.parse=(n,r)=>{let o=!1,s=[];for(let i of t.options){let a=i._zod.run({value:n.value,issues:[]},r);if(a instanceof Promise)s.push(a),o=!0;else{if(a.issues.length===0)return a;s.push(a)}}if(!o)return o0(s,n,e,r);return Promise.all(s).then((i)=>o0(i,n,e,r))}}),cE=P("$ZodDiscriminatedUnion",(e,t)=>{zm.init(e,t);let n=e._zod.parse;Ve(e._zod,"propValues",()=>{let o={};for(let s of t.options){let i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[a,c]of Object.entries(i)){if(!o[a])o[a]=new Set;for(let l of c)o[a].add(l)}}return o});let r=Nu(()=>{let o=t.options,s=new Map;for(let i of o){let a=i._zod.propValues[t.discriminator];if(!a||a.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let c of a){if(s.has(c))throw Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,i)}}return s});e._zod.parse=(o,s)=>{let i=o.value;if(!Ja(i))return o.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),o;let a=r.value.get(i?.[t.discriminator]);if(a)return a._zod.run(o,s);if(t.unionFallback)return n(o,s);return o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:i,path:[t.discriminator],inst:e}),o}}),lE=P("$ZodIntersection",(e,t)=>{We.init(e,t),e._zod.parse=(n,r)=>{let o=n.value,s=t.left._zod.run({value:o,issues:[]},r),i=t.right._zod.run({value:o,issues:[]},r);if(s instanceof Promise||i instanceof Promise)return Promise.all([s,i]).then(([c,l])=>s0(n,c,l));return s0(n,s,i)}});function DS(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Xa(e)&&Xa(t)){let n=Object.keys(t),r=Object.keys(e).filter((s)=>n.indexOf(s)!==-1),o={...e,...t};for(let s of r){let i=DS(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let o=e[r],s=t[r],i=DS(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function s0(e,t,n){if(t.issues.length)e.issues.push(...t.issues);if(n.issues.length)e.issues.push(...n.issues);if(Ai(e))return e;let r=DS(t.value,n.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}var uE=P("$ZodRecord",(e,t)=>{We.init(e,t),e._zod.parse=(n,r)=>{let o=n.value;if(!Xa(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;let s=[];if(t.keyType._zod.values){let i=t.keyType._zod.values;n.value={};for(let c of i)if(typeof c==="string"||typeof c==="number"||typeof c==="symbol"){let l=t.valueType._zod.run({value:o[c],issues:[]},r);if(l instanceof Promise)s.push(l.then((u)=>{if(u.issues.length)n.issues.push(...vo(c,u.issues));n.value[c]=u.value}));else{if(l.issues.length)n.issues.push(...vo(c,l.issues));n.value[c]=l.value}}let a;for(let c in o)if(!i.has(c))a=a??[],a.push(c);if(a&&a.length>0)n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{n.value={};for(let i of Reflect.ownKeys(o)){if(i==="__proto__")continue;let a=t.keyType._zod.run({value:i,issues:[]},r);if(a instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(a.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:a.issues.map((l)=>Br(l,r,Ln())),input:i,path:[i],inst:e}),n.value[a.value]=a.value;continue}let c=t.valueType._zod.run({value:o[i],issues:[]},r);if(c instanceof Promise)s.push(c.then((l)=>{if(l.issues.length)n.issues.push(...vo(i,l.issues));n.value[a.value]=l.value}));else{if(c.issues.length)n.issues.push(...vo(i,c.issues));n.value[a.value]=c.value}}}if(s.length)return Promise.all(s).then(()=>n);return n}});var dE=P("$ZodEnum",(e,t)=>{We.init(e,t);let n=Mu(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter((r)=>yS.has(typeof r)).map((r)=>typeof r==="string"?As(r):r.toString()).join("|")})$`),e._zod.parse=(r,o)=>{let s=r.value;if(e._zod.values.has(s))return r;return r.issues.push({code:"invalid_value",values:n,input:s,inst:e}),r}}),pE=P("$ZodLiteral",(e,t)=>{We.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map((n)=>typeof n==="string"?As(n):n?n.toString():String(n)).join("|")})$`),e._zod.parse=(n,r)=>{let o=n.value;if(e._zod.values.has(o))return n;return n.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),n}});var fE=P("$ZodTransform",(e,t)=>{We.init(e,t),e._zod.parse=(n,r)=>{let o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then((i)=>(n.value=i,n));if(o instanceof Promise)throw new ws;return n.value=o,n}}),mE=P("$ZodOptional",(e,t)=>{We.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ve(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ve(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${Fu(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional")return t.innerType._zod.run(n,r);if(n.value===void 0)return n;return t.innerType._zod.run(n,r)}}),hE=P("$ZodNullable",(e,t)=>{We.init(e,t),Ve(e._zod,"optin",()=>t.innerType._zod.optin),Ve(e._zod,"optout",()=>t.innerType._zod.optout),Ve(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${Fu(n.source)}|null)$`):void 0}),Ve(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>{if(n.value===null)return n;return t.innerType._zod.run(n,r)}}),gE=P("$ZodDefault",(e,t)=>{We.init(e,t),e._zod.optin="optional",Ve(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(n.value===void 0)return n.value=t.defaultValue,n;let o=t.innerType._zod.run(n,r);if(o instanceof Promise)return o.then((s)=>i0(s,t));return i0(o,t)}});function i0(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var _E=P("$ZodPrefault",(e,t)=>{We.init(e,t),e._zod.optin="optional",Ve(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(n.value===void 0)n.value=t.defaultValue;return t.innerType._zod.run(n,r)}}),yE=P("$ZodNonOptional",(e,t)=>{We.init(e,t),Ve(e._zod,"values",()=>{let n=t.innerType._zod.values;return n?new Set([...n].filter((r)=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{let o=t.innerType._zod.run(n,r);if(o instanceof Promise)return o.then((s)=>a0(s,e));return a0(o,e)}});function a0(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}var bE=P("$ZodCatch",(e,t)=>{We.init(e,t),e._zod.optin="optional",Ve(e._zod,"optout",()=>t.innerType._zod.optout),Ve(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{let o=t.innerType._zod.run(n,r);if(o instanceof Promise)return o.then((s)=>{if(n.value=s.value,s.issues.length)n.value=t.catchValue({...n,error:{issues:s.issues.map((i)=>Br(i,r,Ln()))},input:n.value}),n.issues=[];return n});if(n.value=o.value,o.issues.length)n.value=t.catchValue({...n,error:{issues:o.issues.map((s)=>Br(s,r,Ln()))},input:n.value}),n.issues=[];return n}});var SE=P("$ZodPipe",(e,t)=>{We.init(e,t),Ve(e._zod,"values",()=>t.in._zod.values),Ve(e._zod,"optin",()=>t.in._zod.optin),Ve(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(n,r)=>{let o=t.in._zod.run(n,r);if(o instanceof Promise)return o.then((s)=>c0(s,t,r));return c0(o,t,r)}});function c0(e,t,n){if(Ai(e))return e;return t.out._zod.run({value:e.value,issues:e.issues},n)}var EE=P("$ZodReadonly",(e,t)=>{We.init(e,t),Ve(e._zod,"propValues",()=>t.innerType._zod.propValues),Ve(e._zod,"values",()=>t.innerType._zod.values),Ve(e._zod,"optin",()=>t.innerType._zod.optin),Ve(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,r)=>{let o=t.innerType._zod.run(n,r);if(o instanceof Promise)return o.then(l0);return l0(o)}});function l0(e){return e.value=Object.freeze(e.value),e}var xE=P("$ZodLazy",(e,t)=>{We.init(e,t),Ve(e._zod,"innerType",()=>t.getter()),Ve(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),Ve(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),Ve(e._zod,"optin",()=>e._zod.innerType._zod.optin),Ve(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),vE=P("$ZodCustom",(e,t)=>{rn.init(e,t),We.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=(n)=>{let r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then((s)=>u0(s,n,r,e));u0(o,n,r,e);return}});function u0(e,t,n,r){if(!e){let o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};if(r._zod.def.params)o.params=r._zod.def.params;t.issues.push(ES(o))}}var vQ=(e)=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},wQ=()=>{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"}};function t(r){return e[r]??null}let n={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"};return(r)=>{switch(r.code){case"invalid_type":return`Invalid input: expected ${r.expected}, received ${vQ(r.input)}`;case"invalid_value":if(r.values.length===1)return`Invalid input: expected ${Im(r.values[0])}`;return`Invalid option: expected one of ${Om(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=t(r.origin);if(s)return`Too big: expected ${r.origin??"value"} to have ${o}${r.maximum.toString()} ${s.unit??"elements"}`;return`Too big: expected ${r.origin??"value"} to be ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=t(r.origin);if(s)return`Too small: expected ${r.origin} to have ${o}${r.minimum.toString()} ${s.unit}`;return`Too small: expected ${r.origin} to be ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;if(o.format==="starts_with")return`Invalid string: must start with "${o.prefix}"`;if(o.format==="ends_with")return`Invalid string: must end with "${o.suffix}"`;if(o.format==="includes")return`Invalid string: must include "${o.includes}"`;if(o.format==="regex")return`Invalid string: must match pattern ${o.pattern}`;return`Invalid ${n[o.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${Om(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}};function wE(){return{localeError:wQ()}}var g0=Symbol("ZodOutput"),_0=Symbol("ZodInput");class $m{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==="object"&&"id"in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}remove(e){return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}}function AE(){return new $m}var xr=AE();function TE(e,t){return new e({type:"string",...ue(t)})}function y0(e,t){return new e({type:"string",coerce:!0,...ue(t)})}function kE(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ue(t)})}function jm(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ue(t)})}function CE(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ue(t)})}function RE(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ue(t)})}function OE(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ue(t)})}function PE(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ue(t)})}function IE(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ue(t)})}function DE(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ue(t)})}function LE(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ue(t)})}function ME(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ue(t)})}function NE(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ue(t)})}function UE(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ue(t)})}function FE(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ue(t)})}function zE(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ue(t)})}function $E(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ue(t)})}function jE(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ue(t)})}function HE(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ue(t)})}function BE(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ue(t)})}function KE(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ue(t)})}function GE(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ue(t)})}function WE(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ue(t)})}function qE(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ue(t)})}function b0(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ue(t)})}function S0(e,t){return new e({type:"string",format:"date",check:"string_format",...ue(t)})}function E0(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ue(t)})}function x0(e,t){return new e({type:"string",format:"duration",check:"string_format",...ue(t)})}function VE(e,t){return new e({type:"number",checks:[],...ue(t)})}function v0(e,t){return new e({type:"number",coerce:!0,checks:[],...ue(t)})}function ZE(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ue(t)})}function YE(e,t){return new e({type:"boolean",...ue(t)})}function w0(e,t){return new e({type:"boolean",coerce:!0,...ue(t)})}function A0(e,t){return new e({type:"bigint",coerce:!0,...ue(t)})}function JE(e,t){return new e({type:"undefined",...ue(t)})}function XE(e,t){return new e({type:"null",...ue(t)})}function QE(e){return new e({type:"unknown"})}function ex(e,t){return new e({type:"never",...ue(t)})}function T0(e,t){return new e({type:"date",coerce:!0,...ue(t)})}function Qa(e,t){return new OS({check:"less_than",...ue(t),value:e,inclusive:!1})}function Vo(e,t){return new OS({check:"less_than",...ue(t),value:e,inclusive:!0})}function ec(e,t){return new PS({check:"greater_than",...ue(t),value:e,inclusive:!1})}function Kr(e,t){return new PS({check:"greater_than",...ue(t),value:e,inclusive:!0})}function Ku(e,t){return new HD({check:"multiple_of",...ue(t),value:e})}function Hm(e,t){return new KD({check:"max_length",...ue(t),maximum:e})}function tc(e,t){return new GD({check:"min_length",...ue(t),minimum:e})}function Bm(e,t){return new WD({check:"length_equals",...ue(t),length:e})}function tx(e,t){return new qD({check:"string_format",format:"regex",...ue(t),pattern:e})}function nx(e){return new VD({check:"string_format",format:"lowercase",...ue(e)})}function rx(e){return new ZD({check:"string_format",format:"uppercase",...ue(e)})}function ox(e,t){return new YD({check:"string_format",format:"includes",...ue(t),includes:e})}function sx(e,t){return new JD({check:"string_format",format:"starts_with",...ue(t),prefix:e})}function ix(e,t){return new XD({check:"string_format",format:"ends_with",...ue(t),suffix:e})}function Ci(e){return new QD({check:"overwrite",tx:e})}function ax(e){return Ci((t)=>t.normalize(e))}function cx(){return Ci((e)=>e.trim())}function lx(){return Ci((e)=>e.toLowerCase())}function ux(){return Ci((e)=>e.toUpperCase())}function k0(e,t,n){return new e({type:"array",element:t,...ue(n)})}function dx(e,t,n){let r=ue(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function px(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ue(n)})}class fx{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??xr,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var n;let r=e._zod.def,o={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},s=this.seen.get(e);if(s){if(s.count++,t.schemaPath.includes(e))s.cycle=t.path;return s.schema}let i={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,i);let a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{let u={...t,schemaPath:[...t.schemaPath,e],path:t.path},p=e._zod.parent;if(p)i.ref=p,this.process(p,u),this.seen.get(p).isParent=!0;else{let f=i.schema;switch(r.type){case"string":{let m=f;m.type="string";let{minimum:h,maximum:_,format:y,patterns:S,contentEncoding:b}=e._zod.bag;if(typeof h==="number")m.minLength=h;if(typeof _==="number")m.maxLength=_;if(y){if(m.format=o[y]??y,m.format==="")delete m.format}if(b)m.contentEncoding=b;if(S&&S.size>0){let x=[...S];if(x.length===1)m.pattern=x[0].source;else if(x.length>1)i.schema.allOf=[...x.map((v)=>({...this.target==="draft-7"?{type:"string"}:{},pattern:v.source}))]}break}case"number":{let m=f,{minimum:h,maximum:_,format:y,multipleOf:S,exclusiveMaximum:b,exclusiveMinimum:x}=e._zod.bag;if(typeof y==="string"&&y.includes("int"))m.type="integer";else m.type="number";if(typeof x==="number")m.exclusiveMinimum=x;if(typeof h==="number"){if(m.minimum=h,typeof x==="number")if(x>=h)delete m.minimum;else delete m.exclusiveMinimum}if(typeof b==="number")m.exclusiveMaximum=b;if(typeof _==="number"){if(m.maximum=_,typeof b==="number")if(b<=_)delete m.maximum;else delete m.exclusiveMaximum}if(typeof S==="number")m.multipleOf=S;break}case"boolean":{let m=f;m.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{f.type="null";break}case"any":break;case"unknown":break;case"undefined":case"never":{f.not={};break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let m=f,{minimum:h,maximum:_}=e._zod.bag;if(typeof h==="number")m.minItems=h;if(typeof _==="number")m.maxItems=_;m.type="array",m.items=this.process(r.element,{...u,path:[...u.path,"items"]});break}case"object":{let m=f;m.type="object",m.properties={};let h=r.shape;for(let S in h)m.properties[S]=this.process(h[S],{...u,path:[...u.path,"properties",S]});let _=new Set(Object.keys(h)),y=new Set([..._].filter((S)=>{let b=r.shape[S]._zod;if(this.io==="input")return b.optin===void 0;else return b.optout===void 0}));if(y.size>0)m.required=Array.from(y);if(r.catchall?._zod.def.type==="never")m.additionalProperties=!1;else if(!r.catchall){if(this.io==="output")m.additionalProperties=!1}else if(r.catchall)m.additionalProperties=this.process(r.catchall,{...u,path:[...u.path,"additionalProperties"]});break}case"union":{let m=f;m.anyOf=r.options.map((h,_)=>this.process(h,{...u,path:[...u.path,"anyOf",_]}));break}case"intersection":{let m=f,h=this.process(r.left,{...u,path:[...u.path,"allOf",0]}),_=this.process(r.right,{...u,path:[...u.path,"allOf",1]}),y=(b)=>("allOf"in b)&&Object.keys(b).length===1,S=[...y(h)?h.allOf:[h],...y(_)?_.allOf:[_]];m.allOf=S;break}case"tuple":{let m=f;m.type="array";let h=r.items.map((S,b)=>this.process(S,{...u,path:[...u.path,"prefixItems",b]}));if(this.target==="draft-2020-12")m.prefixItems=h;else m.items=h;if(r.rest){let S=this.process(r.rest,{...u,path:[...u.path,"items"]});if(this.target==="draft-2020-12")m.items=S;else m.additionalItems=S}if(r.rest)m.items=this.process(r.rest,{...u,path:[...u.path,"items"]});let{minimum:_,maximum:y}=e._zod.bag;if(typeof _==="number")m.minItems=_;if(typeof y==="number")m.maxItems=y;break}case"record":{let m=f;m.type="object",m.propertyNames=this.process(r.keyType,{...u,path:[...u.path,"propertyNames"]}),m.additionalProperties=this.process(r.valueType,{...u,path:[...u.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let m=f,h=Mu(r.entries);if(h.every((_)=>typeof _==="number"))m.type="number";if(h.every((_)=>typeof _==="string"))m.type="string";m.enum=h;break}case"literal":{let m=f,h=[];for(let _ of r.values)if(_===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof _==="bigint")if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else h.push(Number(_));else h.push(_);if(h.length===0);else if(h.length===1){let _=h[0];m.type=_===null?"null":typeof _,m.const=_}else{if(h.every((_)=>typeof _==="number"))m.type="number";if(h.every((_)=>typeof _==="string"))m.type="string";if(h.every((_)=>typeof _==="boolean"))m.type="string";if(h.every((_)=>_===null))m.type="null";m.enum=h}break}case"file":{let m=f,h={type:"string",format:"binary",contentEncoding:"binary"},{minimum:_,maximum:y,mime:S}=e._zod.bag;if(_!==void 0)h.minLength=_;if(y!==void 0)h.maxLength=y;if(S)if(S.length===1)h.contentMediaType=S[0],Object.assign(m,h);else m.anyOf=S.map((b)=>({...h,contentMediaType:b}));else Object.assign(m,h);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let m=this.process(r.innerType,u);f.anyOf=[m,{type:"null"}];break}case"nonoptional":{this.process(r.innerType,u),i.ref=r.innerType;break}case"success":{let m=f;m.type="boolean";break}case"default":{this.process(r.innerType,u),i.ref=r.innerType,f.default=JSON.parse(JSON.stringify(r.defaultValue));break}case"prefault":{if(this.process(r.innerType,u),i.ref=r.innerType,this.io==="input")f._prefault=JSON.parse(JSON.stringify(r.defaultValue));break}case"catch":{this.process(r.innerType,u),i.ref=r.innerType;let m;try{m=r.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}f.default=m;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let m=f,h=e._zod.pattern;if(!h)throw Error("Pattern not found in template literal");m.type="string",m.pattern=h.source;break}case"pipe":{let m=this.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;this.process(m,u),i.ref=m;break}case"readonly":{this.process(r.innerType,u),i.ref=r.innerType,f.readOnly=!0;break}case"promise":{this.process(r.innerType,u),i.ref=r.innerType;break}case"optional":{this.process(r.innerType,u),i.ref=r.innerType;break}case"lazy":{let m=e._zod.innerType;this.process(m,u),i.ref=m;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}default:}}}let c=this.metadataRegistry.get(e);if(c)Object.assign(i.schema,c);if(this.io==="input"&&Gt(e))delete i.schema.examples,delete i.schema.default;if(this.io==="input"&&i.schema._prefault)(n=i.schema).default??(n.default=i.schema._prefault);return delete i.schema._prefault,this.seen.get(e).schema}emit(e,t){let n={cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0},r=this.seen.get(e);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=(l)=>{let u=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let h=n.external.registry.get(l[0])?.id;if(h)return{ref:n.external.uri(h)};let _=l[1].defId??l[1].schema.id??`schema${this.counter++}`;return l[1].defId=_,{defId:_,ref:`${n.external.uri("__shared")}#/${u}/${_}`}}if(l[1]===r)return{ref:"#"};let f=`${"#"}/${u}/`,m=l[1].schema.id??`__schema${this.counter++}`;return{defId:m,ref:f+m}},s=(l)=>{if(l[1].schema.$ref)return;let u=l[1],{ref:p,defId:f}=o(l);if(u.def={...u.schema},f)u.defId=f;let m=u.schema;for(let h in m)delete m[h];m.$ref=p};for(let l of this.seen.entries()){let u=l[1];if(e===l[0]){s(l);continue}if(n.external){let f=n.external.registry.get(l[0])?.id;if(e!==l[0]&&f){s(l);continue}}if(this.metadataRegistry.get(l[0])?.id){s(l);continue}if(u.cycle){if(n.cycles==="throw")throw Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);else if(n.cycles==="ref")s(l);continue}if(u.count>1){if(n.reused==="ref"){s(l);continue}}}let i=(l,u)=>{let p=this.seen.get(l),f=p.def??p.schema,m={...f};if(p.ref===null)return;let h=p.ref;if(p.ref=null,h){i(h,u);let _=this.seen.get(h).schema;if(_.$ref&&u.target==="draft-7")f.allOf=f.allOf??[],f.allOf.push(_);else Object.assign(f,_),Object.assign(f,m)}if(!p.isParent)this.override({zodSchema:l,jsonSchema:f,path:p.path??[]})};for(let l of[...this.seen.entries()].reverse())i(l[0],{target:this.target});let a={};if(this.target==="draft-2020-12")a.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")a.$schema="http://json-schema.org/draft-07/schema#";else console.warn(`Invalid target: ${this.target}`);Object.assign(a,r.def);let c=n.external?.defs??{};for(let l of this.seen.entries()){let u=l[1];if(u.def&&u.defId)c[u.defId]=u.def}if(!n.external&&Object.keys(c).length>0)if(this.target==="draft-2020-12")a.$defs=c;else a.definitions=c;try{return JSON.parse(JSON.stringify(a))}catch(l){throw Error("Error converting schema to JSON.")}}}function Km(e,t){if(e instanceof $m){let r=new fx(t),o={};for(let a of e._idmap.entries()){let[c,l]=a;r.process(l)}let s={},i={registry:e,uri:t?.uri||((a)=>a),defs:o};for(let a of e._idmap.entries()){let[c,l]=a;s[c]=r.emit(l,{...t,external:i})}if(Object.keys(o).length>0){let a=r.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[a]:o}}return{schemas:s}}let n=new fx(t);return n.process(e),n.emit(e,t)}function Gt(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let o=e._zod.def;switch(o.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Gt(o.element,n);case"object":{for(let s in o.shape)if(Gt(o.shape[s],n))return!0;return!1}case"union":{for(let s of o.options)if(Gt(s,n))return!0;return!1}case"intersection":return Gt(o.left,n)||Gt(o.right,n);case"tuple":{for(let s of o.items)if(Gt(s,n))return!0;if(o.rest&&Gt(o.rest,n))return!0;return!1}case"record":return Gt(o.keyType,n)||Gt(o.valueType,n);case"map":return Gt(o.keyType,n)||Gt(o.valueType,n);case"set":return Gt(o.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Gt(o.innerType,n);case"lazy":return Gt(o.getter(),n);case"default":return Gt(o.innerType,n);case"prefault":return Gt(o.innerType,n);case"custom":return!1;case"transform":return!0;case"pipe":return Gt(o.in,n)||Gt(o.out,n);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${o.type}`)}var Gu={};Xt(Gu,{ZodISODate:()=>O0,ZodISODateTime:()=>R0,ZodISODuration:()=>I0,ZodISOTime:()=>P0,date:()=>hx,datetime:()=>mx,duration:()=>_x,time:()=>gx});var R0=P("ZodISODateTime",(e,t)=>{d0.init(e,t),gt.init(e,t)});function mx(e){return b0(R0,e)}var O0=P("ZodISODate",(e,t)=>{p0.init(e,t),gt.init(e,t)});function hx(e){return S0(O0,e)}var P0=P("ZodISOTime",(e,t)=>{f0.init(e,t),gt.init(e,t)});function gx(e){return E0(P0,e)}var I0=P("ZodISODuration",(e,t)=>{m0.init(e,t),gt.init(e,t)});function _x(e){return x0(I0,e)}var L0=(e,t)=>{Dm.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(n)=>Mm(e,n)},flatten:{value:(n)=>Lm(e,n)},addIssue:{value:(n)=>e.issues.push(n)},addIssues:{value:(n)=>e.issues.push(...n)},isEmpty:{get(){return e.issues.length===0}}})},g5e=P("ZodError",L0),Wu=P("ZodError",L0,{Parent:Error});var M0=xS(Wu),N0=wS(Wu),U0=TS(Wu),F0=kS(Wu);var it=P("ZodType",(e,t)=>(We.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),e.clone=(n,r)=>Mn(e,n,r),e.brand=()=>e,e.register=(n,r)=>(n.add(e,r),e),e.parse=(n,r)=>M0(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>U0(e,n,r),e.parseAsync=async(n,r)=>N0(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>F0(e,n,r),e.spa=e.safeParseAsync,e.refine=(n,r)=>e.check(Gee(n,r)),e.superRefine=(n)=>e.check(Wee(n)),e.overwrite=(n)=>e.check(Ci(n)),e.optional=()=>_t(e),e.nullable=()=>j0(e),e.nullish=()=>_t(j0(e)),e.nonoptional=(n)=>Uee(e,n),e.array=()=>I(e),e.or=(n)=>ie([e,n]),e.and=(n)=>qm(e,n),e.transform=(n)=>bx(e,Z0(n)),e.default=(n)=>Lee(e,n),e.prefault=(n)=>Nee(e,n),e.catch=(n)=>zee(e,n),e.pipe=(n)=>bx(e,n),e.readonly=()=>Hee(e),e.describe=(n)=>{let r=e.clone();return xr.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return xr.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return xr.get(e);let r=e.clone();return xr.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),H0=P("_ZodString",(e,t)=>{Bu.init(e,t),it.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(tx(...r)),e.includes=(...r)=>e.check(ox(...r)),e.startsWith=(...r)=>e.check(sx(...r)),e.endsWith=(...r)=>e.check(ix(...r)),e.min=(...r)=>e.check(tc(...r)),e.max=(...r)=>e.check(Hm(...r)),e.length=(...r)=>e.check(Bm(...r)),e.nonempty=(...r)=>e.check(tc(1,...r)),e.lowercase=(r)=>e.check(nx(r)),e.uppercase=(r)=>e.check(rx(r)),e.trim=()=>e.check(cx()),e.normalize=(...r)=>e.check(ax(...r)),e.toLowerCase=()=>e.check(lx()),e.toUpperCase=()=>e.check(ux())}),Sx=P("ZodString",(e,t)=>{Bu.init(e,t),H0.init(e,t),e.email=(n)=>e.check(kE(see,n)),e.url=(n)=>e.check(IE(iee,n)),e.jwt=(n)=>e.check(qE(Eee,n)),e.emoji=(n)=>e.check(DE(aee,n)),e.guid=(n)=>e.check(jm(z0,n)),e.uuid=(n)=>e.check(CE(Gm,n)),e.uuidv4=(n)=>e.check(RE(Gm,n)),e.uuidv6=(n)=>e.check(OE(Gm,n)),e.uuidv7=(n)=>e.check(PE(Gm,n)),e.nanoid=(n)=>e.check(LE(cee,n)),e.guid=(n)=>e.check(jm(z0,n)),e.cuid=(n)=>e.check(ME(lee,n)),e.cuid2=(n)=>e.check(NE(uee,n)),e.ulid=(n)=>e.check(UE(dee,n)),e.base64=(n)=>e.check(KE(yee,n)),e.base64url=(n)=>e.check(GE(bee,n)),e.xid=(n)=>e.check(FE(pee,n)),e.ksuid=(n)=>e.check(zE(fee,n)),e.ipv4=(n)=>e.check($E(mee,n)),e.ipv6=(n)=>e.check(jE(hee,n)),e.cidrv4=(n)=>e.check(HE(gee,n)),e.cidrv6=(n)=>e.check(BE(_ee,n)),e.e164=(n)=>e.check(WE(See,n)),e.datetime=(n)=>e.check(mx(n)),e.date=(n)=>e.check(hx(n)),e.time=(n)=>e.check(gx(n)),e.duration=(n)=>e.check(_x(n))});function g(e){return TE(Sx,e)}var gt=P("ZodStringFormat",(e,t)=>{lt.init(e,t),H0.init(e,t)}),see=P("ZodEmail",(e,t)=>{NS.init(e,t),gt.init(e,t)});var z0=P("ZodGUID",(e,t)=>{LS.init(e,t),gt.init(e,t)});var Gm=P("ZodUUID",(e,t)=>{MS.init(e,t),gt.init(e,t)});var iee=P("ZodURL",(e,t)=>{US.init(e,t),gt.init(e,t)});var aee=P("ZodEmoji",(e,t)=>{FS.init(e,t),gt.init(e,t)});var cee=P("ZodNanoID",(e,t)=>{zS.init(e,t),gt.init(e,t)});var lee=P("ZodCUID",(e,t)=>{$S.init(e,t),gt.init(e,t)});var uee=P("ZodCUID2",(e,t)=>{jS.init(e,t),gt.init(e,t)});var dee=P("ZodULID",(e,t)=>{HS.init(e,t),gt.init(e,t)});var pee=P("ZodXID",(e,t)=>{BS.init(e,t),gt.init(e,t)});var fee=P("ZodKSUID",(e,t)=>{KS.init(e,t),gt.init(e,t)});var mee=P("ZodIPv4",(e,t)=>{GS.init(e,t),gt.init(e,t)});var hee=P("ZodIPv6",(e,t)=>{WS.init(e,t),gt.init(e,t)});var gee=P("ZodCIDRv4",(e,t)=>{qS.init(e,t),gt.init(e,t)});var _ee=P("ZodCIDRv6",(e,t)=>{VS.init(e,t),gt.init(e,t)});var yee=P("ZodBase64",(e,t)=>{ZS.init(e,t),gt.init(e,t)});var bee=P("ZodBase64URL",(e,t)=>{YS.init(e,t),gt.init(e,t)});var See=P("ZodE164",(e,t)=>{JS.init(e,t),gt.init(e,t)});var Eee=P("ZodJWT",(e,t)=>{XS.init(e,t),gt.init(e,t)});var Wm=P("ZodNumber",(e,t)=>{Um.init(e,t),it.init(e,t),e.gt=(r,o)=>e.check(ec(r,o)),e.gte=(r,o)=>e.check(Kr(r,o)),e.min=(r,o)=>e.check(Kr(r,o)),e.lt=(r,o)=>e.check(Qa(r,o)),e.lte=(r,o)=>e.check(Vo(r,o)),e.max=(r,o)=>e.check(Vo(r,o)),e.int=(r)=>e.check($0(r)),e.safe=(r)=>e.check($0(r)),e.positive=(r)=>e.check(ec(0,r)),e.nonnegative=(r)=>e.check(Kr(0,r)),e.negative=(r)=>e.check(Qa(0,r)),e.nonpositive=(r)=>e.check(Vo(0,r)),e.multipleOf=(r,o)=>e.check(Ku(r,o)),e.step=(r,o)=>e.check(Ku(r,o)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??0.5),e.isFinite=!0,e.format=n.format??null});function K(e){return VE(Wm,e)}var xee=P("ZodNumberFormat",(e,t)=>{QS.init(e,t),Wm.init(e,t)});function $0(e){return ZE(xee,e)}var Ex=P("ZodBoolean",(e,t)=>{eE.init(e,t),it.init(e,t)});function R(e){return YE(Ex,e)}var B0=P("ZodBigInt",(e,t)=>{tE.init(e,t),it.init(e,t),e.gte=(r,o)=>e.check(Kr(r,o)),e.min=(r,o)=>e.check(Kr(r,o)),e.gt=(r,o)=>e.check(ec(r,o)),e.gte=(r,o)=>e.check(Kr(r,o)),e.min=(r,o)=>e.check(Kr(r,o)),e.lt=(r,o)=>e.check(Qa(r,o)),e.lte=(r,o)=>e.check(Vo(r,o)),e.max=(r,o)=>e.check(Vo(r,o)),e.positive=(r)=>e.check(ec(BigInt(0),r)),e.negative=(r)=>e.check(Qa(BigInt(0),r)),e.nonpositive=(r)=>e.check(Vo(BigInt(0),r)),e.nonnegative=(r)=>e.check(Kr(BigInt(0),r)),e.multipleOf=(r,o)=>e.check(Ku(r,o));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});var vee=P("ZodUndefined",(e,t)=>{nE.init(e,t),it.init(e,t)});function xx(e){return JE(vee,e)}var wee=P("ZodNull",(e,t)=>{rE.init(e,t),it.init(e,t)});function K0(e){return XE(wee,e)}var Aee=P("ZodUnknown",(e,t)=>{oE.init(e,t),it.init(e,t)});function xe(){return QE(Aee)}var Tee=P("ZodNever",(e,t)=>{sE.init(e,t),it.init(e,t)});function vx(e){return ex(Tee,e)}var G0=P("ZodDate",(e,t)=>{iE.init(e,t),it.init(e,t),e.min=(r,o)=>e.check(Kr(r,o)),e.max=(r,o)=>e.check(Vo(r,o));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});var kee=P("ZodArray",(e,t)=>{aE.init(e,t),it.init(e,t),e.element=t.element,e.min=(n,r)=>e.check(tc(n,r)),e.nonempty=(n)=>e.check(tc(1,n)),e.max=(n,r)=>e.check(Hm(n,r)),e.length=(n,r)=>e.check(Bm(n,r)),e.unwrap=()=>e.element});function I(e,t){return k0(kee,e,t)}var wx=P("ZodObject",(e,t)=>{Fm.init(e,t),it.init(e,t),ke.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Z(Object.keys(e._zod.def.shape)),e.catchall=(n)=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:xe()}),e.loose=()=>e.clone({...e._zod.def,catchall:xe()}),e.strict=()=>e.clone({...e._zod.def,catchall:vx()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=(n)=>ke.extend(e,n),e.merge=(n)=>ke.merge(e,n),e.pick=(n)=>ke.pick(e,n),e.omit=(n)=>ke.omit(e,n),e.partial=(...n)=>ke.partial(Y0,e,n[0]),e.required=(...n)=>ke.required(J0,e,n[0])});function A(e,t){let n={type:"object",get shape(){return ke.assignProp(this,"shape",{...e}),this.shape},...ke.normalizeParams(t)};return new wx(n)}function Ax(e,t){return new wx({type:"object",get shape(){return ke.assignProp(this,"shape",{...e}),this.shape},catchall:vx(),...ke.normalizeParams(t)})}function wn(e,t){return new wx({type:"object",get shape(){return ke.assignProp(this,"shape",{...e}),this.shape},catchall:xe(),...ke.normalizeParams(t)})}var W0=P("ZodUnion",(e,t)=>{zm.init(e,t),it.init(e,t),e.options=t.options});function ie(e,t){return new W0({type:"union",options:e,...ke.normalizeParams(t)})}var Cee=P("ZodDiscriminatedUnion",(e,t)=>{W0.init(e,t),cE.init(e,t)});function Ri(e,t,n){return new Cee({type:"union",options:t,discriminator:e,...ke.normalizeParams(n)})}var Ree=P("ZodIntersection",(e,t)=>{lE.init(e,t),it.init(e,t)});function qm(e,t){return new Ree({type:"intersection",left:e,right:t})}var q0=P("ZodRecord",(e,t)=>{uE.init(e,t),it.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function V(e,t,n){return new q0({type:"record",keyType:e,valueType:t,...ke.normalizeParams(n)})}function V0(e,t,n){return new q0({type:"record",keyType:ie([e,vx()]),valueType:t,...ke.normalizeParams(n)})}var yx=P("ZodEnum",(e,t)=>{dE.init(e,t),it.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{let s={};for(let i of r)if(n.has(i))s[i]=t.entries[i];else throw Error(`Key ${i} not found in enum`);return new yx({...t,checks:[],...ke.normalizeParams(o),entries:s})},e.exclude=(r,o)=>{let s={...t.entries};for(let i of r)if(n.has(i))delete s[i];else throw Error(`Key ${i} not found in enum`);return new yx({...t,checks:[],...ke.normalizeParams(o),entries:s})}});function Z(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map((r)=>[r,r])):e;return new yx({type:"enum",entries:n,...ke.normalizeParams(t)})}var Oee=P("ZodLiteral",(e,t)=>{pE.init(e,t),it.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function z(e,t){return new Oee({type:"literal",values:Array.isArray(e)?e:[e],...ke.normalizeParams(t)})}var Pee=P("ZodTransform",(e,t)=>{fE.init(e,t),it.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=(s)=>{if(typeof s==="string")n.issues.push(ke.issue(s,n.value,t));else{let i=s;if(i.fatal)i.continue=!1;i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),i.continue??(i.continue=!0),n.issues.push(ke.issue(i))}};let o=t.transform(n.value,n);if(o instanceof Promise)return o.then((s)=>(n.value=s,n));return n.value=o,n}});function Z0(e){return new Pee({type:"transform",transform:e})}var Y0=P("ZodOptional",(e,t)=>{mE.init(e,t),it.init(e,t),e.unwrap=()=>e._zod.def.innerType});function _t(e){return new Y0({type:"optional",innerType:e})}var Iee=P("ZodNullable",(e,t)=>{hE.init(e,t),it.init(e,t),e.unwrap=()=>e._zod.def.innerType});function j0(e){return new Iee({type:"nullable",innerType:e})}var Dee=P("ZodDefault",(e,t)=>{gE.init(e,t),it.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Lee(e,t){return new Dee({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():t}})}var Mee=P("ZodPrefault",(e,t)=>{_E.init(e,t),it.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Nee(e,t){return new Mee({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():t}})}var J0=P("ZodNonOptional",(e,t)=>{yE.init(e,t),it.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Uee(e,t){return new J0({type:"nonoptional",innerType:e,...ke.normalizeParams(t)})}var Fee=P("ZodCatch",(e,t)=>{bE.init(e,t),it.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function zee(e,t){return new Fee({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}var $ee=P("ZodPipe",(e,t)=>{SE.init(e,t),it.init(e,t),e.in=t.in,e.out=t.out});function bx(e,t){return new $ee({type:"pipe",in:e,out:t})}var jee=P("ZodReadonly",(e,t)=>{EE.init(e,t),it.init(e,t)});function Hee(e){return new jee({type:"readonly",innerType:e})}var Bee=P("ZodLazy",(e,t)=>{xE.init(e,t),it.init(e,t),e.unwrap=()=>e._zod.def.getter()});function Vm(e){return new Bee({type:"lazy",getter:e})}var X0=P("ZodCustom",(e,t)=>{vE.init(e,t),it.init(e,t)});function Kee(e,t){let n=new rn({check:"custom",...ke.normalizeParams(t)});return n._zod.check=e,n}function Q0(e,t){return dx(X0,e??(()=>!0),t)}function Gee(e,t={}){return px(X0,e,t)}function Wee(e,t){let n=Kee((r)=>(r.addIssue=(o)=>{if(typeof o==="string")r.issues.push(ke.issue(o,r.value,n._zod.def));else{let s=o;if(s.fatal)s.continue=!1;s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=n),s.continue??(s.continue=!n._zod.def.abort),r.issues.push(ke.issue(s))}},e(r.value,r)),t);return n}function ot(e,t){return bx(Z0(e),t)}var vr={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"};var Zm={};Xt(Zm,{bigint:()=>Yee,boolean:()=>Zee,date:()=>Jee,number:()=>Vee,string:()=>qee});function qee(e){return y0(Sx,e)}function Vee(e){return v0(Wm,e)}function Zee(e){return w0(Ex,e)}function Yee(e){return A0(B0,e)}function Jee(e){return T0(G0,e)}Ln(wE());var eL={"//":"Hand-maintained baked-in model catalog — the source of truth for per-model provider IDs and metadata. On model launch add one entry to `models` below; `bun run generate:model-catalog` validates this file against the schema and formats it.",schema_version:1,pricing_tiers:{tier_2_10:{input:2,output:10,cache_write_5m:2.5,cache_write_1h:4,cache_read:0.2,web_search:0.01},tier_3_15:{input:3,output:15,cache_write_5m:3.75,cache_write_1h:6,cache_read:0.3,web_search:0.01},tier_5_25:{input:5,output:25,cache_write_5m:6.25,cache_write_1h:10,cache_read:0.5,web_search:0.01},tier_15_75:{input:15,output:75,cache_write_5m:18.75,cache_write_1h:30,cache_read:1.5,web_search:0.01},tier_10_50:{input:10,output:50,cache_write_5m:12.5,cache_write_1h:20,cache_read:1,web_search:0.01},haiku_35:{input:0.8,output:4,cache_write_5m:1,cache_write_1h:1.6,cache_read:0.08,web_search:0.01},haiku_45:{input:1,output:5,cache_write_5m:1.25,cache_write_1h:2,cache_read:0.1,web_search:0.01}},models:[{id:"claude-3-5-haiku",family:"haiku",display_name:"Haiku 3.5",provider_ids:{first_party:"claude-3-5-haiku-20241022",bedrock:"us.anthropic.claude-3-5-haiku-20241022-v1:0",vertex:"claude-3-5-haiku@20241022",foundry:"claude-3-5-haiku",anthropic_aws:"claude-3-5-haiku-20241022",anthropic_google_cloud:null,mantle:null,gateway:"claude-3-5-haiku-20241022"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_3_5_HAIKU",max_output_tokens:{default:8192,upper:8192},pricing:"haiku_35",capabilities:[]},{id:"claude-haiku-4-5",family:"haiku",display_name:"Haiku 4.5",knowledge_cutoff:"February 2025",provider_ids:{first_party:"claude-haiku-4-5-20251001",bedrock:"us.anthropic.claude-haiku-4-5-20251001-v1:0",vertex:"claude-haiku-4-5@20251001",foundry:"claude-haiku-4-5",anthropic_aws:"claude-haiku-4-5-20251001",anthropic_google_cloud:"claude-haiku-4-5-20251001",mantle:"anthropic.claude-haiku-4-5",gateway:"claude-haiku-4-5-20251001"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_HAIKU_4_5",context:{window:200000,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:64000},pricing:"haiku_45",capabilities:["context_management"],advisor_rank:1},{id:"claude-3-5-sonnet",family:"sonnet",display_name:"Sonnet 3.5",provider_ids:{first_party:"claude-3-5-sonnet-20241022",bedrock:"us.anthropic.claude-3-5-sonnet-20241022-v2:0",vertex:"claude-3-5-sonnet-v2@20241022",foundry:"claude-3-5-sonnet",anthropic_aws:"claude-3-5-sonnet-20241022",anthropic_google_cloud:null,mantle:null,gateway:"claude-3-5-sonnet-20241022"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_3_5_SONNET",max_output_tokens:{default:8192,upper:8192},pricing:"tier_3_15",capabilities:[]},{id:"claude-3-7-sonnet",family:"sonnet",display_name:"Sonnet 3.7",provider_ids:{first_party:"claude-3-7-sonnet-20250219",bedrock:"us.anthropic.claude-3-7-sonnet-20250219-v1:0",vertex:"claude-3-7-sonnet@20250219",foundry:"claude-3-7-sonnet",anthropic_aws:"claude-3-7-sonnet-20250219",anthropic_google_cloud:null,mantle:null,gateway:"claude-3-7-sonnet-20250219"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_3_7_SONNET",max_output_tokens:{default:32000,upper:64000},pricing:"tier_3_15",capabilities:[]},{id:"claude-sonnet-4-0",family:"sonnet",display_name:"Sonnet 4",knowledge_cutoff:"January 2025",provider_ids:{first_party:"claude-sonnet-4-20250514",bedrock:"us.anthropic.claude-sonnet-4-20250514-v1:0",vertex:"claude-sonnet-4@20250514",foundry:"claude-sonnet-4",anthropic_aws:"claude-sonnet-4-20250514",anthropic_google_cloud:null,mantle:null,gateway:"claude-sonnet-4-20250514"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_0_SONNET",context:{window:200000,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:64000},pricing:"tier_3_15",capabilities:["context_management"]},{id:"claude-sonnet-4-5",family:"sonnet",display_name:"Sonnet 4.5",knowledge_cutoff:"January 2025",provider_ids:{first_party:"claude-sonnet-4-5-20250929",bedrock:"us.anthropic.claude-sonnet-4-5-20250929-v1:0",vertex:"claude-sonnet-4-5@20250929",foundry:"claude-sonnet-4-5",anthropic_aws:"claude-sonnet-4-5-20250929",anthropic_google_cloud:"claude-sonnet-4-5-20250929",mantle:null,gateway:"claude-sonnet-4-5-20250929"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_5_SONNET",fallback_3p:"claude-sonnet-4-0",context:{window:200000,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:64000},pricing:"tier_3_15",capabilities:["context_management"]},{id:"claude-sonnet-4-6",family:"sonnet",display_name:"Sonnet 4.6",knowledge_cutoff:"August 2025",provider_ids:{first_party:"claude-sonnet-4-6",bedrock:"us.anthropic.claude-sonnet-4-6",vertex:"claude-sonnet-4-6",foundry:"claude-sonnet-4-6",anthropic_aws:"claude-sonnet-4-6",anthropic_google_cloud:"claude-sonnet-4-6",mantle:null,gateway:"claude-sonnet-4-6"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_6_SONNET",fallback_3p:"claude-sonnet-4-5",context:{window:200000,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:128000},pricing:"tier_3_15",capabilities:["effort","max_effort","adaptive_thinking","context_management"],advisor_rank:2},{id:"claude-sonnet-5",family:"sonnet",display_name:"Sonnet 5",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-sonnet-5",bedrock:"us.anthropic.claude-sonnet-5",vertex:"claude-sonnet-5",foundry:"claude-sonnet-5",anthropic_aws:"claude-sonnet-5",anthropic_google_cloud:"claude-sonnet-5",mantle:"anthropic.claude-sonnet-5",gateway:"claude-sonnet-5"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_5_SONNET",fallback_3p:"claude-sonnet-4-6",context:{window:1e6,native_1m:!0,native_1m_3p:{bedrock:!0,vertex:!0,foundry:!0},supports_1m_beta:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_2_10",capabilities:["effort","max_effort","xhigh_effort","adaptive_thinking","mid_conv_system","context_management"],default_effort:"high",effort_cost_index:{low:0.47,medium:0.74,high:1,xhigh:2.41,max:5.59},image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:3},{id:"claude-opus-4-0",family:"opus",display_name:"Opus 4",knowledge_cutoff:"January 2025",provider_ids:{first_party:"claude-opus-4-20250514",bedrock:"us.anthropic.claude-opus-4-20250514-v1:0",vertex:"claude-opus-4@20250514",foundry:"claude-opus-4",anthropic_aws:"claude-opus-4-20250514",anthropic_google_cloud:null,mantle:null,gateway:"claude-opus-4-20250514"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_0_OPUS",context:{window:200000,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:32000},pricing:"tier_15_75",capabilities:["context_management"]},{id:"claude-opus-4-1",family:"opus",display_name:"Opus 4.1",knowledge_cutoff:"January 2025",provider_ids:{first_party:"claude-opus-4-1-20250805",bedrock:"us.anthropic.claude-opus-4-1-20250805-v1:0",vertex:"claude-opus-4-1@20250805",foundry:"claude-opus-4-1",anthropic_aws:"claude-opus-4-1-20250805",anthropic_google_cloud:null,mantle:null,gateway:"claude-opus-4-1-20250805"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_1_OPUS",context:{window:200000,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:32000},pricing:"tier_15_75",capabilities:["context_management"]},{id:"claude-opus-4-5",family:"opus",display_name:"Opus 4.5",knowledge_cutoff:"May 2025",provider_ids:{first_party:"claude-opus-4-5-20251101",bedrock:"us.anthropic.claude-opus-4-5-20251101-v1:0",vertex:"claude-opus-4-5@20251101",foundry:"claude-opus-4-5",anthropic_aws:"claude-opus-4-5-20251101",anthropic_google_cloud:"claude-opus-4-5-20251101",mantle:null,gateway:"claude-opus-4-5-20251101"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_5_OPUS",fallback_3p:"claude-opus-4-1",context:{window:200000,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:64000},pricing:"tier_5_25",capabilities:["context_management"]},{id:"claude-opus-4-6",family:"opus",display_name:"Opus 4.6",knowledge_cutoff:"May 2025",provider_ids:{first_party:"claude-opus-4-6",bedrock:"us.anthropic.claude-opus-4-6-v1",vertex:"claude-opus-4-6",foundry:"claude-opus-4-6",anthropic_aws:"claude-opus-4-6",anthropic_google_cloud:"claude-opus-4-6",mantle:null,gateway:"claude-opus-4-6"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_6_OPUS",fallback_3p:"claude-opus-4-5",context:{window:200000,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_5_25",capabilities:["effort","max_effort","adaptive_thinking","context_management"],advisor_rank:3},{id:"claude-opus-4-7",family:"opus",display_name:"Opus 4.7",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-opus-4-7",bedrock:"us.anthropic.claude-opus-4-7",vertex:"claude-opus-4-7",foundry:"claude-opus-4-7",anthropic_aws:"claude-opus-4-7",anthropic_google_cloud:"claude-opus-4-7",mantle:"anthropic.claude-opus-4-7",gateway:"claude-opus-4-7"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_7_OPUS",fallback_3p:"claude-opus-4-6",context:{window:1e6,native_1m:!0,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_5_25",capabilities:["effort","max_effort","xhigh_effort","adaptive_thinking","context_management"],default_effort:"xhigh",image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:4},{id:"claude-opus-4-8",family:"opus",display_name:"Opus 4.8",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-opus-4-8",bedrock:"us.anthropic.claude-opus-4-8",vertex:"claude-opus-4-8",foundry:"claude-opus-4-8",anthropic_aws:"claude-opus-4-8",anthropic_google_cloud:"claude-opus-4-8",mantle:"anthropic.claude-opus-4-8",gateway:"claude-opus-4-8"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_8_OPUS",fallback_3p:"claude-opus-4-7",context:{window:1e6,native_1m:!0,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_5_25",capabilities:["effort","max_effort","xhigh_effort","adaptive_thinking","mid_conv_system","context_management","fast_mode","lean_prompt"],default_effort:"high",effort_cost_index:{low:0.72,medium:0.9,high:1,xhigh:1.65,max:1.88},image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:4},{id:"claude-opus-5",family:"opus",display_name:"Opus 5",knowledge_cutoff:"May 2026",provider_ids:{first_party:"claude-opus-5",bedrock:"us.anthropic.claude-opus-5",vertex:"claude-opus-5",foundry:"claude-opus-5",anthropic_aws:"claude-opus-5",anthropic_google_cloud:"claude-opus-5",mantle:"anthropic.claude-opus-5",gateway:"claude-opus-5"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_5_OPUS",fallback_3p:"claude-opus-4-8",context:{window:1e6,native_1m:!0,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_5_25",capabilities:["effort","max_effort","xhigh_effort","adaptive_thinking","mid_conv_system","context_management","fast_mode","lean_prompt","refusal_fallback","opus_5_prompt_bundle"],default_effort:"high",effort_cost_index:{low:0.67,medium:0.76,high:1,xhigh:1.6,max:1.7},image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:4},{id:"claude-fable-5",family:"fable",display_name:"Fable 5",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-fable-5",bedrock:"us.anthropic.claude-fable-5",vertex:"claude-fable-5",foundry:"claude-fable-5",anthropic_aws:"claude-fable-5",anthropic_google_cloud:"claude-fable-5",mantle:"anthropic.claude-fable-5",gateway:"claude-fable-5"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_FABLE_5",fallback_3p:"claude-opus-5",context:{window:1e6,native_1m:!0,supports_1m_beta:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_10_50",capabilities:["effort","max_effort","xhigh_effort","adaptive_thinking","rejects_disabled_thinking","mid_conv_system","context_management","lean_prompt","fable_5_mitigations","refusal_fallback"],default_effort:"high",effort_cost_index:{low:0.6,medium:0.77,high:1,xhigh:1.74,max:1.91},image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:5},{id:"claude-mythos-5",family:"mythos",display_name:"Mythos 5",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-mythos-5",bedrock:null,vertex:null,foundry:null,anthropic_aws:null,anthropic_google_cloud:null,mantle:null,gateway:null},context:{window:1e6,native_1m:!0,supports_1m_beta:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_10_50",capabilities:[],image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:5}],aliases:{opus:{default:"claude-opus-5",per_provider:{bedrock:"claude-opus-5",vertex:"claude-opus-5",foundry:"claude-opus-4-6",mantle:"claude-opus-5",anthropic_aws:"claude-opus-5",gateway:"claude-opus-4-7"}},sonnet:{default:"claude-sonnet-5",per_provider:{bedrock:"claude-sonnet-4-5",vertex:"claude-sonnet-4-5",foundry:"claude-sonnet-4-5",mantle:"claude-sonnet-4-5",anthropic_aws:"claude-sonnet-4-6",gateway:"claude-sonnet-4-6"}},haiku:{default:"claude-haiku-4-5"},fable:{default:"claude-fable-5"}},defaults:{},best:"fable",latest_per_family:{fable:"claude-fable-5",opus:"claude-opus-5",sonnet:"claude-sonnet-5",haiku:"claude-haiku-4-5"},alias_migration:{}};class tL{resetters=[];lazy(e){let t;return this.resetters.push(()=>{t=void 0}),()=>t??=e()}reset(){for(let e of this.resetters)e()}}var rte=new tL;function D(e){return rte.lazy(e)}function ote(){return{bakedCatalog:void 0,mainLoopCanonical:void 0,runtimeCapabilityLookup:void 0}}var Tx;function nL(){if(Tx===void 0)Tx=ote();return Tx}var ste=D(()=>A({first_party:g(),bedrock:g().nullish(),vertex:g().nullish(),foundry:g().nullish(),anthropic_aws:g().nullish(),anthropic_google_cloud:g().nullish(),mantle:g().nullish(),gateway:g().nullish()}).loose()),rL=D(()=>A({input:K(),output:K(),cache_write_5m:K().optional(),cache_write_1h:K().optional(),cache_read:K().optional(),web_search:K().optional()}).loose()),ite=D(()=>A({id:g(),family:g(),display_name:g(),slogan:g().optional(),knowledge_cutoff:g().optional(),provider_ids:ste(),eager_input_streaming:A({bedrock:z(!0).optional(),vertex:z(!0).optional()}).loose().optional(),vertex_region_env_var:g().optional(),fallback_3p:g().optional(),context:A({window:K(),native_1m:R().optional(),native_1m_3p:A({bedrock:z(!0).optional(),vertex:z(!0).optional(),foundry:z(!0).optional()}).loose().optional(),supports_1m_beta:R().optional(),supports_1m_suffix:R().optional()}).loose().optional(),max_output_tokens:A({default:K(),upper:K()}).loose().optional(),pricing:ie([g(),rL()]).optional(),capabilities:I(g()).default([]),default_effort:Z(["low","medium","high","xhigh","max"]).optional(),effort_cost_index:A({low:K().positive().optional(),medium:K().positive().optional(),high:K().positive().optional(),xhigh:K().positive().optional(),max:K().positive().optional()}).loose().optional(),image_limits:A({maxWidth:K().optional(),maxHeight:K().optional(),maxBase64Size:K().optional()}).loose().optional(),advisor_rank:K().optional(),fallback_chain:I(g()).optional(),picker:A({section:Z(["main","overflow","deprecated"]).optional(),badge:g().optional(),disabled_reason:g().optional(),tiers:I(g()).optional()}).loose().optional(),deprecation:A({retirement_dates:V(g(),g()).optional(),remapped_to:g().optional()}).loose().optional(),min_cli_version:g().optional()}).loose()),ate=D(()=>A({default:g(),per_provider:V(g(),g()).optional()}).loose()),cte=D(()=>A({schema_version:K(),pricing_tiers:V(g(),rL()).default({}),models:I(ite()),aliases:V(g(),ate()).default({}),defaults:V(g(),g()).default({}),best:g().optional(),latest_per_family:V(g(),g()).default({}),alias_migration:V(g(),g()).default({})}).loose()),lte={schema_version:0,pricing_tiers:{},models:[],aliases:{},defaults:{},latest_per_family:{},alias_migration:{}};function ute(e){let t=cte().safeParse(e),n=t.success?t.data:lte,r=new Map,o=new Map;for(let s of n.models){r.set(s.id,s);for(let i of Object.values(s.provider_ids)){if(typeof i!=="string")continue;let a=i.toLowerCase(),c=o.get(a);if(c!==void 0&&c!==s.id)throw Error("model catalog: provider id collision across distinct entries");o.set(a,s.id)}}return{catalog:n,entriesById:r,catalogIdByProviderId:o}}function dte(){let e=nL();if(e.bakedCatalog===void 0)e.bakedCatalog=ute(eL);return e.bakedCatalog}function oL(){return dte().catalog}function sL(e){return e.replace(/-0$/,"")}Iu();function Ym(){return process.env.CLAUDE_CONFIG_DIR}var jt=Ya(()=>(Ym()??fte(pte(),".claude")).normalize("NFC"),Ym);function aL(e){return iL(jt())===iL(e)}function cL(){return process.env.CLAUDE_CODE_PROJECT_DIR_NAME}var mte=/^[A-Za-z0-9_-]{1,64}$/,hte=/^(?:con|prn|aux|nul|com[0-9]|lpt[0-9])$/i;function kx(e){if(!e||!mte.test(e)||hte.test(e))return;return e}function gte(){return`${Ym()??""}\x00${cL()??""}`}var lL=Ya(()=>Ym()?kx(cL()):void 0,gte);var Z5e=Ya(()=>oL().models.flatMap((e)=>e.vertex_region_env_var&&/^VERTEX_REGION_[A-Z0-9_]+$/.test(e.vertex_region_env_var)?[[sL(e.id),e.vertex_region_env_var]]:[]).sort(([e],[t])=>t.length-e.length||(e<t?-1:e>t?1:0)));var _te=/hooks\.slack\.com\/(?:services|workflows|triggers)\/[A-Za-z0-9/_-]+/gi;var Cx={bearer:[/\bBearer\s+[A-Za-z0-9._~+/=-]{8,}/gi,"Bearer <token>"],basic:[/(:\s*)Basic\s+[A-Za-z0-9+/=]{8,}/gi,"$1Basic <token>"],sk:[/\bsk-[A-Za-z0-9_-]{20,}/g,"<token>"]},yte=[/\bBearer\s{1,512}(?=[A-Za-z0-9._~+/=-]{16})(?:eyJ|(?=[A-Za-z0-9._~+/=-]{0,64}[0-9=]))/i,/:\s{0,512}Basic\s{1,512}(?=[A-Za-z0-9+/=]{16})(?=[A-Za-z0-9+/=]{0,64}[0-9=])/i,/\bsk-(?=[A-Za-z0-9_-]{20})(?=[A-Za-z0-9_-]{0,64}[0-9])/];var X5e=new RegExp(`(?:\\b(?:xox[abe-z](?:\\.xox[a-z])?|xapp|xwfp)-${nc("[A-Za-z0-9+/=%_-]")}|\\bxox[cd]-|(?:xox[abe-z](?:\\.xox[a-z])?|xapp|xwfp)-(?=[0-9])|xox[cd]-${nc("[A-Za-z0-9+/=%_-]")}(?=[A-Za-z0-9+/=%_-]{16}))`,"i"),dL=[[qu("sk-ant-","[A-Za-z0-9_-]",8,uL(8)),"<token>"],[qu("sk-(?:proj|svcacct|admin)-","[A-Za-z0-9_-]",20,uL(20)),"<token>"]],pL=[[/(^|[^A-Za-z0-9+])AKIA[A-Z0-9]{16}(?![A-Za-z0-9+=])/g,"$1<token>"],[/(^|[^A-Za-z0-9+])ASIA[A-Z0-9]{16}(?![A-Za-z0-9+=])/g,"$1<token>"]],fL=[[qu("gh[opusr]_","[A-Za-z0-9]",20,nc("[A-Za-z0-9]")),"<token>"],[/github_pat_[A-Za-z0-9_]{82,}/g,"<token>"],[/sq0(?:atp|csp)-[A-Za-z0-9_-]{22,}/g,"<token>"],[/(^|[^A-Za-z0-9+/])EAAA[A-Za-z0-9+/=%_-]{56,}/g,"$1<token>"],[qu("gl(?:pat|dt|rt|ft|soat|oas|agent|ptt|cbt|imt|ffct)-","[A-Za-z0-9_=-]",20,nc("[A-Za-z0-9_=-]"),"(?:\\.[0-9a-z]{9})?"),"<token>"],[qu("(?:xox[abe-z](?:\\.xox[a-z])?|xapp|xwfp)-","[A-Za-z0-9+/=%_-]",10,"(?=[0-9])","",nc("[A-Za-z0-9+/=%_-]"),"gi"),"<token>"],[new RegExp(`(?:\\bxox[cd]-[A-Za-z0-9+/=%_-]{10,}|xox[cd]-${nc("[A-Za-z0-9+/=%_-]")}[A-Za-z0-9+/=%_-]{16,})`,"gi"),"<token>"],[_te,"hooks.slack.com/<redacted>"]],bte=[/\bey[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/g,"<jwt>"],Ste=/\beyJ(?:[A-Za-z0-9_-]{256}|[A-Za-z0-9_-]{8,2048}\.[A-Za-z0-9_-]{10})/,Ete=[Cx.bearer,Cx.basic,...dL,Cx.sk,...pL],xte=[...fL,bte];function Vu(e){return[...Ete,...xte].reduce((t,[n,r])=>t.replace(n,r),String(e))}var Q5e=[...yte,...[...dL,...pL,...fL].map(([e])=>new RegExp(e.source,e.flags.replaceAll("g",""))),Ste];function qu(e,t,n,r,o="",s="",i="g"){let a=`${t}{${n},}${o}`;return new RegExp(`(?:\\b${e}${s}${a}|${e}${r}${a})`,i)}function nc(e){return`(?=${e}{0,64}[0-9])`}function uL(e){return`(?=[A-Za-z0-9_-]{0,64}?(?=[A-Za-z0-9]{${e}})(?=[A-Za-z0-9]{0,64}[0-9])(?=[A-Za-z0-9]{0,64}[A-Za-z]))`}vv();function GN(e){return e}function Lc(e){return GN(e)}function WN(e){return GN(e)}class Ze extends Error{telemetryMessage;errorClass;constructor(e,t,n){super(e);this.name="TelemetrySafeError",this.telemetryMessage=t??e,this.errorClass=n}}var qN=(e,t)=>{try{if(e!==null&&typeof e==="object"&&!("telemetryMessage"in e)&&Object.isExtensible(e))Object.assign(e,{telemetryMessage:t})}catch{}return e},_n=(e,t)=>{try{if(e!==null&&typeof e==="object"&&Object.isExtensible(e)){let n=e,r=Object.entries(t).filter(([o,s])=>s!==void 0&&!(o in n));Object.assign(n,Object.fromEntries(r))}}catch{}return e};function VN(e){try{if(e!==null&&typeof e==="object"&&"telemetryMessage"in e&&typeof e.telemetryMessage==="string")return e.telemetryMessage}catch{}return}function ZN(e,t){return e instanceof Error&&e.message===t}function Or(e){return e instanceof Error?e:Error(String(e))}function Oo(e){return e instanceof Error?e.message:String(e)}function De(e){if(e&&typeof e==="object"&&"code"in e&&typeof e.code==="string")return e.code;return}function fp(e){let t=De(e);return t&&/^[A-Z][A-Z0-9_]{0,63}$/.test(t)?WN(t):void 0}function pr(e){return De(e)==="ENOENT"}function Ow(e){return De(e)==="EISDIR"}var Fre=new Set(["ENOENT","EACCES","EPERM","ENOTDIR","ELOOP","ENAMETOOLONG","EROFS"]);function Pw(e){return zre(De(e))}function zre(e){return e!==void 0&&Fre.has(e)}import{randomUUID as xIe}from"crypto";import{join as _B}from"path";import{realpathSync as fF}from"fs";import{cwd as Uie}from"process";import{randomUUID as mp}from"crypto";import{createHash as jre,randomBytes as xnt}from"crypto";function Iw(e){return e}var YN="[\\w-]{1,63}",$re=new RegExp(`^${YN}$`),bnt=new RegExp(`^a(?:${YN}-)?[0-9a-f]{16}$`);function JN(e,t){let n=Buffer.from(t.replace(/-/g,""),"hex"),r=jre("sha1").update(n).update(Buffer.from(e,"utf8")).digest();r[6]=r[6]&15|80,r[8]=r[8]&63|128;let o=r.subarray(0,16).toString("hex");return`${o.slice(0,8)}-${o.slice(8,12)}-${o.slice(12,16)}-${o.slice(16,20)}-${o.slice(20,32)}`}var Hre="3ab19d7e-9f35-45c2-926e-75e271cc60b3";function XN(){let e=process.env.CLAUDE_CODE_REMOTE_SESSION_ID?.trim();return e?JN(e,Hre):null}function Bre(){this.__data__=new Es,this.size=0}var QN=Bre;function Kre(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var eU=Kre;function Gre(e){return this.__data__.get(e)}var tU=Gre;function Wre(e){return this.__data__.has(e)}var nU=Wre;var qre=200;function Vre(e,t){var n=this.__data__;if(n instanceof Es){var r=n.__data__;if(!xs||r.length<qre-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new vi(r)}return n.set(e,t),this.size=n.size,this}var rU=Vre;function Mc(e){var t=this.__data__=new Es(e);this.size=t.size}Mc.prototype.clear=QN;Mc.prototype.delete=eU;Mc.prototype.get=tU;Mc.prototype.has=nU;Mc.prototype.set=rU;var zs=Mc;var Zre="__lodash_hash_undefined__";function Yre(e){return this.__data__.set(e,Zre),this}var oU=Yre;function Jre(e){return this.__data__.has(e)}var sU=Jre;function eg(e){var t=-1,n=e==null?0:e.length;this.__data__=new vi;while(++t<n)this.add(e[t])}eg.prototype.add=eg.prototype.push=oU;eg.prototype.has=sU;var iU=eg;function Xre(e,t){var n=-1,r=e==null?0:e.length;while(++n<r)if(t(e[n],n,e))return!0;return!1}var aU=Xre;function Qre(e,t){return e.has(t)}var cU=Qre;var eoe=1,toe=2;function noe(e,t,n,r,o,s){var i=n&eoe,a=e.length,c=t.length;if(a!=c&&!(i&&c>a))return!1;var l=s.get(e),u=s.get(t);if(l&&u)return l==t&&u==e;var p=-1,f=!0,m=n&toe?new iU:void 0;s.set(e,t),s.set(t,e);while(++p<a){var h=e[p],_=t[p];if(r)var y=i?r(_,h,p,t,e,s):r(h,_,p,e,t,s);if(y!==void 0){if(y)continue;f=!1;break}if(m){if(!aU(t,function(S,b){if(!cU(m,b)&&(h===S||o(h,S,n,r,s)))return m.push(b)})){f=!1;break}}else if(!(h===_||o(h,_,n,r,s))){f=!1;break}}return s.delete(e),s.delete(t),f}var tg=noe;var roe=$t.Uint8Array,Nc=roe;function ooe(e){var t=-1,n=Array(e.size);return e.forEach(function(r,o){n[++t]=[o,r]}),n}var lU=ooe;function soe(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var uU=soe;var ioe=1,aoe=2,coe="[object Boolean]",loe="[object Date]",uoe="[object Error]",doe="[object Map]",poe="[object Number]",foe="[object RegExp]",moe="[object Set]",hoe="[object String]",goe="[object Symbol]",_oe="[object ArrayBuffer]",yoe="[object DataView]",dU=vn?vn.prototype:void 0,Dw=dU?dU.valueOf:void 0;function boe(e,t,n,r,o,s,i){switch(n){case yoe:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case _oe:if(e.byteLength!=t.byteLength||!s(new Nc(e),new Nc(t)))return!1;return!0;case coe:case loe:case poe:return xo(+e,+t);case uoe:return e.name==t.name&&e.message==t.message;case foe:case hoe:return e==t+"";case doe:var a=lU;case moe:var c=r&ioe;if(a||(a=uU),e.size!=t.size&&!c)return!1;var l=i.get(e);if(l)return l==t;r|=aoe,i.set(e,t);var u=tg(a(e),a(t),r,o,s,i);return i.delete(e),u;case goe:if(Dw)return Dw.call(e)==Dw.call(t)}return!1}var pU=boe;function Soe(e,t){var n=-1,r=t.length,o=e.length;while(++n<r)e[o+n]=t[n];return e}var Uc=Soe;var Eoe=Array.isArray,Ot=Eoe;function xoe(e,t,n){var r=t(e);return Ot(e)?r:Uc(r,n(e))}var ng=xoe;function voe(e,t){var n=-1,r=e==null?0:e.length,o=0,s=[];while(++n<r){var i=e[n];if(t(i,n,e))s[o++]=i}return s}var fU=voe;function woe(){return[]}var rg=woe;var Aoe=Object.prototype,Toe=Aoe.propertyIsEnumerable,mU=Object.getOwnPropertySymbols,koe=!mU?rg:function(e){if(e==null)return[];return e=Object(e),fU(mU(e),function(t){return Toe.call(e,t)})},og=koe;function Coe(e,t){var n=-1,r=Array(e);while(++n<e)r[n]=t(n);return r}var hU=Coe;function Roe(e){return e!=null&&typeof e=="object"}var kn=Roe;var Ooe="[object Arguments]";function Poe(e){return kn(e)&&sr(e)==Ooe}var Lw=Poe;var gU=Object.prototype,Ioe=gU.hasOwnProperty,Doe=gU.propertyIsEnumerable,Loe=Lw(function(){return arguments}())?Lw:function(e){return kn(e)&&Ioe.call(e,"callee")&&!Doe.call(e,"callee")},Xo=Loe;var ig={};Xt(ig,{default:()=>$s});function Moe(){return!1}var _U=Moe;var SU=typeof ig=="object"&&ig&&!ig.nodeType&&ig,yU=SU&&typeof sg=="object"&&sg&&!sg.nodeType&&sg,Noe=yU&&yU.exports===SU,bU=Noe?$t.Buffer:void 0,Uoe=bU?bU.isBuffer:void 0,Foe=Uoe||_U,$s=Foe;var zoe=9007199254740991,$oe=/^(?:0|[1-9]\d*)$/;function joe(e,t){var n=typeof e;return t=t==null?zoe:t,!!t&&(n=="number"||n!="symbol"&&$oe.test(e))&&(e>-1&&e%1==0&&e<t)}var js=joe;var Hoe=9007199254740991;function Boe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Hoe}var Fc=Boe;var Koe="[object Arguments]",Goe="[object Array]",Woe="[object Boolean]",qoe="[object Date]",Voe="[object Error]",Zoe="[object Function]",Yoe="[object Map]",Joe="[object Number]",Xoe="[object Object]",Qoe="[object RegExp]",ese="[object Set]",tse="[object String]",nse="[object WeakMap]",rse="[object ArrayBuffer]",ose="[object DataView]",sse="[object Float32Array]",ise="[object Float64Array]",ase="[object Int8Array]",cse="[object Int16Array]",lse="[object Int32Array]",use="[object Uint8Array]",dse="[object Uint8ClampedArray]",pse="[object Uint16Array]",fse="[object Uint32Array]",pt={};pt[sse]=pt[ise]=pt[ase]=pt[cse]=pt[lse]=pt[use]=pt[dse]=pt[pse]=pt[fse]=!0;pt[Koe]=pt[Goe]=pt[rse]=pt[Woe]=pt[ose]=pt[qoe]=pt[Voe]=pt[Zoe]=pt[Yoe]=pt[Joe]=pt[Xoe]=pt[Qoe]=pt[ese]=pt[tse]=pt[nse]=!1;function mse(e){return kn(e)&&Fc(e.length)&&!!pt[sr(e)]}var EU=mse;function hse(e){return function(t){return e(t)}}var xU=hse;var cg={};Xt(cg,{default:()=>lg});var vU=typeof cg=="object"&&cg&&!cg.nodeType&&cg,hp=vU&&typeof ag=="object"&&ag&&!ag.nodeType&&ag,gse=hp&&hp.exports===vU,Mw=gse&&km.process,_se=function(){try{var e=hp&&hp.require&&hp.require("util").types;if(e)return e;return Mw&&Mw.binding&&Mw.binding("util")}catch(t){}}(),lg=_se;var wU=lg&&lg.isTypedArray,yse=wU?xU(wU):EU,zc=yse;var bse=Object.prototype,Sse=bse.hasOwnProperty;function Ese(e,t){var n=Ot(e),r=!n&&Xo(e),o=!n&&!r&&$s(e),s=!n&&!r&&!o&&zc(e),i=n||r||o||s,a=i?hU(e.length,String):[],c=a.length;for(var l in e)if((t||Sse.call(e,l))&&!(i&&(l=="length"||o&&(l=="offset"||l=="parent")||s&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||js(l,c))))a.push(l);return a}var ug=Ese;var xse=Object.prototype;function vse(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||xse;return e===n}var $c=vse;function wse(e,t){return function(n){return e(t(n))}}var dg=wse;var Ase=dg(Object.keys,Object),AU=Ase;var Tse=Object.prototype,kse=Tse.hasOwnProperty;function Cse(e){if(!$c(e))return AU(e);var t=[];for(var n in Object(e))if(kse.call(e,n)&&n!="constructor")t.push(n);return t}var TU=Cse;function Rse(e){return e!=null&&Fc(e.length)&&!Wa(e)}var Hs=Rse;function Ose(e){return Hs(e)?ug(e):TU(e)}var pg=Ose;function Pse(e){return ng(e,pg,og)}var Nw=Pse;var Ise=1,Dse=Object.prototype,Lse=Dse.hasOwnProperty;function Mse(e,t,n,r,o,s){var i=n&Ise,a=Nw(e),c=a.length,l=Nw(t),u=l.length;if(c!=u&&!i)return!1;var p=c;while(p--){var f=a[p];if(!(i?f in t:Lse.call(t,f)))return!1}var m=s.get(e),h=s.get(t);if(m&&h)return m==t&&h==e;var _=!0;s.set(e,t),s.set(t,e);var y=i;while(++p<c){f=a[p];var S=e[f],b=t[f];if(r)var x=i?r(b,S,f,t,e,s):r(S,b,f,e,t,s);if(!(x===void 0?S===b||o(S,b,n,r,s):x)){_=!1;break}y||(y=f=="constructor")}if(_&&!y){var v=e.constructor,T=t.constructor;if(v!=T&&(("constructor"in e)&&("constructor"in t))&&!(typeof v=="function"&&v instanceof v&&typeof T=="function"&&T instanceof T))_=!1}return s.delete(e),s.delete(t),_}var kU=Mse;var Nse=Dn($t,"DataView"),fg=Nse;var Use=Dn($t,"Promise"),mg=Use;var Fse=Dn($t,"Set"),hg=Fse;var zse=Dn($t,"WeakMap"),gg=zse;var CU="[object Map]",$se="[object Object]",RU="[object Promise]",OU="[object Set]",PU="[object WeakMap]",IU="[object DataView]",jse=Wo(fg),Hse=Wo(xs),Bse=Wo(mg),Kse=Wo(hg),Gse=Wo(gg),Vi=sr;if(fg&&Vi(new fg(new ArrayBuffer(1)))!=IU||xs&&Vi(new xs)!=CU||mg&&Vi(mg.resolve())!=RU||hg&&Vi(new hg)!=OU||gg&&Vi(new gg)!=PU)Vi=function(e){var t=sr(e),n=t==$se?e.constructor:void 0,r=n?Wo(n):"";if(r)switch(r){case jse:return IU;case Hse:return CU;case Bse:return RU;case Kse:return OU;case Gse:return PU}return t};var Uw=Vi;var Wse=1,DU="[object Arguments]",LU="[object Array]",_g="[object Object]",qse=Object.prototype,MU=qse.hasOwnProperty;function Vse(e,t,n,r,o,s){var i=Ot(e),a=Ot(t),c=i?LU:Uw(e),l=a?LU:Uw(t);c=c==DU?_g:c,l=l==DU?_g:l;var u=c==_g,p=l==_g,f=c==l;if(f&&$s(e)){if(!$s(t))return!1;i=!0,u=!1}if(f&&!u)return s||(s=new zs),i||zc(e)?tg(e,t,n,r,o,s):pU(e,t,c,n,r,o,s);if(!(n&Wse)){var m=u&&MU.call(e,"__wrapped__"),h=p&&MU.call(t,"__wrapped__");if(m||h){var _=m?e.value():e,y=h?t.value():t;return s||(s=new zs),o(_,y,n,r,s)}}if(!f)return!1;return s||(s=new zs),kU(e,t,n,r,o,s)}var NU=Vse;function UU(e,t,n,r,o){if(e===t)return!0;if(e==null||t==null||!kn(e)&&!kn(t))return e!==e&&t!==t;return NU(e,t,n,r,UU,o)}var jc=UU;function Zse(e,t){return jc(e,t)}var FU=Zse;var Yse;function He(){return Yse===!0}Iu();class yg{mergedSettings=null;perSource=new Map;parsedFiles=new Map;policy={};lastPolicyEnvComposition=null;isLoadingFromDisk=!1;autoModeUntrustedSourceWarned=!1;changed=zt();internalWrites=new Map;enabledSources;pluginBase;epoch=0;invalidated=zt();pluginBaseLoaded=!1;primer;userLayer;setPluginBase(e){this.pluginBase=e,this.pluginBaseLoaded=!0}clearPluginBase(){this.pluginBase=void 0}invalidateAll(e){this.epoch++,this.mergedSettings=null,this.perSource.clear(),this.parsedFiles.clear(),this.policy={};let t=this.userLayer;if(this.userLayer=void 0,e?.userLayer==="retain"&&t!==void 0&&He()&&this.primer!==void 0)this.parsedFiles.set(t.path,t.parsed),this.userLayer=t;this.invalidated.emit()}onInvalidate(e){return this.invalidated.subscribe(e)}seedParsedFile(e,t,n,r){if(r!==this.epoch)return!1;let o=this.parsedFiles.get(e);if(this.parsedFiles.set(e,n),o===void 0||!FU(o,n))this.perSource.delete(t),this.mergedSettings=null;return!0}retainUserLayer(e,t){let n={path:e,parsed:t};return this.userLayer=n,()=>{if(this.userLayer===n)this.userLayer=void 0}}}var Jse=new yg;function Fw(e){Jse.invalidateAll(e)}function gp(){return{sent:new Set,rejected:new Set}}class zw{spawner=void 0;pairings=new Map;mainEnsureInFlight=!1;mainSlotBlocked=!1}class $w{#e=gp();#t=new Map;#n=void 0;stickyBetas(){return this.#e}unlatchStickyBetas(){this.#e=gp()}perTurnEffortPins(){return this.#t}atisLatch(){return this.#n}replaceAtisLatch(e){this.#n=e}reset(){this.#e=gp(),this.#t=new Map,this.#n=void 0}}var Xse=1,Qse=2;function eie(e,t,n,r){var o=n.length,s=o,i=!r;if(e==null)return!s;e=Object(e);while(o--){var a=n[o];if(i&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}while(++o<s){a=n[o];var c=a[0],l=e[c],u=a[1];if(i&&a[2]){if(l===void 0&&!(c in e))return!1}else{var p=new zs;if(r)var f=r(l,u,c,e,t,p);if(!(f===void 0?jc(u,l,Xse|Qse,r,p):f))return!1}}return!0}var zU=eie;function tie(e){return e===e&&!Kt(e)}var bg=tie;function nie(e){var t=pg(e),n=t.length;while(n--){var r=t[n],o=e[r];t[n]=[r,o,bg(o)]}return t}var $U=nie;function rie(e,t){return function(n){if(n==null)return!1;return n[e]===t&&(t!==void 0||(e in Object(n)))}}var Sg=rie;function oie(e){var t=$U(e);if(t.length==1&&t[0][2])return Sg(t[0][0],t[0][1]);return function(n){return n===e||zU(n,e,t)}}var jU=oie;var sie="[object Symbol]";function iie(e){return typeof e=="symbol"||kn(e)&&sr(e)==sie}var Hc=iie;var aie=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cie=/^\w*$/;function lie(e,t){if(Ot(e))return!1;var n=typeof e;if(n=="number"||n=="symbol"||n=="boolean"||e==null||Hc(e))return!0;return cie.test(e)||!aie.test(e)||t!=null&&e in Object(t)}var Bc=lie;var uie=500;function die(e){var t=Ya(e,function(r){if(n.size===uie)n.clear();return r}),n=t.cache;return t}var HU=die;var pie=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fie=/\\(\\)?/g,mie=HU(function(e){var t=[];if(e.charCodeAt(0)===46)t.push("");return e.replace(pie,function(n,r,o,s){t.push(o?s.replace(fie,"$1"):r||n)}),t}),BU=mie;function hie(e,t){var n=-1,r=e==null?0:e.length,o=Array(r);while(++n<r)o[n]=t(e[n],n,e);return o}var Eg=hie;var gie=1/0,KU=vn?vn.prototype:void 0,GU=KU?KU.toString:void 0;function WU(e){if(typeof e=="string")return e;if(Ot(e))return Eg(e,WU)+"";if(Hc(e))return GU?GU.call(e):"";var t=e+"";return t=="0"&&1/e==-gie?"-0":t}var qU=WU;function _ie(e){return e==null?"":qU(e)}var VU=_ie;function yie(e,t){if(Ot(e))return e;return Bc(e,t)?[e]:BU(VU(e))}var Bs=yie;var bie=1/0;function Sie(e){if(typeof e=="string"||Hc(e))return e;var t=e+"";return t=="0"&&1/e==-bie?"-0":t}var Po=Sie;function Eie(e,t){t=Bs(t,e);var n=0,r=t.length;while(e!=null&&n<r)e=e[Po(t[n++])];return n&&n==r?e:void 0}var Kc=Eie;function xie(e,t,n){var r=e==null?void 0:Kc(e,t);return r===void 0?n:r}var ZU=xie;function vie(e,t){return e!=null&&t in Object(e)}var YU=vie;function wie(e,t,n){t=Bs(t,e);var r=-1,o=t.length,s=!1;while(++r<o){var i=Po(t[r]);if(!(s=e!=null&&n(e,i)))break;e=e[i]}if(s||++r!=o)return s;return o=e==null?0:e.length,!!o&&Fc(o)&&js(i,o)&&(Ot(e)||Xo(e))}var JU=wie;function Aie(e,t){return e!=null&&JU(e,t,YU)}var xg=Aie;var Tie=1,kie=2;function Cie(e,t){if(Bc(e)&&bg(t))return Sg(Po(e),t);return function(n){var r=ZU(n,e);return r===void 0&&r===t?xg(n,e):jc(t,r,Tie|kie)}}var XU=Cie;function Rie(e){return e}var Gc=Rie;function Oie(e){return function(t){return t==null?void 0:t[e]}}var QU=Oie;function Pie(e){return function(t){return Kc(t,e)}}var eF=Pie;function Iie(e){return Bc(e)?QU(Po(e)):eF(e)}var tF=Iie;function Die(e){if(typeof e=="function")return e;if(e==null)return Gc;if(typeof e=="object")return Ot(e)?XU(e[0],e[1]):jU(e);return tF(e)}var Wc=Die;function Lie(e,t){var n,r=-1,o=e.length;while(++r<o){var s=t(e[r]);if(s!==void 0)n=n===void 0?s:n+s}return n}var nF=Lie;function Mie(e,t){return e&&e.length?nF(e,Wc(t,2)):0}var qc=Mie;class jw{#e=0;#t=0;#n=0;#r=0;#i=Date.now();#a=void 0;#o=0;#l=0;#u=!1;#c={};#s=null;totalCostUSD(){return this.#e}totalAPIDuration(){return this.#t}totalAPIDurationWithoutRetries(){return this.#n}totalToolDuration(){return this.#r}totalDuration(){return Date.now()-this.#i}sessionStartTime(){return this.#a??this.#i}totalLinesAdded(){return this.#o}totalLinesRemoved(){return this.#l}hasUnknownModelCost(){return this.#u}modelUsage(){return this.#c}usageForModel(e){return this.#c[e]}totalInputTokens(){return qc(Object.values(this.#c),"inputTokens")}totalOutputTokens(){return qc(Object.values(this.#c),"outputTokens")}totalCacheReadInputTokens(){return qc(Object.values(this.#c),"cacheReadInputTokens")}totalCacheCreationInputTokens(){return qc(Object.values(this.#c),"cacheCreationInputTokens")}totalWebSearchRequests(){return qc(Object.values(this.#c),"webSearchRequests")}recordApiDuration(e,t){this.#t+=e,this.#n+=t}recordCost(e,t,n){this.#c[n]=t,this.#e+=e}recordToolDuration(e){this.#r+=e}recordLinesChanged(e,t){this.#o+=e,this.#l+=t}markUnknownModelCost(){this.#u=!0}zeroDurationsAndCostForTests(){this.#t=0,this.#n=0,this.#e=0}restartClock(){this.#i=Date.now(),this.anchorLogicalStart(void 0)}anchorLogicalStart(e){this.#a=e===void 0?void 0:Math.min(e,this.#i)}restore({totalCostUSD:e,totalAPIDuration:t,totalAPIDurationWithoutRetries:n,totalToolDuration:r,totalLinesAdded:o,totalLinesRemoved:s,lastDuration:i,startTime:a,modelUsage:c}){if(this.#e=e,this.#t=t,this.#n=n,this.#r=r,this.#o=o,this.#l=s,c)this.#c=c;if(i)this.#i=Date.now()-i;this.anchorLogicalStart(a)}registerSaver(e){this.#s=e}runSaver(e){this.#s?.(e)}reset(){this.#e=0,this.#t=0,this.#n=0,this.#r=0,this.#i=Date.now(),this.anchorLogicalStart(void 0),this.#o=0,this.#l=0,this.#u=!1,this.#c={}}}class Hw{#e=!1;fableConsentSessionFallback(){return this.#e}replaceFableConsentSessionFallback(e){this.#e=e}reset(){this.#e=!1}}class Bw{#e={registeredHooks:null};#t=void 0;#n=void 0;holder(){return this.#e}mainThreadAgentType(){return this.#t}replaceMainThreadAgentType(e){this.#t=e}mainThreadAgentHooks(){return this.#n}replaceMainThreadAgentHooks(e){this.#n=e}reset(){this.#e={registeredHooks:null},this.#t=void 0,this.#n=void 0}}class Kw{#e=new Map;skills(){return this.#e}lookup(e){return this.#e.get(e)}record(e,t){this.#e.set(e,t)}forget(e){this.#e.delete(e)}forgetAll(){this.#e.clear()}reset(){this.#e=new Map}}class Gw{#e=[];#t;#n;#r;approvedServers(){return this.#e}approveServers(e,t){for(let n of t)if(!this.#e.some((r)=>r.name===n&&r.workspaceKey===e))this.#e.push({name:n,workspaceKey:e})}registerClientsAccessor(e){this.#t=e}acquireClientsAccessor(e){if(this.#t)return()=>{};return this.#t=e,()=>{if(this.#t===e)this.#t=void 0}}clientsFromAccessor(){return this.#t?.()}registerConnectedClientWiring(e){this.#n=e}connectedClientWiring(){return this.#n}registerToolsSwapper(e){this.#r=e}acquireToolsSwapper(e){if(this.#r)return()=>{};return this.#r=e,()=>{if(this.#r===e)this.#r=void 0}}swapServerTools(e,t){if(!this.#r)return!1;return this.#r(e,t)}reset(){this.#e=[],this.#t=void 0}}class Ww{#e=void 0;#t=void 0;#n=void 0;#r=void 0;#i=!1;#a=!1;#o=void 0;#l=void 0;mainLoopModelOverride(){return this.#e}overrideMainLoopModel(e){this.#e=e}initialMainLoopModel(){return this.#t}replaceInitialMainLoopModel(e){this.#t=e}resolvedOrgDefault(){return this.#n}replaceResolvedOrgDefault(e){this.#n=e}initialEnvDefaultModel(){return this.#r}replaceInitialEnvDefaultModel(e){this.#r=e}refusalFallbackOccurred(){return this.#i}markRefusalFallbackOccurred(e){this.#i=!0,this.#o??=e}refusalFallbackHeaderArmed(){return this.#a}armRefusalFallbackHeader(e){this.#a=!0,this.#o??=e}refusalFallbackLatchOriginRequestId(){return this.#o}forgetRefusalFallbackOccurred(){this.#i=!1,this.#a=!1,this.#o=void 0}refusalFallbackModelLatch(){return this.#l}replaceRefusalFallbackModelLatch(e){this.#l=e}unlatchRefusalFallbackModel(){this.#l=void 0}reset(){this.#e=void 0,this.#t=void 0,this.#n=void 0,this.#r=void 0,this.#i=!1,this.#a=!1,this.#o=void 0,this.#l=void 0}}class qw{#e=new Map;#t=null;#n=0;#r=null;sections(){return this.#e}recordSection(e,t){this.#e.set(e,t)}forgetAllSections(){this.#e.clear()}noteInvalidation(){this.#n+=1}epoch(){return this.#n}registerWordingLatchClear(e){this.#r=e}clearWordingLatch(){this.#r?.()}lastEmittedDate(){return this.#t}replaceLastEmittedDate(e){this.#t=e}reset(){this.#e=new Map,this.#t=null}}class Vw{#e=null;#t=null;#n=null;#r=null;#i=null;#a=0;#o=void 0;#l=null;#u=null;#c=null;#s=!1;lastAPIRequest(){return this.#e}replaceLastAPIRequest(e){this.#e=e}lastCancelledAPIMessageId(){return this.#t}replaceLastCancelledAPIMessageId(e){this.#t=e}lastAPIRequestMessages(){return this.#n}replaceLastAPIRequestMessages(e){this.#n=e}lastClassifierRequests(){return this.#r}replaceLastClassifierRequests(e){this.#r=e}promptId(){return this.#i}replacePromptId(e){this.#i=e}promptIndex(){return this.#a}replacePromptIndex(e){this.#a=e}incrementPromptIndex(){return this.#a++,this.#a}lastMainRequestId(){return this.#o}replaceLastMainRequestId(e){this.#o=e}lastMainThreadCacheTtlMs(){return this.#l}replaceLastMainThreadCacheTtlMs(e){this.#l=e,this.#u=Date.now()}lastMainThreadRequestAt(){return this.#u}clearLastMainThreadRequest(){this.#l=null,this.#u=null}lastApiCompletionTimestamp(){return this.#c}replaceLastApiCompletionTimestamp(e){this.#c=e}pendingPostCompaction(){return this.#s}replacePendingPostCompaction(e){this.#s=e}reset(){this.#e=null,this.#t=null,this.#n=null,this.#r=null,this.#i=null,this.#a=0,this.#o=void 0,this.#l=null,this.#u=null,this.#c=null,this.#s=!1}}class Zw{#e=[];#t=Object.create(null);#n=null;#r=0;#i=!1;#a=0;tasks(){return this.#e}schedule(e){this.#e.push(e)}replaceTasks(e){this.#e=e}chainStartedAt(e){return this.#t[e]}recordChainStart(e,t){this.#t[e]=t}forgetChainStart(e){delete this.#t[e]}tickInFlightPrompt(){return this.#n}replaceTickInFlightPrompt(e){this.#n=e}consecutiveKeepalives(){return this.#r}replaceConsecutiveKeepalives(e){this.#r=e}ended(){return this.#i}replaceEnded(e){this.#i=e}wakeFires(){return this.#a}recordWakeFire(){this.#a++}resetWakeFires(){this.#a=0}reset(){this.#e=[],this.#t=Object.create(null),this.#n=null,this.#r=0,this.#i=!1,this.#a=0}}class Yw{#e=!1;#t=!1;#n=!1;#r=!1;#i=!1;#a=!1;#o=!1;#l=!1;#u=!1;#c=null;#s=null;#d=null;#p=null;#f=!1;#m=!1;#S=!1;#h=void 0;#b=void 0;#_=null;#y=null;onboardingShownThisSession(){return this.#e}replaceOnboardingShownThisSession(e){this.#e=e}lspRecommendationShownThisSession(){return this.#t}replaceLspRecommendationShownThisSession(e){this.#t=e}sessionTrustAccepted(){return this.#n}replaceSessionTrustAccepted(e){this.#n=e}homeTrustDialogAccepted(){return this.#r}replaceHomeTrustDialogAccepted(e){this.#r=e}hasExitedPlanMode(){return this.#i}replaceHasExitedPlanMode(e){this.#i=e}needsPlanModeExitAttachment(){return this.#a}replaceNeedsPlanModeExitAttachment(e){this.#a=e}needsAutoModeExitAttachment(){return this.#o}replaceNeedsAutoModeExitAttachment(e){this.#o=e}memoryToggledOff(){return this.#l}replaceMemoryToggledOff(e){this.#l=e}backgroundAutoModeSetupInFlight(){return this.#u}replaceBackgroundAutoModeSetupInFlight(e){this.#u=e}deferredToolStubGateLatch(){return this.#c}replaceDeferredToolStubGateLatch(e){this.#c=e}verifySkillRolloutGateLatch(){return this.#s}replaceVerifySkillRolloutGateLatch(e){this.#s=e}commitSkillRolloutGateLatch(){return this.#d}replaceCommitSkillRolloutGateLatch(e){this.#d=e}memoryToolsShapeLatch(){return this.#p}replaceMemoryToolsShapeLatch(e){this.#p=e}proposeGoalAvailabilityLogged(){return this.#f}markProposeGoalAvailabilityLogged(){this.#f=!0}activeRoutine(){return this.#h}replaceActiveRoutine(e){this.#h=e}inheritedTeamName(){return this.#b}replaceInheritedTeamName(e){this.#b=e}teleportedSessionInfo(){return this.#_}replaceTeleportedSessionInfo(e){this.#_=e}markFirstTeleportMessageLogged(){if(this.#_)this.#_.hasLoggedFirstMessage=!0}cachedClaudeMdContent(){return this.#y}replaceCachedClaudeMdContent(e){this.#y=e}accountSkillsSyncEnabled(){return this.#m}replaceAccountSkillsSyncEnabled(e){this.#m=e}skillsSyncVetoed(){return this.#S}replaceSkillsSyncVetoed(e){this.#S=e}reset(){this.#m=!1,this.#S=!1,this.#e=!1,this.#t=!1,this.#n=!1,this.#r=!1,this.#i=!1,this.#a=!1,this.#o=!1,this.#l=!1,this.#u=!1,this.#c=null,this.#s=null,this.#d=null,this.#p=null,this.#f=!1,this.#h=void 0,this.#b=void 0,this.#_=null,this.#y=null}}class Jw{#e=new Map;#t=new Map;#n=null;#r=new Map;#i=new Set;#a=new Set;#o=new Set;#l=new Set;#u=new Set;#c=new Map;#s=new Set;#d=void 0;#p=void 0;planSlugCache(){return this.#e}forgetPlanSlug(e){this.#e.delete(e)}pendingBranchLinks(){return this.#t}replacePendingBranchLinks(){this.#t=new Map}vimSharedState(){return this.#n}replaceVimSharedState(e){this.#n=e}agentColorMap(){return this.#r}sessionCreatedTeams(){return this.#i}surfacedHookSpawnFailures(){return this.#a}bareMcpServerMatchersWarned(){return this.#o}pendingPrLinks(){return this.#l}policyPredicateTelemetryEmitted(){return this.#u}humanAttachmentDigests(){return this.#c}chromeAvailabilityStagesLogged(){return this.#s}replaceChromeAvailabilityStagesLogged(e){if(this.#s=new Set,e)this.#d=Date.now()}chromeAvailabilityAnchorMs(){return this.#d}pendingGoalIdleCheckin(){return this.#p}replacePendingGoalIdleCheckin(e){this.#p=e}reset(){this.#e=new Map,this.#t=new Map,this.#n=null,this.#r=new Map,this.#i=new Set,this.#a=new Set,this.#o=new Set,this.#l=new Set,this.#u=new Set,this.#c=new Map,this.#s=new Set,this.#d=void 0,clearTimeout(this.#p),this.#p=void 0}}var rF={renderTarget:"ink",workspace:"local",canDrive:!0,transcriptSource:"local-jsonl",remote:null};class Xw{#e=!1;#t=void 0;#n=void 0;#r=null;#i=!1;#a=void 0;#o=rF;#l=!1;#u=!1;attacherCapsChanged=zt();rvSupervisorLinkChanged=zt();sdkDialogHostActive(){return this.#e}markSdkDialogHostActive(e){this.#e=e}sdkSupportedDialogKinds(){return this.#t}sdkSupportedDialogKindsSource(){return this.#n}declareDialogKinds(e,t){this.#t=e,this.#n=e===void 0?void 0:t}attacherCaps(){return this.#r}replaceAttacherCaps(e){this.#r=e,this.attacherCapsChanged.emit()}rvSupervisorLinkLive(){return this.#i}replaceRvSupervisorLinkLive(e){if(this.#i===e)return;this.#i=e,this.rvSupervisorLinkChanged.emit()}sdkBetas(){return this.#a}replaceSdkBetas(e){this.#a=e}caps(){return this.#o}replaceCaps(e){this.#o=e}markRemote(e){this.#o={...this.#o,workspace:e?"remote":"local"}}replBridgeActive(){return this.#l}replaceReplBridgeActive(e){if(this.#l===e)return;this.#l=e}mainLoopBusy(){return this.#u}replaceMainLoopBusy(e){this.#u=e}reset(){this.#e=!1,this.#t=void 0,this.#n=void 0,this.#r=null,this.#a=void 0,this.#o=rF,this.#l=!1,this.#u=!1,this.#i=!1,this.attacherCapsChanged.clear(),this.rvSupervisorLinkChanged.clear()}}class Qw{#e=0;#t=null;#n=0;outputTokensAtTurnStart(){return this.#e}budget(){return this.#t}continuationCount(){return this.#n}snapshotForTurn(e,t){this.#e=e,this.#t=t,this.#n=0}incrementContinuation(){this.#n++}reset(){this.#e=0,this.#t=null,this.#n=0}}var oF=150;class eA{#e=Date.now();#t=!1;interactionFired=zt();#n=void 0;terminalFocusFired=zt();#r=!1;#i;lastInteractionTime(){return this.#e}recordInteraction(e){if(e)this.#a();else this.#t=!0}flushIfDirty(){if(this.#t)this.#a()}#a(){this.#e=Date.now(),this.#t=!1,this.interactionFired.emit()}resetBaseline(){this.#e=Date.now(),this.#t=!1}terminalFocus(){return this.#n}updateTerminalFocus(e){this.#n=e,this.terminalFocusFired.emit()}scrollDraining(){return this.#r}markScrollActivity(){if(this.#r=!0,this.#i)clearTimeout(this.#i);this.#i=setTimeout(()=>{this.#r=!1,this.#i=void 0},oF),this.#i.unref?.()}async waitForScrollIdle(){while(this.#r)await new Promise((e)=>setTimeout(e,oF))}reset(){this.#e=Date.now(),this.#n=void 0,this.interactionFired.clear(),this.terminalFocusFired.clear()}}var Nie=["sdk_single_prompt_gate","subagent_estimate","subagent_final_turn"];class tA{byAgent=new Map;attemptsByAgent=new Map;cappedFailuresByAgent=new Map;armGateEventEmitted=new Set;sidecarIo=Promise.resolve();rehydrateAttemptedSessions=new Set;sidecarReadsAhead=new Map;get(e){return this.byAgent.get(e)}has(e){return this.byAgent.has(e)}put(e,t){this.byAgent.set(e,t)}remove(e){this.byAgent.delete(e)}nextAttemptNumber(e){let t=(this.attemptsByAgent.get(e)??0)+1;return this.attemptsByAgent.set(e,t),t}consecutiveCountedFailures(e){return this.cappedFailuresByAgent.get(e)??0}recordCountedFailure(e){let t=(this.cappedFailuresByAgent.get(e)??0)+1;return this.cappedFailuresByAgent.set(e,t),t}clearCountedFailures(e){this.cappedFailuresByAgent.delete(e)}latchArmGateEvent(e){if(this.armGateEventEmitted.has(e))return!1;return this.armGateEventEmitted.add(e),!0}enqueueSidecarIo(e,t){return this.sidecarIo=this.sidecarIo.then(e,e).catch(t),this.sidecarIo}sidecarIoSettled(){return this.sidecarIo}hasAttemptedRehydrate(e){return this.rehydrateAttemptedSessions.has(e)}markRehydrateAttempted(e){this.rehydrateAttemptedSessions.add(e)}keepSidecarReadAhead(e,t){this.sidecarReadsAhead.delete(e);while(this.sidecarReadsAhead.size>=8){let n=this.sidecarReadsAhead.keys().next().value;if(n===void 0)break;this.sidecarReadsAhead.delete(n)}this.sidecarReadsAhead.set(e,t)}takeSidecarReadAhead(e){let t=this.sidecarReadsAhead.get(e);return this.sidecarReadsAhead.delete(e),t}dropSidecarReadAhead(e){this.sidecarReadsAhead.delete(e)}forgetSubagentTelemetry(e){this.attemptsByAgent.delete(e),this.cappedFailuresByAgent.delete(e);for(let t of Nie)this.armGateEventEmitted.delete(`${e}:${t}`)}}class nA{#e=null;#t=null;mainAgentId(e){return this.#e??=Iw(e),this.#e}projectDir(){return this.#t}replaceProjectDir(e){this.#t=e}}class rA{granted=!1;isGranted(){return this.granted}grant(){this.granted=!0}}class oA{inFlight=null;startedForTurnEnd=!1;reset(){this.inFlight?.abort(),this.inFlight=null,this.startedForTurnEnd=!1}}class sA{firstSyncPromise=null;syncErrors=[];pendingTrashRemovals=[]}class iA{abortController=null;reset(){this.abortController?.abort(),this.abortController=null}}class aA{#e=void 0;#t=void 0;ccrSessionID(){return this.#e}latchCcrSessionID(e){this.#e=e}syncEnabled(){return this.#t}latchSyncEnabled(e){return this.#t=e,e}}class cA{autonomousPreambleDelivered=!1;lastLoopFileDelivered=null;reset(){this.autonomousPreambleDelivered=!1,this.lastLoopFileDelivered=null}}class lA{exchanges=[];replace(e){this.exchanges=e}append(e,t,n){this.exchanges=[...this.exchanges,{question:e,response:t,...n&&{fallbackNotice:n}}].slice(-20)}}class uA{pending=null;shownThisSession=!1;changed=zt();subscribe=this.changed.subscribe;getSnapshot=()=>this.pending;offer(e){if(this.shownThisSession)return;this.pending=e,this.changed.emit()}dismiss(){if(this.pending!==null)this.pending=null,this.changed.emit()}markShown(){this.shownThisSession=!0}}class dA{lastEmittedAt=new Map;shouldEmit(e,t,n){let r=this.lastEmittedAt.get(e)||0;if(t-r<n)return!1;if(this.lastEmittedAt.size>=100){let o=this.lastEmittedAt.keys().next().value;if(o!==void 0)this.lastEmittedAt.delete(o)}return this.lastEmittedAt.set(e,t),!0}}class pA{pathsByToolUse=new Map;stash(e,t,n){if(e===void 0)return;let r=sF(e,t),o=this.pathsByToolUse.get(r);if(o!==void 0){let s=new Set(n);this.pathsByToolUse.set(r,o.filter((i)=>s.has(i)));return}if(this.pathsByToolUse.size>=256){let s=this.pathsByToolUse.keys().next().value;if(s!==void 0)this.pathsByToolUse.delete(s)}this.pathsByToolUse.set(r,n)}consume(e,t){if(e===void 0)return;let n=this.pathsByToolUse.get(sF(e,t)),r=`${e}\x00`;for(let o of this.pathsByToolUse.keys())if(o.startsWith(r))this.pathsByToolUse.delete(o);return n}}function sF(e,t){return`${e}\x00${t}`}function iF(e){return aF({kind:"root",host:e.host,id:e.id,parentId:e.parentId},e.project)}function aF(e,t){let n=ct(t.originalCwd),r=ct(t.projectRoot),o=ct(t.cwd),s=zt(),i=e.kind==="fork"?e.root.observers:new zw,a=e.kind==="fork"?e.root.autonomousLoopPreamble:new cA,c=e.kind==="fork"?e.root.precompute:new tA,l={get originalCwd(){return n},get projectRoot(){return r},get cwd(){return o}},u={host:e.kind==="fork"?e.root.host:e.host,get id(){return e.kind==="fork"?e.root.id:e.id},get parentId(){return e.kind==="fork"?e.root.parentId:e.parentId},get root(){return e.kind==="fork"?e.root:u},project:l,observers:i,autonomousLoopPreamble:a,btwHistory:e.kind==="fork"?e.root.btwHistory:new lA,ccrRecap:e.kind==="fork"?e.root.ccrRecap:new oA,conversationLatches:e.kind==="fork"?e.root.conversationLatches:new $w,costLedger:e.kind==="fork"?e.root.costLedger:new jw,fableConsentSlots:e.kind==="fork"?e.root.fableConsentSlots:new Hw,hookRegistry:e.kind==="fork"?e.root.hookRegistry:new Bw,identity:e.kind==="fork"?e.root.identity:new nA,invokedSkills:e.kind==="fork"?e.root.invokedSkills:new Kw,mcpSessionWiring:e.kind==="fork"?e.root.mcpSessionWiring:new Gw,modelSelection:e.kind==="fork"?e.root.modelSelection:new Ww,promptAssembly:e.kind==="fork"?e.root.promptAssembly:new qw,promptSuggestion:e.kind==="fork"?e.root.promptSuggestion:new iA,pendingHint:e.kind==="fork"?e.root.pendingHint:new uA,pluginsSync:e.kind==="fork"?e.root.pluginsSync:new sA,precompute:c,requestJournal:e.kind==="fork"?e.root.requestJournal:new Vw,sessionCron:e.kind==="fork"?e.root.sessionCron:new Zw,sessionFlags:e.kind==="fork"?e.root.sessionFlags:new Yw,sessionRefsGate:e.kind==="fork"?e.root.sessionRefsGate:new aA,sessionScratch:e.kind==="fork"?e.root.sessionScratch:new Jw,surfaceCapabilities:e.kind==="fork"?e.root.surfaceCapabilities:new Xw,toolProgressThrottle:e.kind==="fork"?e.root.toolProgressThrottle:new dA,turnBudget:e.kind==="fork"?e.root.turnBudget:new Qw,userPresence:e.kind==="fork"?e.root.userPresence:new eA,workflowUsageConsent:e.kind==="fork"?e.root.workflowUsageConsent:new rA,writePermissionStash:e.kind==="fork"?e.root.writePermissionStash:new pA,subscribe(p){let f=s.subscribe(p);if(e.kind!=="fork")return f;let m=e.root,h=m.id,_=m.parentId,y=m.subscribe(()=>{if(m.id===h&&m.parentId===_)return;h=m.id,_=m.parentId,p()});return()=>{f(),y()}},setCwd(p){u.update({project:{cwd:p}})},withProject(p){return aF({kind:"fork",root:u.root},{originalCwd:p.originalCwd??n,projectRoot:p.projectRoot??r,cwd:p.cwd??o})},update(p){let f=!1;if(p.id!==void 0||"parentId"in p){if(e.kind==="fork")throw Error("A withProject fork cannot re-identify the session — update the root session instead");if(p.id!==void 0&&p.id!==e.id)e.id=p.id,f=!0;if("parentId"in p&&p.parentId!==e.parentId)e.parentId=p.parentId,f=!0}let m=p.project;if(m){if(m.originalCwd!==void 0){let h=ct(m.originalCwd);if(h!==n)n=h,f=!0}if(m.projectRoot!==void 0){let h=ct(m.projectRoot);if(h!==r)r=h,f=!0}if(m.cwd!==void 0){let h=ct(m.cwd);if(h!==o)o=h,f=!0}}if(f)s.emit()}};return u}class fA{#e=!1;#t=null;#n=!1;#r=void 0;#i=!1;#a=!1;#o=!1;#l=void 0;#u=!1;#c="cli";#s="fresh";#d=void 0;#p=[];#f=!1;#m=!1;#S=!1;#h=!1;#b=!1;#_=!1;#y=!1;#x=!1;#A=!1;#E=!1;#O=null;#T=!1;#v=!1;#P={};isInteractive(){return this.#e}replaceIsInteractive(e){this.#e=e}printOutputFormat(){return this.#t}replacePrintOutputFormat(e){this.#t=e}thinkingDisplayExplicit(){return this.#n}replaceThinkingDisplayExplicit(e){this.#n=e}permissionPromptToolName(){return this.#r}replacePermissionPromptToolName(e){this.#r=e}hasStreamingInput(){return this.#i}replaceHasStreamingInput(e){this.#i=e}singleShotPrintSession(){return this.#a}replaceSingleShotPrintSession(e){this.#a=e}modelOverrideOptOutForSession(){return this.#o}replaceModelOverrideOptOutForSession(e){this.#o=e}rendererMode(){return this.#l}replaceRendererMode(e){this.#l=e}strictToolResultPairing(){return this.#u}replaceStrictToolResultPairing(e){this.#u=e}clientType(){return this.#c}replaceClientType(e){this.#c=e}sessionStartType(){return this.#s}replaceSessionStartType(e){this.#s=e}questionPreviewFormat(){return this.#d}replaceQuestionPreviewFormat(e){this.#d=e}replConfigArgv(){return this.#p}replaceReplConfigArgv(e){this.#p=e}userMsgOptIn(){return this.#f}replaceUserMsgOptIn(e){this.#f=e}searchToolsOptIn(){return this.#m}replaceSearchToolsOptIn(e){this.#m=e}todoToolsOptIn(){return this.#S}replaceTodoToolsOptIn(e){this.#S=e}wizardOperatorToolsEnabled(){return this.#h}replaceWizardOperatorToolsEnabled(e){this.#h=e}pollEventIngressWired(){return this.#b}markPollEventIngressWired(){this.#b=!0}sdkAgentProgressSummariesEnabled(){return this.#_}replaceSdkAgentProgressSummariesEnabled(e){this.#_=e}sessionPersistenceDisabled(){return this.#y}replaceSessionPersistenceDisabled(e){this.#y=e}sessionBypassPermissionsMode(){return this.#x}replaceSessionBypassPermissionsMode(e){this.#x=e}disableSlashCommands(){return this.#A}replaceDisableSlashCommands(e){this.#A=e}scheduledTasksEnabled(){return this.#E}replaceScheduledTasksEnabled(e){this.#E=e}initJsonSchema(){return this.#O}replaceInitJsonSchema(e){this.#O=e}cliSessionConfigCarried(){return this.#T}replaceCliSessionConfigCarried(e){this.#T=e}forkRestrictedLaunchConfig(){return this.#v}replaceForkRestrictedLaunchConfig(e){this.#v=e}forkReplayLaunchConfig(){return this.#P}replaceForkReplayLaunchConfig(e){this.#P=e}reset(){this.#e=!1,this.#t=null,this.#n=!1,this.#r=void 0,this.#i=!1,this.#a=!1,this.#o=!1,this.#l=void 0,this.#u=!1,this.#c="cli",this.#s="fresh",this.#d=void 0,this.#p=[],this.#f=!1,this.#m=!1,this.#S=!1,this.#h=!1,this.#b=!1,this.#_=!1,this.#y=!1,this.#x=!1,this.#A=!1,this.#E=!1,this.#O=null,this.#T=!1,this.#v=!1,this.#P={}}}class mA{#e=void 0;#t=void 0;#n=void 0;#r=null;#i=null;#a=!1;#o=cF();#l=!1;flagSettingsPath(){return this.#e}replaceFlagSettingsPath(e){this.#e=e}flagSettingsExpectedContent(){return this.#t}replaceFlagSettingsExpectedContent(e){this.#t=e}flagSettingsFilePinnedContent(){return this.#n}replaceFlagSettingsFilePinnedContent(e){this.#n=e}flagSettingsInline(){return this.#r}replaceFlagSettingsInline(e){this.#r=e}parentManagedSettings(){return this.#i}replaceParentManagedSettings(e){this.#i=e}parentManagedSettingsInvalid(){return this.#a}replaceParentManagedSettingsInvalid(e){this.#a=e}allowedSettingSources(){return this.#o}replaceAllowedSettingSources(e){this.#o=e}useCoworkPlugins(){return this.#l}replaceUseCoworkPlugins(e){this.#l=e}reset(){this.#e=void 0,this.#t=void 0,this.#n=void 0,this.#r=null,this.#i=null,this.#a=!1,this.#o=cF(),this.#l=!1}}function cF(){return["userSettings","projectSettings","localSettings","flagSettings","policySettings"]}class hA{#e=[];#t=[];#n=[];#r=[];#i=[];#a=[];#o=!1;#l=void 0;#u=void 0;#c=void 0;inlinePlugins(){return this.#e}replaceInlinePlugins(e){this.#e=e}inlinePluginsNoMcp(){return this.#t}replaceInlinePluginsNoMcp(e){this.#t=e}inlinePluginUrls(){return this.#n}replaceInlinePluginUrls(e){this.#n=e}syncedPluginDirs(){return this.#r}replaceSyncedPluginDirs(e){this.#r=e}additionalDirectoriesForClaudeMd(){return this.#i}replaceAdditionalDirectoriesForClaudeMd(e){this.#i=e}allowedChannels(){return this.#a}replaceAllowedChannels(e){this.#a=e}hasDevChannels(){return this.#o}replaceHasDevChannels(e){this.#o=e}sessionSkillAllowlist(){return this.#l}replaceSessionSkillAllowlist(e){this.#l=e}chromeFlagOverride(){return this.#u}replaceChromeFlagOverride(e){this.#u=e}teammateAgentId(){return this.#c}replaceTeammateAgentId(e){this.#c=e}reset(){this.#e=[],this.#t=[],this.#n=[],this.#r=[],this.#i=[],this.#a=[],this.#o=!1,this.#l=void 0,this.#u=void 0,this.#c=void 0}}class gA{#e=null;#t=null;modelStrings(){return this.#e}replaceModelStrings(e){this.#e=e}invalidate(){this.#e=null}admin3PSteeringSnapshot(){return this.#t}recordAdmin3PSteeringSnapshot(e){this.#t=e}reset(){this.#e=null,this.#t=null}}var lF=[];class _A{#e=[];#t=[];errorLog(){return this.#e}recordError(e){if(this.#e.length>=100)this.#e.shift();this.#e.push(e)}recordSlowOperation(e,t){return}slowOperations(){if(this.#t.length===0)return lF;let e=Date.now();if(this.#t.some((t)=>e-t.timestamp>=1e4)){if(this.#t=this.#t.filter((t)=>e-t.timestamp<1e4),this.#t.length===0)return lF}return this.#t}reset(){this.#e=[],this.#t=[]}}function uF(){return{rateTokens:null,rateLastRefillMs:null,featureOkLogged:!1,reportedDropReasons:new Set}}class yA{#e=null;#t=null;#n=null;#r=null;#i=null;#a=null;#o=null;#l=null;#u=null;#c=null;#s=null;#d=null;#p=null;#f=[];#m=null;#S=uF();#h=null;#b=null;#_=null;#y={direct:null,proxied:null};installMeter(e,t,{omitUnits:n=!1}={}){this.#e=e;let r=(o)=>n?void 0:o;this.#t=t("claude_code.session.count",{description:"Count of CLI sessions started"}),this.#n=t("claude_code.lines_of_code.count",{description:"Count of lines of code modified, with the 'type' attribute indicating whether lines were added or removed and the 'model' attribute indicating which model made the change"}),this.#r=t("claude_code.pull_request.count",{description:"Number of pull requests created"}),this.#i=t("claude_code.commit.count",{description:"Number of git commits created"}),this.#a=t("claude_code.cost.usage",{description:"Cost of the Claude Code session",unit:r("USD")}),this.#o=t("claude_code.token.usage",{description:"Number of tokens used",unit:r("tokens")}),this.#l=t("claude_code.code_edit_tool.decision",{description:"Count of code editing tool permission decisions (accept/reject) for Edit, Write, and NotebookEdit tools"}),this.#u=t("claude_code.active_time.total",{description:"Total active time in seconds",unit:r("s")})}meter(){return this.#e}sessionCounter(){return this.#t}locCounter(){return this.#n}prCounter(){return this.#r}commitCounter(){return this.#i}costCounter(){return this.#a}tokenCounter(){return this.#o}codeEditToolDecisionCounter(){return this.#l}activeTimeCounter(){return this.#u}statsStore(){return this.#c}replaceStatsStore(e){this.#c=e}loggerProvider(){return this.#s}replaceLoggerProvider(e){this.#s=e}eventLogger(){return this.#d}eventLoggerOwner(){return this.#p}attachEventLogger(e,t){if(this.#d=e,this.#p=e?t:null,!e)return;let n=this.#f;if(this.#f=null,n)for(let r of n)e.emit(r)}bufferPendingEvent(e){if(this.#f===null||this.#f.length>=100)return!1;return this.#f.push(e),!0}closeWindow(e){this.#f=null,this.#m=e}windowCloseCause(){return this.#m}isWindowOpen(){return this.#f!==null}hostOtel(){return this.#S}meterProvider(){return this.#h}replaceMeterProvider(e){this.#h=e}tracerProvider(){return this.#b}replaceTracerProvider(e){this.#b=e}cachedTelemetryResource(){return this.#_}replaceCachedTelemetryResource(e){this.#_=e}cachedOtlpHttpAgentFactory(e){return this.#y[e?"proxied":"direct"]}replaceCachedOtlpHttpAgentFactory(e,t){this.#y[e?"proxied":"direct"]=t}reset(){this.#e=null,this.#t=null,this.#n=null,this.#r=null,this.#i=null,this.#a=null,this.#o=null,this.#l=null,this.#u=null,this.#c=null,this.#s=null,this.#d=null,this.#p=null,this.#f=[],this.#m=null,this.#S=uF(),this.#h=null,this.#b=null,this.#_=null,this.#y={direct:null,proxied:null}}}class bA{#e=void 0;#t=void 0;#n=!1;#r=void 0;#i=void 0;#a=null;#o=null;#l=0;#u=!1;#c=null;#s=void 0;#d=null;#p=null;sessionIngressToken(){return this.#e}replaceSessionIngressToken(e){this.#e=e}oauthTokenFromFd(){return this.#t}replaceOauthTokenFromFd(e){this.#t=e}oauthTokenFromBgSnapshot(){return this.#n}replaceOauthTokenFromBgSnapshot(e){this.#n=e}oauthScopesFromFd(){return this.#r}replaceOauthScopesFromFd(e){this.#r=e}apiKeyFromFd(){return this.#i}replaceApiKeyFromFd(e){this.#i=e}resetFdCredentialState(){this.#e=void 0,this.#t=void 0,this.#n=!1,this.#r=void 0,this.#i=void 0}gatewayAuth(){return this.#a}replaceGatewayAuth(e){this.#a=e}gatewayServerProcess(){return this.#u}replaceGatewayServerProcess(e){this.#u=e}authenticatedAccount(){return this.#o}authenticatedAccountEpoch(){return this.#l}stampAuthenticatedAccount(e){let t=this.#o;if(e!==null&&t!==null&&e.accountUuid===t.accountUuid&&e.emailAddress===t.emailAddress&&e.organizationUuid===t.organizationUuid)return;this.#l+=1,this.#o=e}startupPolicySnapshot(){return this.#s}replaceStartupPolicySnapshot(e){this.#s=e}gatewayRefreshInFlight(){return this.#c}replaceGatewayRefreshInFlight(e){this.#c=e}sdkOAuthTokenRefreshCallback(){return this.#d}replaceSdkOAuthTokenRefreshCallback(e){this.#d=e}hostAuthTokenRefreshCallback(){return this.#p}replaceHostAuthTokenRefreshCallback(e){this.#p=e}resetForTests(){this.#e=null,this.#t=null,this.#n=!1,this.#r=void 0,this.#i=null,this.#a=null,this.#o=null,this.#l=0,this.#u=!1,this.#c=null,this.#s=void 0,this.#d=null,this.#p=null}}class SA{#e=void 0;#t=!1;#n=!1;#r;directConnectServerUrl(){return this.#e}replaceDirectConnectServerUrl(e){this.#e=e}connectNonBlocking(){return this.#t}replaceConnectNonBlocking(e){this.#t=e}strictConfig(){return this.#n}replaceStrictConfig(e){this.#n=e}registerEnsureConnectedClient(e){this.#r=e}ensureConnectedClient(){return this.#r}reset(){this.#e=void 0,this.#t=!1,this.#n=!1}}class EA{#e=null;#t=new Map;#n=new Map;#r=new Set;#i=!1;#a=!1;#o=new Map;#l=new Map;promptCache1hAllowlist(){return this.#e}replacePromptCache1hAllowlist(e){this.#e=e}thinkingTypeOverrides(){return this.#t}recordThinkingTypeOverride(e,t){this.#t.set(e,t)}servedModelsByRequestedModel(){return this.#n}recordServedModels(e,t){this.#n.set(e,t)}effortUnsupportedModels(){return this.#r}markEffortUnsupported(e){this.#r.add(e)}midConvCachePromotionRejected(){return this.#i}markMidConvCachePromotionRejected(){this.#i=!0}perTurnEffortOkEmitted(){return this.#a}markPerTurnEffortOkEmitted(){this.#a=!0}inferenceProfileBackingModels(){return this.#o}recordInferenceProfileBackingModel(e,t){this.#o.set(e,t)}foundryDeploymentCapabilities(){return this.#l}reset(){this.#e=null,this.#t=new Map,this.#n=new Map,this.#r=new Set,this.#i=!1,this.#a=!1,this.#o=new Map,this.#l=new Map}}class xA{#e=!1;#t=!1;longContext1mCreditsBlocked(){return this.#e}replaceLongContext1mCreditsBlocked(e){this.#e=e}fableCreditsRequired(){return this.#t}replaceFableCreditsRequired(e){this.#t=e}reset(){this.#e=!1,this.#t=!1}}class vA{#e=!1;#t=!1;#n=dF;#r=zt();selectorGate(){return this.#e}selectorGateEverOn(){return this.#t}replaceSelectorGate(e){this.#e=e,this.#t||=e}inheritSelectorGateEverOn(){this.#t=!0}resampleSelectorGate(e){let t=this.#e;if(this.#e=e,this.#t||=e,t!==e)this.#r.emit(e)}subscribeSelectorGateChanged(e){return this.#r.subscribe(e)}replaceHostGateSubscription(e){let t=this.#n;this.#n=e,t()}dropHostGateSubscription(){this.replaceHostGateSubscription(dF)}}function dF(){}class wA{started=!1;stagingReaped=!1;claim(){if(this.started)return!1;return this.started=!0,!0}claimStagingReap(){if(this.stagingReaped)return!1;return this.stagingReaped=!0,!0}}class AA{backgroundHousekeeping;launchOptions;settingsSource;extensionsConfig;modelStringsCache;diagnostics;telemetryHandles;credentialSlots;mcpProcessWiring;requestLatches;accountCreditLatches;proactivity;constructor(e){this.backgroundHousekeeping=e.backgroundHousekeeping,this.launchOptions=e.launchOptions,this.settingsSource=e.settingsSource,this.extensionsConfig=e.extensionsConfig,this.modelStringsCache=e.modelStringsCache,this.diagnostics=e.diagnostics,this.telemetryHandles=e.telemetryHandles,this.credentialSlots=e.credentialSlots,this.mcpProcessWiring=e.mcpProcessWiring,this.requestLatches=e.requestLatches,this.accountCreditLatches=e.accountCreditLatches,this.proactivity=e.proactivity}}function pF(){return new AA({backgroundHousekeeping:new wA,launchOptions:new fA,settingsSource:new mA,extensionsConfig:new hA,modelStringsCache:new gA,diagnostics:new _A,telemetryHandles:new yA,credentialSlots:new bA,mcpProcessWiring:new SA,requestLatches:new EA,accountCreditLatches:new xA,proactivity:new vA})}function Fie(){let e="";if(typeof process<"u"&&typeof process.cwd==="function"&&typeof fF==="function"){let t=Uie();try{e=mF(fF(t))}catch{e=mF(t)}}return iF({host:pF(),id:XN()??mp(),project:{originalCwd:e,projectRoot:e,cwd:e}})}var hF=Fie();function Nt(){return hF}var zie=()=>{return};function TA(){return zie()?.sessionId??hF.id}var $ie=zt(),Pct=$ie.subscribe;function mF(e){return process.platform==="darwin"?e.normalize("NFC"):e}var jie=zt(),Ict=jie.subscribe;class ft{#e;#t=new WeakMap;constructor(e){this.#e=e}of(e){let t=this.#t.get(e);if(t!==void 0)return t;let n=this.#e();return this.#t.set(e,n),n}}import{AsyncLocalStorage as dae}from"async_hooks";import{constants as pae}from"fs";import{appendFile as fae,copyFile as mae,lstat as hae,mkdir as gae,open as EF,readdir as xF,readFile as vF,stat as _ae,unlink as yae,writeFile as PA}from"fs/promises";import{randomBytes as Hie}from"crypto";import{closeSync as Uct,constants as yn,fchmodSync as Fct,fstatSync as zct,ftruncateSync as $ct,lstatSync as jct,openSync as Hct,readFileSync as Bct,renameSync as Kct,unlinkSync as Gct,writeFileSync as Wct}from"fs";import{lstat as CA,open as Ag,rename as Bie,stat as Kie,unlink as wg,writeFile as Gie}from"fs/promises";var Wie=new Set(["EXDEV","EPERM","EEXIST","EBUSY"]),qie=new Set(["EPERM","EBUSY","EACCES"]);function Vie(e){return`${e}.tmp.${Hie(4).toString("hex")}`}var Zie=4,Yie=50,Yct=new Int32Array(new SharedArrayBuffer(4));function Jie(e,t){if(process.platform!=="win32")return!1;let n=De(e);return n!==void 0&&qie.has(n)&&t<Zie-1}var Xie=128;async function Qie(e){try{return((await CA(e)).mode&Xie)===0}catch{return!1}}async function eae(e,t){let n=!1;for(let r=0;;r++)try{return await e(),n}catch(o){if(Jie(o,r)){if(r===0&&t!==void 0&&await Qie(t))throw o;n=!0,await Hr(Yie);continue}throw o}}function tae(e,t,n=Bie){return eae(()=>n(e,t),t)}var nae=67108864,RA=process.platform==="win32"?0:yn.O_NONBLOCK;async function _F(e,t,n=process.platform){if(n!=="win32")return!0;try{return(await CA(e)).isFile()}catch(r){return t&&De(r)==="ENOENT"}}async function rae(e,t=!1){if(!t&&!await _F(e,!0))return{kind:"unavailable"};let n;try{n=await Ag(e,process.platform==="win32"?yn.O_RDONLY:yn.O_RDONLY|(t?0:yn.O_NOFOLLOW)|RA)}catch(r){return De(r)==="ENOENT"?{kind:"absent"}:{kind:"unavailable"}}try{let r=await n.stat();if(!r.isFile()||r.size>nae)return{kind:"unavailable"};return{kind:"snapshot",bytes:new Uint8Array(await n.readFile()),mode:r.mode&4095}}catch{return{kind:"unavailable"}}finally{await n.close().catch(()=>{})}}async function oae(e,t,n=!1){if(!n&&!await _F(e,!0))return!1;let r;try{r=await Ag(e,process.platform==="win32"?"w":yn.O_WRONLY|yn.O_CREAT|yn.O_TRUNC|(n?0:yn.O_NOFOLLOW)|RA,t.mode)}catch{return!1}try{if(!(await r.stat()).isFile())return await r.close().catch(()=>{}),!1;return await r.writeFile(t.bytes),await r.chmod(t.mode).catch(()=>{}),await r.close(),!0}catch{return await r.close().catch(()=>{}),!1}}function vg(e,t,n){try{if(e instanceof Error)e.message=`${e.message}; ${t!==void 0?`new contents preserved at ${t}; `:""}${n==="restored"?"original target restored":n==="removed"?"partial target removed":n==="untouched"?"target untouched":"target left partial — treat contents as torn"}`,Object.assign(e,{...t!==void 0&&{preservedTmp:t},targetOutcome:n})}catch{}return e}function kA(e){let t=De(e);return t==="EINVAL"||t==="ENOTSUP"||t==="EPERM"||t==="ENOSYS"}var gF=3;async function sae(e,t){if(t!=="win32")return!1;try{return await CA(e),!0}catch(n){return De(n)==="ENOENT"?!1:{cause:n}}}function iae(e,t){return Object.assign(Error("EEXIST: name already taken (exclusive create)",typeof t==="object"?{cause:t.cause}:void 0),{code:"EEXIST",syscall:"lstat",path:e})}async function yF(e,t,n){for(let r=1;;r++){let o=Vie(e),s=await sae(o,t);if(s!==!1){if(r<gF)continue;throw iae(o,s)}try{return await n(o)}catch(i){if(De(i)==="EEXIST"&&r<gF)continue;throw i}}}async function aae(e,t,n,r=process.platform){return yF(e,r,async(o)=>{try{return await Gie(o,t,{encoding:"utf8",mode:n,flag:"wx"}),o}catch(s){if(De(s)!=="EEXIST")await wg(o).catch(()=>{});throw s}})}async function cae(e,t,n=process.platform){return yF(e,n,async(r)=>({fh:await Ag(r,n==="win32"?"wx":yn.O_WRONLY|yn.O_CREAT|yn.O_EXCL,t),tmp:r}))}async function bF(e,t,n,r){return lae(e,t,{mode:n,renameFn:r})}async function lae(e,t,n){let{mode:r,createMode:o,exactMode:s,flush:i,followSymlinks:a,inPlaceOnTempCreateRefused:c,renameFn:l}=n,u=r??o,p=a===!0||process.platform==="win32"?0:yn.O_NOFOLLOW,f,m=!1,h=!1,_=async(y)=>{let S=await rae(e,a===!0),b=S.kind==="snapshot"?S:void 0,x=await Ag(e,process.platform==="win32"?yn.O_WRONLY|yn.O_CREAT:yn.O_WRONLY|yn.O_CREAT|p|RA,s??u),v;try{v=await x.stat()}catch(F){throw await x.close().catch(()=>{}),m=y!==void 0,vg(F,y,"untouched")}let T=v.isCharacterDevice();if(!v.isFile()&&!T)throw await x.close().catch(()=>{}),Object.assign(Error("refusing the in-place arm on a non-regular target"),{code:"ENXIO",path:e});let U=!1;try{if(!T)await x.truncate(0),U=!0;await x.writeFile(t,{encoding:"utf8"});let F=T?void 0:s??(S.kind!=="absent"?r:void 0);if(F!==void 0)await x.chmod(F).catch(()=>{});if(i===!0)try{await x.sync()}catch(W){if(!kA(W))throw W}await x.close()}catch(F){if(await x.close().catch(()=>{}),!U)throw m=y!==void 0,vg(F,y,"untouched");m=y!==void 0;let ce=b!==void 0&&await oae(e,b,a===!0)?"restored":await wg(e).then(()=>!0,(ne)=>De(ne)==="ENOENT")?"removed":"partial";throw vg(F,y,ce)}let M=y??f;if(M!==void 0)await wg(M).catch(()=>{})};try{try{if(s!==void 0||i===!0){let S=await cae(e,s??u),b=S.fh;f=S.tmp;let x=!1,v;try{if(await b.writeFile(t,{encoding:"utf8"}),s!==void 0)try{await b.chmod(s)}catch(T){if(!kA(T))throw T}if(i===!0)try{await b.sync()}catch(T){if(!kA(T))throw T}}catch(T){x=!0,v=T}if(!x)h=!0;try{await b.close()}catch(T){if(!x)throw m=!0,vg(T,f,"untouched")}if(x)throw v}else f=await aae(e,t,u),h=!0}catch(S){if(c!==!0)throw S;if(h)throw S;if(De(S)!=="EACCES")throw S;if(!await Kie(e).then(()=>!0,()=>!1))throw S;await _(void 0);return}if(f===void 0)throw Error("staging block exited without a staging file");let y=f;try{await tae(y,e,l)}catch(S){let b=De(S);if(b===void 0||!Wie.has(b))throw S;await _(y)}}catch(y){if(f!==void 0&&!m)await wg(f).catch(()=>{});throw y}}import{constants as SF}from"fs";var uae=process.platform==="win32"?0:SF.O_NONBLOCK,OA=process.platform==="win32"?0:SF.O_NOFOLLOW|uae;class AF{read(e){return vF(e,"utf8")}readBytes(e){return vF(e)}write(e,t,n){return PA(e,t,{encoding:"utf8",mode:n})}async mkdir(e,t){try{await gae(e,{recursive:!0,mode:t})}catch(n){if(De(n)!=="EEXIST")throw n}}atomicWrite(e,t,n){return bF(e,t,n)}delete(e){return yae(e)}list(e){return xF(e)}append(e,t,n){return fae(e,t,{encoding:"utf8",mode:n})}writeExclusive(e,t,n){return PA(e,t,{encoding:"utf8",flag:"wx",mode:n})}writeBytes(e,t){return PA(e,t)}copy(e,t){return mae(e,t)}async stat(e){return{mtimeMs:(await _ae(e)).mtimeMs}}async lstat(e){try{let t=await hae(e);return{isSymbolicLink:t.isSymbolicLink(),isFile:t.isFile(),isDirectory:t.isDirectory(),mtimeMs:t.mtimeMs}}catch(t){if(De(t)==="ENOENT")return;throw t}}async listEntries(e){return(await xF(e,{withFileTypes:!0})).map((n)=>({name:n.name,isDirectory:n.isDirectory(),isFile:n.isFile()}))}async readRange(e,t,n){IA("readRange","offset",t),IA("readRange","length",n);let r=await EF(e,"r");try{return await wF(r,t,n)}finally{await r.close()}}async readTail(e,t,n){IA("readTail","maxBytes",t);let r=n?.noFollow?pae.O_RDONLY|OA:"r",o=await EF(e,r);try{let s=await o.stat();if(n?.noFollow&&!s.isFile())throw Object.assign(Error("ENXIO: not a regular file"),{code:"ENXIO",path:e});let{size:i}=s,a=Math.min(t,i);return await wF(o,i-a,a)}finally{await o.close()}}}function IA(e,t,n){if(!Number.isInteger(n)||n<0)throw RangeError(`${e}: ${t} must be a non-negative integer, got ${n}`)}async function wF(e,t,n){if(n===0)return Buffer.alloc(0);let r=Buffer.alloc(n),o=0;while(o<n){let{bytesRead:s}=await e.read(r,o,n-o,t+o);if(s===0)break;o+=s}return o===n?r:Buffer.from(r.subarray(0,o))}var bae=new dae;function Vc(){return bae.getStore()??new AF}var UA={};Xt(UA,{AGENT_PROXY_AUTH_TOKEN:()=>Vce,ANTHROPIC_API_KEY:()=>Mce,ANTHROPIC_AUTH_TOKEN:()=>Nce,ANTHROPIC_AWS_API_KEY:()=>zce,ANTHROPIC_FEDERATION_RULE_ID:()=>Ile,ANTHROPIC_FOUNDRY_API_KEY:()=>$ce,ANTHROPIC_FOUNDRY_AUTH_TOKEN:()=>jce,ANTHROPIC_ORGANIZATION_ID:()=>Dle,ANTHROPIC_PROFILE:()=>Mle,ANTHROPIC_WORKSPACE_ID:()=>Lle,AWS_BEARER_TOKEN_BEDROCK:()=>Fce,AWS_CONTAINER_CREDENTIALS_FULL_URI:()=>Gce,AWS_CONTAINER_CREDENTIALS_RELATIVE_URI:()=>Kce,AWS_ROLE_ARN:()=>Bce,AWS_WEB_IDENTITY_TOKEN_FILE:()=>Hce,CLAUDE_CODE_ACCOUNT_TAGGED_ID:()=>Ule,CLAUDE_CODE_ACCOUNT_UUID:()=>Nle,CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR:()=>Xce,CLAUDE_CODE_API_KEY_HELPER_TTL_MS:()=>Ele,CLAUDE_CODE_AUTH_FAIL_EXIT_MS:()=>Sle,CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS:()=>Ple,CLAUDE_CODE_CUSTOM_OAUTH_URL:()=>ile,CLAUDE_CODE_DESIGN_OAUTH_CLIENT_ID:()=>ole,CLAUDE_CODE_ENABLE_PROXY_AUTH_HELPER:()=>xle,CLAUDE_CODE_HFI_BEARER_TOKEN:()=>qce,CLAUDE_CODE_HOST_AUTH_ENV_VAR:()=>ule,CLAUDE_CODE_HOST_AUTH_REFRESH_TIMEOUT_MS:()=>lle,CLAUDE_CODE_HOST_CREDS_FILE:()=>dle,CLAUDE_CODE_OAUTH_401_WAIT_MS:()=>ble,CLAUDE_CODE_OAUTH_CLIENT_ID:()=>rle,CLAUDE_CODE_OAUTH_REFRESH_TOKEN:()=>nle,CLAUDE_CODE_OAUTH_SCOPES:()=>sle,CLAUDE_CODE_OAUTH_TOKEN:()=>Uce,CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR:()=>Qce,CLAUDE_CODE_ORGANIZATION_UUID:()=>Fle,CLAUDE_CODE_PROXY_AUTH_HELPER_TTL_MS:()=>vle,CLAUDE_CODE_RATE_LIMIT_TIER:()=>jle,CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH:()=>cle,CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH:()=>ale,CLAUDE_CODE_SESSION_ACCESS_TOKEN:()=>ple,CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH:()=>kle,CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH:()=>Cle,CLAUDE_CODE_SKIP_AWS_CRED_CACHE:()=>Ole,CLAUDE_CODE_SKIP_BEDROCK_AUTH:()=>wle,CLAUDE_CODE_SKIP_FOUNDRY_AUTH:()=>Tle,CLAUDE_CODE_SKIP_MANTLE_AUTH:()=>Rle,CLAUDE_CODE_SKIP_VERTEX_AUTH:()=>Ale,CLAUDE_CODE_SUBSCRIPTION_TYPE:()=>$le,CLAUDE_CODE_USER_EMAIL:()=>zle,CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR:()=>ele,CLAUDE_LOCAL_OAUTH_API_BASE:()=>gle,CLAUDE_LOCAL_OAUTH_APPS_BASE:()=>_le,CLAUDE_LOCAL_OAUTH_CONSOLE_BASE:()=>yle,CLAUDE_SESSION_INGRESS_TOKEN_FILE:()=>tle,CLAUDE_TRUSTED_DEVICE_TOKEN:()=>fle,CLOUDSDK_AUTH_ACCESS_TOKEN:()=>Wce,ENVIRONMENT_SERVICE_KEY:()=>Zce,MCP_CLIENT_SECRET:()=>Yce,MCP_XAA_IDP_CLIENT_SECRET:()=>Jce,USE_LOCAL_OAUTH:()=>mle,USE_STAGING_OAUTH:()=>hle});var mr={};Xt(mr,{BRAND:()=>Gae,DIRTY:()=>Zi,EMPTY_PATH:()=>vae,INVALID:()=>me,NEVER:()=>Cce,OK:()=>bn,ParseStatus:()=>cn,Schema:()=>Oe,ZodAny:()=>Ji,ZodArray:()=>Xr,ZodBigInt:()=>qs,ZodBoolean:()=>Qc,ZodBranded:()=>Rg,ZodCatch:()=>cl,ZodDate:()=>Yi,ZodDefault:()=>al,ZodDiscriminatedUnion:()=>Cg,ZodEffects:()=>eo,ZodEnum:()=>Vs,ZodError:()=>Hn,ZodFirstPartyTypeKind:()=>B,ZodFunction:()=>Xc,ZodIntersection:()=>rl,ZodIssueCode:()=>H,ZodLazy:()=>ol,ZodLiteral:()=>sl,ZodMap:()=>Ep,ZodNaN:()=>xp,ZodNativeEnum:()=>il,ZodNever:()=>Do,ZodNull:()=>tl,ZodNullable:()=>ts,ZodNumber:()=>Ws,ZodObject:()=>vt,ZodOptional:()=>fr,ZodParsedType:()=>q,ZodPipeline:()=>vp,ZodPromise:()=>Qi,ZodReadonly:()=>ll,ZodRecord:()=>Sp,ZodSchema:()=>Oe,ZodSet:()=>Xi,ZodString:()=>Jr,ZodSymbol:()=>yp,ZodTransformer:()=>eo,ZodTuple:()=>Lo,ZodType:()=>Oe,ZodUndefined:()=>el,ZodUnion:()=>nl,ZodUnknown:()=>Gs,ZodVoid:()=>bp,addIssueToContext:()=>J,any:()=>ece,array:()=>oce,bigint:()=>Zae,boolean:()=>NF,coerce:()=>kce,custom:()=>DF,date:()=>Yae,datetimeRegex:()=>PF,defaultErrorMap:()=>Qo,discriminatedUnion:()=>ace,effect:()=>bce,enum:()=>gce,function:()=>fce,getErrorMap:()=>Zc,getParsedType:()=>Io,instanceof:()=>qae,intersection:()=>cce,isAborted:()=>Tg,isAsync:()=>Yc,isDirty:()=>kg,isValid:()=>Ks,late:()=>Wae,lazy:()=>mce,literal:()=>hce,makeIssue:()=>_p,map:()=>dce,nan:()=>Vae,nativeEnum:()=>_ce,never:()=>nce,null:()=>Qae,nullable:()=>Ece,number:()=>MF,object:()=>NA,objectUtil:()=>DA,oboolean:()=>Tce,onumber:()=>Ace,optional:()=>Sce,ostring:()=>wce,pipeline:()=>vce,preprocess:()=>xce,promise:()=>yce,quotelessJson:()=>Sae,record:()=>uce,set:()=>pce,setErrorMap:()=>xae,strictObject:()=>sce,string:()=>LF,symbol:()=>Jae,transformer:()=>bce,tuple:()=>lce,undefined:()=>Xae,union:()=>ice,unknown:()=>tce,util:()=>Le,void:()=>rce});var Le;(function(e){e.assertEqual=(o)=>{};function t(o){}e.assertIs=t;function n(o){throw Error()}e.assertNever=n,e.arrayToEnum=(o)=>{let s={};for(let i of o)s[i]=i;return s},e.getValidEnumValues=(o)=>{let s=e.objectKeys(o).filter((a)=>typeof o[o[a]]!=="number"),i={};for(let a of s)i[a]=o[a];return e.objectValues(i)},e.objectValues=(o)=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys==="function"?(o)=>Object.keys(o):(o)=>{let s=[];for(let i in o)if(Object.prototype.hasOwnProperty.call(o,i))s.push(i);return s},e.find=(o,s)=>{for(let i of o)if(s(i))return i;return},e.isInteger=typeof Number.isInteger==="function"?(o)=>Number.isInteger(o):(o)=>typeof o==="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map((i)=>typeof i==="string"?`'${i}'`:i).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(o,s)=>{if(typeof s==="bigint")return s.toString();return s}})(Le||(Le={}));var DA;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(DA||(DA={}));var q=Le.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Io=(e)=>{switch(typeof e){case"undefined":return q.undefined;case"string":return q.string;case"number":return Number.isNaN(e)?q.nan:q.number;case"boolean":return q.boolean;case"function":return q.function;case"bigint":return q.bigint;case"symbol":return q.symbol;case"object":if(Array.isArray(e))return q.array;if(e===null)return q.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return q.promise;if(typeof Map<"u"&&e instanceof Map)return q.map;if(typeof Set<"u"&&e instanceof Set)return q.set;if(typeof Date<"u"&&e instanceof Date)return q.date;return q.object;default:return q.unknown}};var H=Le.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Sae=(e)=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Hn extends Error{get errors(){return this.issues}constructor(e){super();this.issues=[],this.addIssue=(n)=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,t);else this.__proto__=t;this.name="ZodError",this.issues=e}format(e){let t=e||function(o){return o.message},n={_errors:[]},r=(o)=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(r);else if(s.code==="invalid_return_type")r(s.returnTypeError);else if(s.code==="invalid_arguments")r(s.argumentsError);else if(s.path.length===0)n._errors.push(t(s));else{let i=n,a=0;while(a<s.path.length){let c=s.path[a];if(a!==s.path.length-1)i[c]=i[c]||{_errors:[]};else i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(s));i=i[c],a++}}};return r(this),n}static assert(e){if(!(e instanceof Hn))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Le.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=(t)=>t.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let o=r.path[0];t[o]=t[o]||[],t[o].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}Hn.create=(e)=>new Hn(e);var Eae=(e,t)=>{let n;switch(e.code){case H.invalid_type:if(e.received===q.undefined)n="Required";else n=`Expected ${e.expected}, received ${e.received}`;break;case H.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Le.jsonStringifyReplacer)}`;break;case H.unrecognized_keys:n=`Unrecognized key(s) in object: ${Le.joinValues(e.keys,", ")}`;break;case H.invalid_union:n="Invalid input";break;case H.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Le.joinValues(e.options)}`;break;case H.invalid_enum_value:n=`Invalid enum value. Expected ${Le.joinValues(e.options)}, received '${e.received}'`;break;case H.invalid_arguments:n="Invalid function arguments";break;case H.invalid_return_type:n="Invalid function return type";break;case H.invalid_date:n="Invalid date";break;case H.invalid_string:if(typeof e.validation==="object")if("includes"in e.validation){if(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==="number")n=`${n} at one or more positions greater than or equal to ${e.validation.position}`}else if("startsWith"in e.validation)n=`Invalid input: must start with "${e.validation.startsWith}"`;else if("endsWith"in e.validation)n=`Invalid input: must end with "${e.validation.endsWith}"`;else Le.assertNever(e.validation);else if(e.validation!=="regex")n=`Invalid ${e.validation}`;else n="Invalid";break;case H.too_small:if(e.type==="array")n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`;else if(e.type==="string")n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`;else if(e.type==="number")n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="bigint")n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="date")n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`;else n="Invalid input";break;case H.too_big:if(e.type==="array")n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`;else if(e.type==="string")n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`;else if(e.type==="number")n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="bigint")n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="date")n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`;else n="Invalid input";break;case H.custom:n="Invalid input";break;case H.invalid_intersection_types:n="Intersection results could not be merged";break;case H.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case H.not_finite:n="Number must be finite";break;default:n=t.defaultError,Le.assertNever(e)}return{message:n}},Qo=Eae;var TF=Qo;function xae(e){TF=e}function Zc(){return TF}var _p=(e)=>{let{data:t,path:n,errorMaps:r,issueData:o}=e,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="",c=r.filter((l)=>!!l).slice().reverse();for(let l of c)a=l(i,{data:t,defaultError:a}).message;return{...o,path:s,message:a}},vae=[];function J(e,t){let n=Zc(),r=_p({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Qo?void 0:Qo].filter((o)=>!!o)});e.common.issues.push(r)}class cn{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(e,t){let n=[];for(let r of t){if(r.status==="aborted")return me;if(r.status==="dirty")e.dirty();n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let r of t){let o=await r.key,s=await r.value;n.push({key:o,value:s})}return cn.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:o,value:s}=r;if(o.status==="aborted")return me;if(s.status==="aborted")return me;if(o.status==="dirty")e.dirty();if(s.status==="dirty")e.dirty();if(o.value!=="__proto__"&&(typeof s.value<"u"||r.alwaysSet))n[o.value]=s.value}return{status:e.value,value:n}}}var me=Object.freeze({status:"aborted"}),Zi=(e)=>({status:"dirty",value:e}),bn=(e)=>({status:"valid",value:e}),Tg=(e)=>e.status==="aborted",kg=(e)=>e.status==="dirty",Ks=(e)=>e.status==="valid",Yc=(e)=>typeof Promise<"u"&&e instanceof Promise;var oe;(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(oe||(oe={}));class Qr{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var kF=(e,t)=>{if(Ks(t))return{success:!0,data:t.value};else{if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Hn(e.common.issues);return this._error=n,this._error}}}};function ve(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(t)return{errorMap:t,description:o};return{errorMap:(i,a)=>{let{message:c}=e;if(i.code==="invalid_enum_value")return{message:c??a.defaultError};if(typeof a.data>"u")return{message:c??r??a.defaultError};if(i.code!=="invalid_type")return{message:a.defaultError};return{message:c??n??a.defaultError}},description:o}}class Oe{get description(){return this._def.description}_getType(e){return Io(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Io(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new cn,ctx:{common:e.parent.common,data:e.data,parsedType:Io(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Yc(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Io(e)},r=this._parseSync({data:e,path:n.path,parent:n});return kF(n,r)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Io(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return Ks(n)?{value:n.value}:{issues:t.common.issues}}catch(n){if(n?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((n)=>Ks(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Io(e)},r=this._parse({data:e,path:n.path,parent:n}),o=await(Yc(r)?r:Promise.resolve(r));return kF(n,o)}refine(e,t){let n=(r)=>{if(typeof t==="string"||typeof t>"u")return{message:t};else if(typeof t==="function")return t(r);else return t};return this._refinement((r,o)=>{let s=e(r),i=()=>o.addIssue({code:H.custom,...n(r)});if(typeof Promise<"u"&&s instanceof Promise)return s.then((a)=>{if(!a)return i(),!1;else return!0});if(!s)return i(),!1;else return!0})}refinement(e,t){return this._refinement((n,r)=>{if(!e(n))return r.addIssue(typeof t==="function"?t(n,r):t),!1;else return!0})}_refinement(e){return new eo({schema:this,typeName:B.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(t)=>this["~validate"](t)}}optional(){return fr.create(this,this._def)}nullable(){return ts.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Xr.create(this)}promise(){return Qi.create(this,this._def)}or(e){return nl.create([this,e],this._def)}and(e){return rl.create(this,e,this._def)}transform(e){return new eo({...ve(this._def),schema:this,typeName:B.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new al({...ve(this._def),innerType:this,defaultValue:t,typeName:B.ZodDefault})}brand(){return new Rg({typeName:B.ZodBranded,type:this,...ve(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new cl({...ve(this._def),innerType:this,catchValue:t,typeName:B.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return vp.create(this,e)}readonly(){return ll.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var wae=/^c[^\s-]{8,}$/i,Aae=/^[0-9a-z]+$/,Tae=/^[0-9A-HJKMNP-TV-Z]{26}$/i,kae=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Cae=/^[a-z0-9_-]{21}$/i,Rae=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Oae=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Pae=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Iae="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",LA,Dae=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Lae=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Mae=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Nae=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Uae=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Fae=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,RF="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",zae=new RegExp(`^${RF}$`);function OF(e){let t="[0-5]\\d";if(e.precision)t=`${t}\\.\\d{${e.precision}}`;else if(e.precision==null)t=`${t}(\\.\\d+)?`;let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function $ae(e){return new RegExp(`^${OF(e)}$`)}function PF(e){let t=`${RF}T${OF(e)}`,n=[];if(n.push(e.local?"Z?":"Z"),e.offset)n.push("([+-]\\d{2}:?\\d{2})");return t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function jae(e,t){if((t==="v4"||!t)&&Dae.test(e))return!0;if((t==="v6"||!t)&&Mae.test(e))return!0;return!1}function Hae(e,t){if(!Rae.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));if(typeof o!=="object"||o===null)return!1;if("typ"in o&&o?.typ!=="JWT")return!1;if(!o.alg)return!1;if(t&&o.alg!==t)return!1;return!0}catch{return!1}}function Bae(e,t){if((t==="v4"||!t)&&Lae.test(e))return!0;if((t==="v6"||!t)&&Nae.test(e))return!0;return!1}class Jr extends Oe{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==q.string){let o=this._getOrReturnCtx(e);return J(o,{code:H.invalid_type,expected:q.string,received:o.parsedType}),me}let n=new cn,r=void 0;for(let o of this._def.checks)if(o.kind==="min"){if(e.data.length<o.value)r=this._getOrReturnCtx(e,r),J(r,{code:H.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty()}else if(o.kind==="max"){if(e.data.length>o.value)r=this._getOrReturnCtx(e,r),J(r,{code:H.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty()}else if(o.kind==="length"){let s=e.data.length>o.value,i=e.data.length<o.value;if(s||i){if(r=this._getOrReturnCtx(e,r),s)J(r,{code:H.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});else if(i)J(r,{code:H.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});n.dirty()}}else if(o.kind==="email"){if(!Pae.test(e.data))r=this._getOrReturnCtx(e,r),J(r,{validation:"email",code:H.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="emoji"){if(!LA)LA=new RegExp(Iae,"u");if(!LA.test(e.data))r=this._getOrReturnCtx(e,r),J(r,{validation:"emoji",code:H.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="uuid"){if(!kae.test(e.data))r=this._getOrReturnCtx(e,r),J(r,{validation:"uuid",code:H.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="nanoid"){if(!Cae.test(e.data))r=this._getOrReturnCtx(e,r),J(r,{validation:"nanoid",code:H.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cuid"){if(!wae.test(e.data))r=this._getOrReturnCtx(e,r),J(r,{validation:"cuid",code:H.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cuid2"){if(!Aae.test(e.data))r=this._getOrReturnCtx(e,r),J(r,{validation:"cuid2",code:H.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="ulid"){if(!Tae.test(e.data))r=this._getOrReturnCtx(e,r),J(r,{validation:"ulid",code:H.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),J(r,{validation:"url",code:H.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="regex"){if(o.regex.lastIndex=0,!o.regex.test(e.data))r=this._getOrReturnCtx(e,r),J(r,{validation:"regex",code:H.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="trim")e.data=e.data.trim();else if(o.kind==="includes"){if(!e.data.includes(o.value,o.position))r=this._getOrReturnCtx(e,r),J(r,{code:H.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()}else if(o.kind==="toLowerCase")e.data=e.data.toLowerCase();else if(o.kind==="toUpperCase")e.data=e.data.toUpperCase();else if(o.kind==="startsWith"){if(!e.data.startsWith(o.value))r=this._getOrReturnCtx(e,r),J(r,{code:H.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()}else if(o.kind==="endsWith"){if(!e.data.endsWith(o.value))r=this._getOrReturnCtx(e,r),J(r,{code:H.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()}else if(o.kind==="datetime"){if(!PF(o).test(e.data))r=this._getOrReturnCtx(e,r),J(r,{code:H.invalid_string,validation:"datetime",message:o.message}),n.dirty()}else if(o.kind==="date"){if(!zae.test(e.data))r=this._getOrReturnCtx(e,r),J(r,{code:H.invalid_string,validation:"date",message:o.message}),n.dirty()}else if(o.kind==="time"){if(!$ae(o).test(e.data))r=this._getOrReturnCtx(e,r),J(r,{code:H.invalid_string,validation:"time",message:o.message}),n.dirty()}else if(o.kind==="duration"){if(!Oae.test(e.data))r=this._getOrReturnCtx(e,r),J(r,{validation:"duration",code:H.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="ip"){if(!jae(e.data,o.version))r=this._getOrReturnCtx(e,r),J(r,{validation:"ip",code:H.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="jwt"){if(!Hae(e.data,o.alg))r=this._getOrReturnCtx(e,r),J(r,{validation:"jwt",code:H.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cidr"){if(!Bae(e.data,o.version))r=this._getOrReturnCtx(e,r),J(r,{validation:"cidr",code:H.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="base64"){if(!Uae.test(e.data))r=this._getOrReturnCtx(e,r),J(r,{validation:"base64",code:H.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="base64url"){if(!Fae.test(e.data))r=this._getOrReturnCtx(e,r),J(r,{validation:"base64url",code:H.invalid_string,message:o.message}),n.dirty()}else Le.assertNever(o);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement((r)=>e.test(r),{validation:t,code:H.invalid_string,...oe.errToObj(n)})}_addCheck(e){return new Jr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...oe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...oe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...oe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...oe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...oe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...oe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...oe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...oe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...oe.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...oe.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...oe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...oe.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...oe.errToObj(e)})}datetime(e){if(typeof e==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e});return this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...oe.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){if(typeof e==="string")return this._addCheck({kind:"time",precision:null,message:e});return this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...oe.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...oe.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...oe.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...oe.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...oe.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...oe.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...oe.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...oe.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...oe.errToObj(t)})}nonempty(e){return this.min(1,oe.errToObj(e))}trim(){return new Jr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Jr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Jr({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e)=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find((e)=>e.kind==="date")}get isTime(){return!!this._def.checks.find((e)=>e.kind==="time")}get isDuration(){return!!this._def.checks.find((e)=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find((e)=>e.kind==="email")}get isURL(){return!!this._def.checks.find((e)=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find((e)=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find((e)=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((e)=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((e)=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((e)=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find((e)=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find((e)=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find((e)=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find((e)=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find((e)=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxLength(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}}Jr.create=(e)=>new Jr({checks:[],typeName:B.ZodString,coerce:e?.coerce??!1,...ve(e)});function Kae(e,t){let n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return s%i/10**o}class Ws extends Oe{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce)e.data=Number(e.data);if(this._getType(e)!==q.number){let o=this._getOrReturnCtx(e);return J(o,{code:H.invalid_type,expected:q.number,received:o.parsedType}),me}let n=void 0,r=new cn;for(let o of this._def.checks)if(o.kind==="int"){if(!Le.isInteger(e.data))n=this._getOrReturnCtx(e,n),J(n,{code:H.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()}else if(o.kind==="min"){if(o.inclusive?e.data<o.value:e.data<=o.value)n=this._getOrReturnCtx(e,n),J(n,{code:H.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()}else if(o.kind==="max"){if(o.inclusive?e.data>o.value:e.data>=o.value)n=this._getOrReturnCtx(e,n),J(n,{code:H.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()}else if(o.kind==="multipleOf"){if(Kae(e.data,o.value)!==0)n=this._getOrReturnCtx(e,n),J(n,{code:H.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()}else if(o.kind==="finite"){if(!Number.isFinite(e.data))n=this._getOrReturnCtx(e,n),J(n,{code:H.not_finite,message:o.message}),r.dirty()}else Le.assertNever(o);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,oe.toString(t))}gt(e,t){return this.setLimit("min",e,!1,oe.toString(t))}lte(e,t){return this.setLimit("max",e,!0,oe.toString(t))}lt(e,t){return this.setLimit("max",e,!1,oe.toString(t))}setLimit(e,t,n,r){return new Ws({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:oe.toString(r)}]})}_addCheck(e){return new Ws({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:oe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:oe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:oe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:oe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:oe.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:oe.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:oe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:oe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:oe.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}get isInt(){return!!this._def.checks.find((e)=>e.kind==="int"||e.kind==="multipleOf"&&Le.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;else if(n.kind==="min"){if(t===null||n.value>t)t=n.value}else if(n.kind==="max"){if(e===null||n.value<e)e=n.value}return Number.isFinite(t)&&Number.isFinite(e)}}Ws.create=(e)=>new Ws({checks:[],typeName:B.ZodNumber,coerce:e?.coerce||!1,...ve(e)});class qs extends Oe{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==q.bigint)return this._getInvalidInput(e);let n=void 0,r=new cn;for(let o of this._def.checks)if(o.kind==="min"){if(o.inclusive?e.data<o.value:e.data<=o.value)n=this._getOrReturnCtx(e,n),J(n,{code:H.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()}else if(o.kind==="max"){if(o.inclusive?e.data>o.value:e.data>=o.value)n=this._getOrReturnCtx(e,n),J(n,{code:H.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()}else if(o.kind==="multipleOf"){if(e.data%o.value!==BigInt(0))n=this._getOrReturnCtx(e,n),J(n,{code:H.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()}else Le.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return J(t,{code:H.invalid_type,expected:q.bigint,received:t.parsedType}),me}gte(e,t){return this.setLimit("min",e,!0,oe.toString(t))}gt(e,t){return this.setLimit("min",e,!1,oe.toString(t))}lte(e,t){return this.setLimit("max",e,!0,oe.toString(t))}lt(e,t){return this.setLimit("max",e,!1,oe.toString(t))}setLimit(e,t,n,r){return new qs({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:oe.toString(r)}]})}_addCheck(e){return new qs({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:oe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:oe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:oe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:oe.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:oe.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}}qs.create=(e)=>new qs({checks:[],typeName:B.ZodBigInt,coerce:e?.coerce??!1,...ve(e)});class Qc extends Oe{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==q.boolean){let n=this._getOrReturnCtx(e);return J(n,{code:H.invalid_type,expected:q.boolean,received:n.parsedType}),me}return bn(e.data)}}Qc.create=(e)=>new Qc({typeName:B.ZodBoolean,coerce:e?.coerce||!1,...ve(e)});class Yi extends Oe{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==q.date){let o=this._getOrReturnCtx(e);return J(o,{code:H.invalid_type,expected:q.date,received:o.parsedType}),me}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return J(o,{code:H.invalid_date}),me}let n=new cn,r=void 0;for(let o of this._def.checks)if(o.kind==="min"){if(e.data.getTime()<o.value)r=this._getOrReturnCtx(e,r),J(r,{code:H.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()}else if(o.kind==="max"){if(e.data.getTime()>o.value)r=this._getOrReturnCtx(e,r),J(r,{code:H.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()}else Le.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Yi({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:oe.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:oe.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e!=null?new Date(e):null}}Yi.create=(e)=>new Yi({checks:[],coerce:e?.coerce||!1,typeName:B.ZodDate,...ve(e)});class yp extends Oe{_parse(e){if(this._getType(e)!==q.symbol){let n=this._getOrReturnCtx(e);return J(n,{code:H.invalid_type,expected:q.symbol,received:n.parsedType}),me}return bn(e.data)}}yp.create=(e)=>new yp({typeName:B.ZodSymbol,...ve(e)});class el extends Oe{_parse(e){if(this._getType(e)!==q.undefined){let n=this._getOrReturnCtx(e);return J(n,{code:H.invalid_type,expected:q.undefined,received:n.parsedType}),me}return bn(e.data)}}el.create=(e)=>new el({typeName:B.ZodUndefined,...ve(e)});class tl extends Oe{_parse(e){if(this._getType(e)!==q.null){let n=this._getOrReturnCtx(e);return J(n,{code:H.invalid_type,expected:q.null,received:n.parsedType}),me}return bn(e.data)}}tl.create=(e)=>new tl({typeName:B.ZodNull,...ve(e)});class Ji extends Oe{constructor(){super(...arguments);this._any=!0}_parse(e){return bn(e.data)}}Ji.create=(e)=>new Ji({typeName:B.ZodAny,...ve(e)});class Gs extends Oe{constructor(){super(...arguments);this._unknown=!0}_parse(e){return bn(e.data)}}Gs.create=(e)=>new Gs({typeName:B.ZodUnknown,...ve(e)});class Do extends Oe{_parse(e){let t=this._getOrReturnCtx(e);return J(t,{code:H.invalid_type,expected:q.never,received:t.parsedType}),me}}Do.create=(e)=>new Do({typeName:B.ZodNever,...ve(e)});class bp extends Oe{_parse(e){if(this._getType(e)!==q.undefined){let n=this._getOrReturnCtx(e);return J(n,{code:H.invalid_type,expected:q.void,received:n.parsedType}),me}return bn(e.data)}}bp.create=(e)=>new bp({typeName:B.ZodVoid,...ve(e)});class Xr extends Oe{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==q.array)return J(t,{code:H.invalid_type,expected:q.array,received:t.parsedType}),me;if(r.exactLength!==null){let s=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;if(s||i)J(t,{code:s?H.too_big:H.too_small,minimum:i?r.exactLength.value:void 0,maximum:s?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty()}if(r.minLength!==null){if(t.data.length<r.minLength.value)J(t,{code:H.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()}if(r.maxLength!==null){if(t.data.length>r.maxLength.value)J(t,{code:H.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()}if(t.common.async)return Promise.all([...t.data].map((s,i)=>r.type._parseAsync(new Qr(t,s,t.path,i)))).then((s)=>cn.mergeArray(n,s));let o=[...t.data].map((s,i)=>r.type._parseSync(new Qr(t,s,t.path,i)));return cn.mergeArray(n,o)}get element(){return this._def.type}min(e,t){return new Xr({...this._def,minLength:{value:e,message:oe.toString(t)}})}max(e,t){return new Xr({...this._def,maxLength:{value:e,message:oe.toString(t)}})}length(e,t){return new Xr({...this._def,exactLength:{value:e,message:oe.toString(t)}})}nonempty(e){return this.min(1,e)}}Xr.create=(e,t)=>new Xr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:B.ZodArray,...ve(t)});function Jc(e){if(e instanceof vt){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=fr.create(Jc(r))}return new vt({...e._def,shape:()=>t})}else if(e instanceof Xr)return new Xr({...e._def,type:Jc(e.element)});else if(e instanceof fr)return fr.create(Jc(e.unwrap()));else if(e instanceof ts)return ts.create(Jc(e.unwrap()));else if(e instanceof Lo)return Lo.create(e.items.map((t)=>Jc(t)));else return e}class vt extends Oe{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=Le.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==q.object){let c=this._getOrReturnCtx(e);return J(c,{code:H.invalid_type,expected:q.object,received:c.parsedType}),me}let{status:n,ctx:r}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),i=[];if(!(this._def.catchall instanceof Do&&this._def.unknownKeys==="strip")){for(let c in r.data)if(!s.includes(c))i.push(c)}let a=[];for(let c of s){let l=o[c],u=r.data[c];a.push({key:{status:"valid",value:c},value:l._parse(new Qr(r,u,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof Do){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of i)a.push({key:{status:"valid",value:l},value:{status:"valid",value:r.data[l]}});else if(c==="strict"){if(i.length>0)J(r,{code:H.unrecognized_keys,keys:i}),n.dirty()}else if(c==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of i){let u=r.data[l];a.push({key:{status:"valid",value:l},value:c._parse(new Qr(r,u,r.path,l)),alwaysSet:l in r.data})}}if(r.common.async)return Promise.resolve().then(async()=>{let c=[];for(let l of a){let u=await l.key,p=await l.value;c.push({key:u,value:p,alwaysSet:l.alwaysSet})}return c}).then((c)=>cn.mergeObjectSync(n,c));else return cn.mergeObjectSync(n,a)}get shape(){return this._def.shape()}strict(e){return oe.errToObj,new vt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{let r=this._def.errorMap?.(t,n).message??n.defaultError;if(t.code==="unrecognized_keys")return{message:oe.errToObj(e).message??r};return{message:r}}}:{}})}strip(){return new vt({...this._def,unknownKeys:"strip"})}passthrough(){return new vt({...this._def,unknownKeys:"passthrough"})}extend(e){return new vt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new vt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:B.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new vt({...this._def,catchall:e})}pick(e){let t={};for(let n of Le.objectKeys(e))if(e[n]&&this.shape[n])t[n]=this.shape[n];return new vt({...this._def,shape:()=>t})}omit(e){let t={};for(let n of Le.objectKeys(this.shape))if(!e[n])t[n]=this.shape[n];return new vt({...this._def,shape:()=>t})}deepPartial(){return Jc(this)}partial(e){let t={};for(let n of Le.objectKeys(this.shape)){let r=this.shape[n];if(e&&!e[n])t[n]=r;else t[n]=r.optional()}return new vt({...this._def,shape:()=>t})}required(e){let t={};for(let n of Le.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let o=this.shape[n];while(o instanceof fr)o=o._def.innerType;t[n]=o}return new vt({...this._def,shape:()=>t})}keyof(){return IF(Le.objectKeys(this.shape))}}vt.create=(e,t)=>new vt({shape:()=>e,unknownKeys:"strip",catchall:Do.create(),typeName:B.ZodObject,...ve(t)});vt.strictCreate=(e,t)=>new vt({shape:()=>e,unknownKeys:"strict",catchall:Do.create(),typeName:B.ZodObject,...ve(t)});vt.lazycreate=(e,t)=>new vt({shape:e,unknownKeys:"strip",catchall:Do.create(),typeName:B.ZodObject,...ve(t)});class nl extends Oe{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(o){for(let i of o)if(i.result.status==="valid")return i.result;for(let i of o)if(i.result.status==="dirty")return t.common.issues.push(...i.ctx.common.issues),i.result;let s=o.map((i)=>new Hn(i.ctx.common.issues));return J(t,{code:H.invalid_union,unionErrors:s}),me}if(t.common.async)return Promise.all(n.map(async(o)=>{let s={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(r);else{let o=void 0,s=[];for(let a of n){let c={...t,common:{...t.common,issues:[]},parent:null},l=a._parseSync({data:t.data,path:t.path,parent:c});if(l.status==="valid")return l;else if(l.status==="dirty"&&!o)o={result:l,ctx:c};if(c.common.issues.length)s.push(c.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;let i=s.map((a)=>new Hn(a));return J(t,{code:H.invalid_union,unionErrors:i}),me}}get options(){return this._def.options}}nl.create=(e,t)=>new nl({options:e,typeName:B.ZodUnion,...ve(t)});var es=(e)=>{if(e instanceof ol)return es(e.schema);else if(e instanceof eo)return es(e.innerType());else if(e instanceof sl)return[e.value];else if(e instanceof Vs)return e.options;else if(e instanceof il)return Le.objectValues(e.enum);else if(e instanceof al)return es(e._def.innerType);else if(e instanceof el)return[void 0];else if(e instanceof tl)return[null];else if(e instanceof fr)return[void 0,...es(e.unwrap())];else if(e instanceof ts)return[null,...es(e.unwrap())];else if(e instanceof Rg)return es(e.unwrap());else if(e instanceof ll)return es(e.unwrap());else if(e instanceof cl)return es(e._def.innerType);else return[]};class Cg extends Oe{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==q.object)return J(t,{code:H.invalid_type,expected:q.object,received:t.parsedType}),me;let n=this.discriminator,r=t.data[n],o=this.optionsMap.get(r);if(!o)return J(t,{code:H.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),me;if(t.common.async)return o._parseAsync({data:t.data,path:t.path,parent:t});else return o._parseSync({data:t.data,path:t.path,parent:t})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let r=new Map;for(let o of t){let s=es(o.shape[e]);if(!s.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of s){if(r.has(i))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,o)}}return new Cg({typeName:B.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...ve(n)})}}function MA(e,t){let n=Io(e),r=Io(t);if(e===t)return{valid:!0,data:e};else if(n===q.object&&r===q.object){let o=Le.objectKeys(t),s=Le.objectKeys(e).filter((a)=>o.indexOf(a)!==-1),i={...e,...t};for(let a of s){let c=MA(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(n===q.array&&r===q.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let s=0;s<e.length;s++){let i=e[s],a=t[s],c=MA(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else if(n===q.date&&r===q.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}class rl extends Oe{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(o,s)=>{if(Tg(o)||Tg(s))return me;let i=MA(o.value,s.value);if(!i.valid)return J(n,{code:H.invalid_intersection_types}),me;if(kg(o)||kg(s))t.dirty();return{status:t.value,value:i.data}};if(n.common.async)return Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,s])=>r(o,s));else return r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}rl.create=(e,t,n)=>new rl({left:e,right:t,typeName:B.ZodIntersection,...ve(n)});class Lo extends Oe{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==q.array)return J(n,{code:H.invalid_type,expected:q.array,received:n.parsedType}),me;if(n.data.length<this._def.items.length)return J(n,{code:H.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),me;if(!this._def.rest&&n.data.length>this._def.items.length)J(n,{code:H.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty();let o=[...n.data].map((s,i)=>{let a=this._def.items[i]||this._def.rest;if(!a)return null;return a._parse(new Qr(n,s,n.path,i))}).filter((s)=>!!s);if(n.common.async)return Promise.all(o).then((s)=>cn.mergeArray(t,s));else return cn.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new Lo({...this._def,rest:e})}}Lo.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Lo({items:e,typeName:B.ZodTuple,rest:null,...ve(t)})};class Sp extends Oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==q.object)return J(n,{code:H.invalid_type,expected:q.object,received:n.parsedType}),me;let r=[],o=this._def.keyType,s=this._def.valueType;for(let i in n.data)r.push({key:o._parse(new Qr(n,i,n.path,i)),value:s._parse(new Qr(n,n.data[i],n.path,i)),alwaysSet:i in n.data});if(n.common.async)return cn.mergeObjectAsync(t,r);else return cn.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){if(t instanceof Oe)return new Sp({keyType:e,valueType:t,typeName:B.ZodRecord,...ve(n)});return new Sp({keyType:Jr.create(),valueType:e,typeName:B.ZodRecord,...ve(t)})}}class Ep extends Oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==q.map)return J(n,{code:H.invalid_type,expected:q.map,received:n.parsedType}),me;let r=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([i,a],c)=>({key:r._parse(new Qr(n,i,n.path,[c,"key"])),value:o._parse(new Qr(n,a,n.path,[c,"value"]))}));if(n.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let a of s){let c=await a.key,l=await a.value;if(c.status==="aborted"||l.status==="aborted")return me;if(c.status==="dirty"||l.status==="dirty")t.dirty();i.set(c.value,l.value)}return{status:t.value,value:i}})}else{let i=new Map;for(let a of s){let{key:c,value:l}=a;if(c.status==="aborted"||l.status==="aborted")return me;if(c.status==="dirty"||l.status==="dirty")t.dirty();i.set(c.value,l.value)}return{status:t.value,value:i}}}}Ep.create=(e,t,n)=>new Ep({valueType:t,keyType:e,typeName:B.ZodMap,...ve(n)});class Xi extends Oe{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==q.set)return J(n,{code:H.invalid_type,expected:q.set,received:n.parsedType}),me;let r=this._def;if(r.minSize!==null){if(n.data.size<r.minSize.value)J(n,{code:H.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()}if(r.maxSize!==null){if(n.data.size>r.maxSize.value)J(n,{code:H.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty()}let o=this._def.valueType;function s(a){let c=new Set;for(let l of a){if(l.status==="aborted")return me;if(l.status==="dirty")t.dirty();c.add(l.value)}return{status:t.value,value:c}}let i=[...n.data.values()].map((a,c)=>o._parse(new Qr(n,a,n.path,c)));if(n.common.async)return Promise.all(i).then((a)=>s(a));else return s(i)}min(e,t){return new Xi({...this._def,minSize:{value:e,message:oe.toString(t)}})}max(e,t){return new Xi({...this._def,maxSize:{value:e,message:oe.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Xi.create=(e,t)=>new Xi({valueType:e,minSize:null,maxSize:null,typeName:B.ZodSet,...ve(t)});class Xc extends Oe{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==q.function)return J(t,{code:H.invalid_type,expected:q.function,received:t.parsedType}),me;function n(i,a){return _p({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Zc(),Qo].filter((c)=>!!c),issueData:{code:H.invalid_arguments,argumentsError:a}})}function r(i,a){return _p({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Zc(),Qo].filter((c)=>!!c),issueData:{code:H.invalid_return_type,returnTypeError:a}})}let o={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof Qi){let i=this;return bn(async function(...a){let c=new Hn([]),l=await i._def.args.parseAsync(a,o).catch((f)=>{throw c.addIssue(n(a,f)),c}),u=await Reflect.apply(s,this,l);return await i._def.returns._def.type.parseAsync(u,o).catch((f)=>{throw c.addIssue(r(u,f)),c})})}else{let i=this;return bn(function(...a){let c=i._def.args.safeParse(a,o);if(!c.success)throw new Hn([n(a,c.error)]);let l=Reflect.apply(s,this,c.data),u=i._def.returns.safeParse(l,o);if(!u.success)throw new Hn([r(l,u.error)]);return u.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Xc({...this._def,args:Lo.create(e).rest(Gs.create())})}returns(e){return new Xc({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Xc({args:e?e:Lo.create([]).rest(Gs.create()),returns:t||Gs.create(),typeName:B.ZodFunction,...ve(n)})}}class ol extends Oe{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ol.create=(e,t)=>new ol({getter:e,typeName:B.ZodLazy,...ve(t)});class sl extends Oe{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return J(t,{received:t.data,code:H.invalid_literal,expected:this._def.value}),me}return{status:"valid",value:e.data}}get value(){return this._def.value}}sl.create=(e,t)=>new sl({value:e,typeName:B.ZodLiteral,...ve(t)});function IF(e,t){return new Vs({values:e,typeName:B.ZodEnum,...ve(t)})}class Vs extends Oe{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return J(t,{expected:Le.joinValues(n),received:t.parsedType,code:H.invalid_type}),me}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return J(t,{received:t.data,code:H.invalid_enum_value,options:n}),me}return bn(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Vs.create(e,{...this._def,...t})}exclude(e,t=this._def){return Vs.create(this.options.filter((n)=>!e.includes(n)),{...this._def,...t})}}Vs.create=IF;class il extends Oe{_parse(e){let t=Le.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==q.string&&n.parsedType!==q.number){let r=Le.objectValues(t);return J(n,{expected:Le.joinValues(r),received:n.parsedType,code:H.invalid_type}),me}if(!this._cache)this._cache=new Set(Le.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let r=Le.objectValues(t);return J(n,{received:n.data,code:H.invalid_enum_value,options:r}),me}return bn(e.data)}get enum(){return this._def.values}}il.create=(e,t)=>new il({values:e,typeName:B.ZodNativeEnum,...ve(t)});class Qi extends Oe{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==q.promise&&t.common.async===!1)return J(t,{code:H.invalid_type,expected:q.promise,received:t.parsedType}),me;let n=t.parsedType===q.promise?t.data:Promise.resolve(t.data);return bn(n.then((r)=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Qi.create=(e,t)=>new Qi({type:e,typeName:B.ZodPromise,...ve(t)});class eo extends Oe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===B.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:(s)=>{if(J(n,s),s.fatal)t.abort();else t.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){let s=r.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async(i)=>{if(t.value==="aborted")return me;let a=await this._def.schema._parseAsync({data:i,path:n.path,parent:n});if(a.status==="aborted")return me;if(a.status==="dirty")return Zi(a.value);if(t.value==="dirty")return Zi(a.value);return a});else{if(t.value==="aborted")return me;let i=this._def.schema._parseSync({data:s,path:n.path,parent:n});if(i.status==="aborted")return me;if(i.status==="dirty")return Zi(i.value);if(t.value==="dirty")return Zi(i.value);return i}}if(r.type==="refinement"){let s=(i)=>{let a=r.refinement(i,o);if(n.common.async)return Promise.resolve(a);if(a instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(i.status==="aborted")return me;if(i.status==="dirty")t.dirty();return s(i.value),{status:t.value,value:i.value}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((i)=>{if(i.status==="aborted")return me;if(i.status==="dirty")t.dirty();return s(i.value).then(()=>({status:t.value,value:i.value}))})}if(r.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ks(s))return me;let i=r.transform(s.value,o);if(i instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((s)=>{if(!Ks(s))return me;return Promise.resolve(r.transform(s.value,o)).then((i)=>({status:t.value,value:i}))});Le.assertNever(r)}}eo.create=(e,t,n)=>new eo({schema:e,typeName:B.ZodEffects,effect:t,...ve(n)});eo.createWithPreprocess=(e,t,n)=>new eo({schema:t,effect:{type:"preprocess",transform:e},typeName:B.ZodEffects,...ve(n)});class fr extends Oe{_parse(e){if(this._getType(e)===q.undefined)return bn(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}fr.create=(e,t)=>new fr({innerType:e,typeName:B.ZodOptional,...ve(t)});class ts extends Oe{_parse(e){if(this._getType(e)===q.null)return bn(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ts.create=(e,t)=>new ts({innerType:e,typeName:B.ZodNullable,...ve(t)});class al extends Oe{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;if(t.parsedType===q.undefined)n=this._def.defaultValue();return this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}al.create=(e,t)=>new al({innerType:e,typeName:B.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...ve(t)});class cl extends Oe{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});if(Yc(r))return r.then((o)=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Hn(n.common.issues)},input:n.data})}));else return{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Hn(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}cl.create=(e,t)=>new cl({innerType:e,typeName:B.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...ve(t)});class xp extends Oe{_parse(e){if(this._getType(e)!==q.nan){let n=this._getOrReturnCtx(e);return J(n,{code:H.invalid_type,expected:q.nan,received:n.parsedType}),me}return{status:"valid",value:e.data}}}xp.create=(e)=>new xp({typeName:B.ZodNaN,...ve(e)});var Gae=Symbol("zod_brand");class Rg extends Oe{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class vp extends Oe{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});if(o.status==="aborted")return me;if(o.status==="dirty")return t.dirty(),Zi(o.value);else return this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();else{let r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});if(r.status==="aborted")return me;if(r.status==="dirty")return t.dirty(),{status:"dirty",value:r.value};else return this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(e,t){return new vp({in:e,out:t,typeName:B.ZodPipeline})}}class ll extends Oe{_parse(e){let t=this._def.innerType._parse(e),n=(r)=>{if(Ks(r))r.value=Object.freeze(r.value);return r};return Yc(t)?t.then((r)=>n(r)):n(t)}unwrap(){return this._def.innerType}}ll.create=(e,t)=>new ll({innerType:e,typeName:B.ZodReadonly,...ve(t)});function CF(e,t){let n=typeof e==="function"?e(t):typeof e==="string"?{message:e}:e;return typeof n==="string"?{message:n}:n}function DF(e,t={},n){if(e)return Ji.create().superRefine((r,o)=>{let s=e(r);if(s instanceof Promise)return s.then((i)=>{if(!i){let a=CF(t,r),c=a.fatal??n??!0;o.addIssue({code:"custom",...a,fatal:c})}});if(!s){let i=CF(t,r),a=i.fatal??n??!0;o.addIssue({code:"custom",...i,fatal:a})}return});return Ji.create()}var Wae={object:vt.lazycreate},B;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(B||(B={}));var qae=(e,t={message:`Input not instance of ${e.name}`})=>DF((n)=>n instanceof e,t),LF=Jr.create,MF=Ws.create,Vae=xp.create,Zae=qs.create,NF=Qc.create,Yae=Yi.create,Jae=yp.create,Xae=el.create,Qae=tl.create,ece=Ji.create,tce=Gs.create,nce=Do.create,rce=bp.create,oce=Xr.create,NA=vt.create,sce=vt.strictCreate,ice=nl.create,ace=Cg.create,cce=rl.create,lce=Lo.create,uce=Sp.create,dce=Ep.create,pce=Xi.create,fce=Xc.create,mce=ol.create,hce=sl.create,gce=Vs.create,_ce=il.create,yce=Qi.create,bce=eo.create,Sce=fr.create,Ece=ts.create,xce=eo.createWithPreprocess,vce=vp.create,wce=()=>LF().optional(),Ace=()=>MF().optional(),Tce=()=>NF().optional(),kce={string:(e)=>Jr.create({...e,coerce:!0}),number:(e)=>Ws.create({...e,coerce:!0}),boolean:(e)=>Qc.create({...e,coerce:!0}),bigint:(e)=>qs.create({...e,coerce:!0}),date:(e)=>Yi.create({...e,coerce:!0})};var Cce=me;function Oce(e){let t=e?.trim();return t?t:void 0}function wp(e){return e===void 0?void 0:String(e)}var Pce=D(()=>mr.preprocess(wp,mr.string().optional().transform(Oce))),Ice=D(()=>mr.preprocess(wp,mr.string().optional().transform((e)=>Re(e)))),Dce=D(()=>mr.preprocess(wp,mr.string().optional().transform((e)=>{if(Re(e))return!0;if(Tm(e))return!1;return}))),Lce=D(()=>FF());function UF(e){if(typeof e==="boolean")return e?"1":"0";return String(e)}var d={str:()=>Pce(),bool:()=>Ice(),triBool:()=>Dce(),int:(e)=>e?FF(e):Lce(),enum:(e)=>mr.preprocess(wp,mr.string().optional().transform((t)=>t!==void 0&&e.includes(t.trim())?t.trim():void 0))};function FF(e){return mr.preprocess(wp,mr.string().optional().transform((t)=>{if(t===void 0)return;if(e?.digitsOnly&&!/^[+-]?\d+$/.test(t.trim()))return;let n=pS(t);if(!Number.isFinite(n))return;if(e?.min!==void 0&&n<e.min)return;if(e?.max!==void 0&&n>e.max)return;return n}))}var Mce=d.str(),Nce=d.str(),Uce=d.str(),Fce=d.str(),zce=d.str(),$ce=d.str(),jce=d.str(),Hce=d.str(),Bce=d.str(),Kce=d.str(),Gce=d.str(),Wce=d.str(),qce=d.str(),Vce=d.str(),Zce=d.str(),Yce=d.str(),Jce=d.str(),Xce=d.str(),Qce=d.str(),ele=d.str(),tle=d.str(),nle=d.str(),rle=d.str(),ole=d.str(),sle=d.str(),ile=d.str(),ale=d.bool(),cle=d.bool(),lle=d.int({min:1}),ule=d.str(),dle=d.str(),ple=d.str(),fle=d.str(),mle=d.bool(),hle=d.bool(),gle=d.str(),_le=d.str(),yle=d.str(),ble=d.int({min:0}),Sle=d.int({min:0}),Ele=d.int(),xle=d.bool(),vle=d.int(),wle=d.bool(),Ale=d.bool(),Tle=d.bool(),kle=d.bool(),Cle=d.bool(),Rle=d.bool(),Ole=d.bool(),Ple=d.int({min:1,max:2147483647}),Ile=d.str(),Dle=d.str(),Lle=d.str(),Mle=d.str(),Nle=d.str(),Ule=d.str(),Fle=d.str(),zle=d.str(),$le=d.str(),jle=d.str();var FA={};Xt(FA,{ANT_CLAUDE_CODE_METRICS_ENDPOINT:()=>Xue,ANT_OTEL_EXPORTER_OTLP_ENDPOINT:()=>Gue,ANT_OTEL_EXPORTER_OTLP_HEADERS:()=>Wue,ANT_OTEL_EXPORTER_OTLP_PROTOCOL:()=>que,ANT_OTEL_LOGS_EXPORTER:()=>Vue,ANT_OTEL_METRICS_EXPORTER:()=>Zue,ANT_OTEL_RESOURCE_ATTRIBUTES:()=>Jue,ANT_OTEL_TRACES_EXPORTER:()=>Yue,BETA_TRACING_ENDPOINT:()=>Que,CLAUDE_CODE_BENCH_LIVE_COUNTS:()=>aue,CLAUDE_CODE_BYOC_ENABLE_DATADOG:()=>mue,CLAUDE_CODE_DATADOG_FLUSH_INTERVAL_MS:()=>pue,CLAUDE_CODE_DD_ERROR_TRACKING_FLUSH_INTERVAL_MS:()=>fue,CLAUDE_CODE_DEBUG_LOGS_DIR:()=>Gle,CLAUDE_CODE_DEBUG_LOG_LEVEL:()=>Kle,CLAUDE_CODE_DEBUG_REPAINTS:()=>Wle,CLAUDE_CODE_DIAGNOSTICS_FILE:()=>qle,CLAUDE_CODE_ENHANCED_TELEMETRY_BETA:()=>cue,CLAUDE_CODE_FRAME_TIMING_LOG:()=>eue,CLAUDE_CODE_FRAME_TIMING_SAMPLE_EVERY:()=>tue,CLAUDE_CODE_JSONL_TRANSCRIPT:()=>rue,CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH:()=>zue,CLAUDE_CODE_OTEL_DIAG_STDERR:()=>hue,CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS:()=>lue,CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS:()=>due,CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS:()=>uue,CLAUDE_CODE_PERFETTO_TRACE:()=>Xle,CLAUDE_CODE_PERFETTO_WRITE_INTERVAL_S:()=>Qle,CLAUDE_CODE_PROFILE_QUERY:()=>Jle,CLAUDE_CODE_PROFILE_STARTUP:()=>Yle,CLAUDE_CODE_SESSION_LOG:()=>nue,CLAUDE_CODE_TEE_SDK_STDOUT:()=>iue,CLAUDE_CODE_TERMINAL_RECORDING:()=>sue,CLAUDE_DEBUG:()=>Hle,CLAUDE_PTY_RECORD:()=>oue,DEBUG:()=>Ble,DEBUG_CLAUDE_AGENT_SDK:()=>Vle,DEBUG_SDK:()=>Zle,OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>Nue,OTEL_EXPORTER_OTLP_ENDPOINT:()=>bue,OTEL_EXPORTER_OTLP_HEADERS:()=>Sue,OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:()=>xue,OTEL_EXPORTER_OTLP_LOGS_HEADERS:()=>vue,OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:()=>wue,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:()=>Aue,OTEL_EXPORTER_OTLP_METRICS_HEADERS:()=>Tue,OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:()=>kue,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:()=>Cue,OTEL_EXPORTER_OTLP_PROTOCOL:()=>Eue,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:()=>Rue,OTEL_EXPORTER_OTLP_TRACES_HEADERS:()=>Oue,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:()=>Pue,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>Uue,OTEL_LOGS_EXPORTER:()=>_ue,OTEL_LOGS_EXPORT_INTERVAL:()=>Due,OTEL_LOG_ASSISTANT_RESPONSES:()=>jue,OTEL_LOG_RAW_API_BODIES:()=>Kue,OTEL_LOG_TOOL_CONTENT:()=>Hue,OTEL_LOG_TOOL_DETAILS:()=>Bue,OTEL_LOG_USER_PROMPTS:()=>$ue,OTEL_METRICS_EXPORTER:()=>gue,OTEL_METRIC_EXPORT_INTERVAL:()=>Iue,OTEL_RESOURCE_ATTRIBUTES:()=>Mue,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>Fue,OTEL_TRACES_EXPORTER:()=>yue,OTEL_TRACES_EXPORT_INTERVAL:()=>Lue});var Hle=d.bool(),Ble=d.str(),Kle=d.str(),Gle=d.str(),Wle=d.bool(),qle=d.str(),Vle=d.bool(),Zle=d.bool(),Yle=d.bool(),Jle=d.bool(),Xle=d.str(),Qle=d.int(),eue=d.str(),tue=d.int(),nue=d.str(),rue=d.str(),oue=d.str(),sue=d.str(),iue=d.bool(),aue=d.bool(),cue=d.bool(),lue=d.int(),uue=d.int(),due=d.int(),pue=d.int({min:1}),fue=d.int({min:1}),mue=d.bool(),hue=d.bool(),gue=d.str(),_ue=d.str(),yue=d.str(),bue=d.str(),Sue=d.str(),Eue=d.str(),xue=d.str(),vue=d.str(),wue=d.str(),Aue=d.str(),Tue=d.str(),kue=d.str(),Cue=d.str(),Rue=d.str(),Oue=d.str(),Pue=d.str(),Iue=d.int(),Due=d.int(),Lue=d.int(),Mue=d.str(),Nue=d.int({min:0}),Uue=d.int({min:0}),Fue=d.int({min:0}),zue=d.int({min:1,digitsOnly:!0}),$ue=d.bool(),jue=d.triBool(),Hue=d.bool(),Bue=d.bool(),Kue=d.bool(),Gue=d.str(),Wue=d.str(),que=d.str(),Vue=d.str(),Zue=d.str(),Yue=d.str(),Jue=d.str(),Xue=d.str(),Que=d.str();import{constants as R_e}from"fs";import{access as yk,readdir as O_e,readFile as P_e,readlink as I_e}from"fs/promises";import{homedir as D_e}from"os";import{delimiter as L_e,join as Zp}from"path";function Ap(e,t){let n=0;for(let r of e)n+=+!!t(r);return n}function ea(e){return[...new Set(e)]}function $F(){return"prod"}function jF(){if(process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL)return"-custom-oauth";switch($F()){case"local":return"-local-oauth";case"staging":return"-staging-oauth";case"prod":return""}}var ede=31536000;var Blt=Math.round(ede/86400),tde="user:inference",HF="user:profile",nde="org:create_api_key";var rde=[nde,HF],ode=[HF,tde,"user:sessions:claude_code","user:mcp_servers","user:file_upload"],Klt=ea([...rde,...ode]);var zF={BASE_API_URL:"https://api.anthropic.com",CONSOLE_AUTHORIZE_URL:"https://platform.claude.com/oauth/authorize",CLAUDE_AI_AUTHORIZE_URL:"https://claude.com/cai/oauth/authorize",CLAUDE_AI_ORIGIN:"https://claude.ai",TOKEN_URL:"https://platform.claude.com/v1/oauth/token",API_KEY_URL:"https://api.anthropic.com/api/oauth/claude_cli/create_api_key",ROLES_URL:"https://api.anthropic.com/api/oauth/claude_cli/roles",CONSOLE_SUCCESS_URL:"https://platform.claude.com/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code",CLAUDEAI_SUCCESS_URL:"https://platform.claude.com/oauth/code/success?app=claude-code",MANUAL_REDIRECT_URL:"https://platform.claude.com/oauth/code/callback",CLIENT_ID:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",DESIGN_CLIENT_ID:"59637612-477b-4836-a601-b0589eda7704",OAUTH_FILE_SUFFIX:"",MCP_PROXY_URL:"https://mcp-proxy.anthropic.com",MCP_PROXY_PATH:"/v1/mcp/{server_id}"};var sde=void 0;function ide(){let e=process.env.CLAUDE_LOCAL_OAUTH_API_BASE?.replace(/\/$/,"")??"http://localhost:8000",t=process.env.CLAUDE_LOCAL_OAUTH_APPS_BASE?.replace(/\/$/,"")??"http://localhost:4000",n=process.env.CLAUDE_LOCAL_OAUTH_CONSOLE_BASE?.replace(/\/$/,"")??"http://localhost:3000";return{BASE_API_URL:e,CONSOLE_AUTHORIZE_URL:`${n}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${t}/oauth/authorize`,CLAUDE_AI_ORIGIN:t,TOKEN_URL:`${e}/v1/oauth/token`,API_KEY_URL:`${e}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${e}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${n}/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code`,CLAUDEAI_SUCCESS_URL:`${n}/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`${n}/oauth/code/callback`,CLIENT_ID:"22422756-60c9-4084-8eb7-27705fd5cf9a",DESIGN_CLIENT_ID:"00000000-0000-4000-8000-000000000000",OAUTH_FILE_SUFFIX:"-local-oauth",MCP_PROXY_URL:"http://localhost:8205",MCP_PROXY_PATH:"/v1/toolbox/shttp/mcp/{server_id}"}}var ade=["https://beacon.claude-ai.staging.ant.dev","https://claude.fedstart.com","https://claude-staging.fedstart.com"];function BF(){let e=(()=>{switch($F()){case"local":return ide();case"staging":return sde??zF;case"prod":return zF}})(),t=process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL;if(t){let r=t.replace(/\/$/,"");if(!ade.includes(r))throw Error("CLAUDE_CODE_CUSTOM_OAUTH_URL is not an approved endpoint.");e={...e,BASE_API_URL:r,CONSOLE_AUTHORIZE_URL:`${r}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${r}/oauth/authorize`,CLAUDE_AI_ORIGIN:r,TOKEN_URL:`${r}/v1/oauth/token`,API_KEY_URL:`${r}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${r}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${r}/oauth/code/success?app=claude-code`,CLAUDEAI_SUCCESS_URL:`${r}/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`${r}/oauth/code/callback`,OAUTH_FILE_SUFFIX:"-custom-oauth"}}let n=process.env.CLAUDE_CODE_OAUTH_CLIENT_ID;if(n)e={...e,CLIENT_ID:n};return e}import*as Fe from"fs";import{appendFile as Bde,chmod as Kde,copyFile as Gde,link as Wde,lstat as qde,mkdir as Vde,open as hz,readdir as Zde,readFile as gz,readlink as Yde,realpath as Jde,rename as Xde,rmdir as Qde,rm as epe,stat as tpe,symlink as npe,unlink as rpe}from"fs/promises";import*as Qt from"path";import{appendFile as KA,mkdir as az,rename as cz,stat as Rde,symlink as Ode,unlink as GA}from"fs/promises";import{dirname as ul,join as Zs,resolve as Pde}from"path";var zA=globalThis.process?.getBuiltinModule?.("async_hooks"),KF=zA!==void 0,$A=zA?new zA.AsyncLocalStorage:{run:(e,t)=>t(),getStore:()=>{return}};function GF({writeBatch:e,sizeOf:t,flushIntervalMs:n=1000,maxBufferSize:r=100,maxBufferBytes:o=1/0,immediateMode:s=!1}){let i=[],a=0,c=null,l=null;function u(){if(c)clearTimeout(c),c=null}function p(_){try{e(_)}catch{}}function f(){if(l)p(l),l=null;if(i.length===0)return;p(i),i=[],a=0,u()}function m(){if(!c)c=setTimeout(f,n)}function h(){if(l){l.push(...i),i=[],a=0,u();return}let _=i;i=[],a=0,u(),l=_,setImmediate(()=>{let y=l;if(l=null,y)p(y)})}return{write(_){if(s){p([_]);return}if(i.push(_),a+=t(_),m(),i.length>=r||a>=o)h()},flush:f,dispose(){f()}}}function cde(e){if(typeof e==="function")return e;if(Symbol.asyncDispose in e)return()=>e[Symbol.asyncDispose]();return()=>e[Symbol.dispose]()}class jA{#e=new Set;#t=!1;get drainStarted(){return this.#t}register(e){let t=cde(e);this.#e.add(t);let n=()=>{this.#e.delete(t)};return Object.assign(n,{[Symbol.dispose]:n})}async drain(){this.#t=!0;let e=Array.from(this.#e);this.#e.clear(),await Promise.all(e.map(async(t)=>t()))}async[Symbol.asyncDispose](){await this.drain()}get sizeForTesting(){return this.#e.size}}class WF{cleanup=new jA;preExitFlush=new jA}var lde=new ft(()=>new WF);function ude(){return lde.of(Nt().host)}function Og(e){return ude().cleanup.register(e)}class VF{parsed=new Map;lookup(e){return this.parsed.get(e)}remember(e,t){this.parsed.set(e,t)}reset(){this.parsed.clear()}}var qF=new VF;function ZF(e){let t=qF.lookup(e);if(t!==void 0)return t;let n=dde(e);return qF.remember(e,n),n}function dde(e){if(!e||e.trim()==="")return null;let t=e.split(",").map((s)=>s.trim()).filter(Boolean);if(t.length===0)return null;let n=t.some((s)=>s.startsWith("!")),r=t.some((s)=>!s.startsWith("!"));if(n&&r)return null;let o=t.map((s)=>s.replace(/^!/,"").toLowerCase());return{include:n?[]:o,exclude:n?o:[],isExclusive:n}}function pde(e){let t=[],n=e.match(/^MCP server ["']([^"']+)["']/);if(n&&n[1])t.push("mcp"),t.push(n[1].toLowerCase());else{let s=e.match(/^([^:[]+):/);if(s&&s[1])t.push(s[1].trim().toLowerCase())}let r=e.match(/^\[([^\]]+)]/);if(r&&r[1])t.push(r[1].trim().toLowerCase());if(e.toLowerCase().includes("1p event:"))t.push("1p");let o=e.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(o&&o[1]){let s=o[1].trim().toLowerCase();if(s.length<30&&!s.includes(" "))t.push(s)}return Array.from(new Set(t))}function fde(e,t){if(!t)return!0;if(e.length===0)return!1;if(t.isExclusive)return!e.some((n)=>t.exclude.includes(n));else return e.some((n)=>t.include.includes(n))}function YF(e,t){if(!t)return!0;let n=pde(e);return fde(n,t)}function mde(e,t,n){if(e.destroyed||e.writableEnded)return!1;return e.write(t,n),!0}class HA{everWritten=!1;drainPromise=void 0;bytesQueued=0;bytesFlushed=0;notifyFlushProgress=void 0;notifyExternallyClocked=void 0;externallyClockedPromise=void 0;externallyClocked=!1;errored=!1;flushConfirmedPromise=void 0;flushCloseListener=void 0;markEverWritten(){this.everWritten=!0}recordQueued(e){this.bytesQueued+=e}recordFlushed(e){this.bytesFlushed+=e,this.notifyFlushProgress?.()}markErrored(){this.errored=!0,this.notifyFlushProgress?.()}outstandingBytes(){return process.stdout.destroyed||this.errored?0:this.bytesQueued-this.bytesFlushed}endStdoutOnce(){if(this.drainPromise===void 0){let e=process.stdout;if(e.isTTY||e.destroyed||e.writableEnded||!this.everWritten)return;this.drainPromise=new Promise((t)=>e.end(t))}return this.drainPromise}fullyFlushed(){if(this.flushConfirmedPromise===void 0)this.flushConfirmedPromise=new Promise((e)=>{let t=()=>{if(this.outstandingBytes()<=0)this.notifyFlushProgress=void 0,e()};this.notifyFlushProgress=t,this.flushCloseListener=t,process.stdout.once("close",t),t()});return this.flushConfirmedPromise}isExternallyClocked(){return this.externallyClocked}ensureExternallyClockedPromise(){return this.externallyClockedPromise??=new Promise((e)=>{this.notifyExternallyClocked=e})}markExternallyClocked(){this.externallyClocked=!0,this.ensureExternallyClockedPromise(),this.notifyExternallyClocked?.(),this.notifyExternallyClocked=void 0}reset(){if(this.flushCloseListener!==void 0)process.stdout.removeListener("close",this.flushCloseListener);Object.assign(this,new HA)}}var nut=new HA;function JF(e){mde(process.stderr,e)}var hde=/api[_-]?key|secret|token|password|passwd|credential|bearer|authorization|auth[_-]?header|cookie|session[_-]?(?:id|key)|connection[_-]?string|(?:private|ssh|encryption|signing|access|deploy|master|license)[_-]?key|client[_-]?secret/i,XF="[^\\s,;&}\\])]+",QF=`"[^"]*"|'[^']*'|[^\\s-]{0,4}\\[REDACTED\\]['"\`]?|(?:Bearer|Basic)\\s+(?:\\[REDACTED\\]|${XF})|${XF}`,gde=["sk","ant","api"].join("-"),to="[\\w=-]{20,}(?:\\.[0-9a-z]{9})?",rz=[{id:"url-userinfo",source:":\\/\\/([^/@\\s]+)@",confidence:"low"},{id:"gcp-service-account",source:"\\b([a-z0-9-]+@[a-z0-9-]+\\.iam\\.gserviceaccount\\.com)\\b",flags:"i",confidence:"low"},{id:"loose-anthropic-key",source:"\\b(sk-ant-?[\\w-]{10,})",confidence:"low"},{id:"http-auth-scheme",source:"\\b(?:Bearer|Basic)\\s+([A-Za-z0-9+/=._~-]{20,})",flags:"i",confidence:"low"},{id:"loose-jwt",source:"\\b(eyJ[A-Za-z0-9_-]{10,}\\.[A-Za-z0-9_-]{10,}\\.[A-Za-z0-9_-]{10,})",confidence:"low"},{id:"sensitive-assign",source:`(?:${hde.source})[\\w.-]*["']?\\s*[=:]\\s*(${QF})`,flags:"i",confidence:"low"},{id:"cloud-env-var",source:`\\b(?:AWS|GOOGLE|GCP|GCLOUD|AZURE)_\\w+\\s*[=:]\\s*(${QF})`,flags:"i",confidence:"low"},{id:"aws-access-token",source:"\\b((?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})\\b",confidence:"high"},{id:"gcp-api-key",source:"\\b(AIza[\\w-]{35})(?![\\w-])",confidence:"high"},{id:"google-oauth-client-secret",source:"\\bGOCSPX-[\\w-]{28}(?![\\w-])",confidence:"high"},{id:"azure-ad-client-secret",source:`(?:^|[\\\\'"\\x60\\s>=:(,)])([a-zA-Z0-9_~.]{3}\\dQ~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'"\\x60\\s<),])`,confidence:"high"},{id:"digitalocean-pat",source:`\\b(dop_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"digitalocean-access-token",source:`\\b(doo_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-api-key",source:`\\b(${gde}03-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-admin-api-key",source:`\\b(sk-ant-admin01-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-oauth-token",source:`\\b(sk-ant-(?:oat|ort)\\d{2}-[\\w-]{20,})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"openai-api-key",source:"sk-[A-Za-z0-9_-]{8,200}T3BlbkFJ[A-Za-z0-9_-]{8,200}",confidence:"high"},{id:"openai-legacy-api-key",source:"\\bsk-[a-zA-Z0-9]{48}(?![a-zA-Z0-9])",confidence:"high"},{id:"huggingface-access-token",source:`\\b(hf_[a-zA-Z]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"supabase-secret-key",source:"\\bsb_secret_[A-Za-z0-9_-]{20,}",confidence:"high"},{id:"supabase-access-token",source:"\\bsbp_[a-z0-9]{40,}",confidence:"high"},{id:"github-pat",source:"ghp_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-fine-grained-pat",source:"github_pat_\\w{82}",confidence:"high"},{id:"github-app-token",source:"(?:ghu|ghs)_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-oauth",source:"gho_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-refresh-token",source:"ghr_[0-9a-zA-Z]{36}",confidence:"high"},{id:"gitlab-pat",source:`glpat-${to}`,confidence:"high"},{id:"gitlab-deploy-token",source:`gldt-${to}`,confidence:"high"},{id:"gitlab-runner-authentication-token",source:`glrt-${to}`,confidence:"high"},{id:"gitlab-oauth-app-secret",source:`gloas-${to}`,confidence:"high"},{id:"gitlab-pipeline-trigger-token",source:`glptt-${to}`,confidence:"high"},{id:"gitlab-kubernetes-agent-token",source:`glagent-${to}`,confidence:"high"},{id:"gitlab-incoming-mail-token",source:`glimt-${to}`,confidence:"high"},{id:"gitlab-scim-oauth-token",source:`glsoat-${to}`,confidence:"high"},{id:"gitlab-ci-build-token",source:`glcbt-${to}`,confidence:"high"},{id:"gitlab-feed-token",source:`glft-${to}`,confidence:"high"},{id:"gitlab-feature-flag-client-token",source:`glffct-${to}`,confidence:"high"},{id:"slack-bot-token",source:"xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*",confidence:"high"},{id:"slack-user-token",source:"xox[a-z](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}",confidence:"high"},{id:"slack-rotation-token",source:"xoxe(?:\\.xox[a-z])?-[0-9]-[A-Za-z0-9-]{28,}",confidence:"high"},{id:"slack-app-token",source:"xapp-\\d-[A-Z0-9]+-\\d+-[a-z0-9]+",flags:"i",confidence:"high"},{id:"slack-workflow-token",source:"\\bxwfp-[a-zA-Z0-9-]{20,}",confidence:"high"},{id:"slack-webhook-url",source:"(?:https?://)?hooks\\.slack\\.com/(?:services|workflows|triggers)/[A-Za-z0-9+/_-]{40,}",flags:"i",confidence:"high"},{id:"twilio-api-key",source:"SK[0-9a-fA-F]{32}",confidence:"high"},{id:"sendgrid-api-token",source:`\\b(SG\\.[a-zA-Z0-9=_\\-.]{66})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"npm-access-token",source:`\\b(npm_[a-zA-Z0-9]{36})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"pypi-upload-token",source:"pypi-AgEIcHlwaS5vcmc[\\w-]{50,1000}",confidence:"high"},{id:"databricks-api-token",source:`\\b(dapi[a-f0-9]{32}(?:-\\d)?)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"hashicorp-tf-api-token",source:"[a-zA-Z0-9]{14}\\.atlasv1\\.[a-zA-Z0-9\\-_=]{60,70}",confidence:"high"},{id:"pulumi-api-token",source:`\\b(pul-[a-f0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"postman-api-token",source:`\\b(PMAK-[a-fA-F0-9]{24}-[a-fA-F0-9]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-api-key",source:`\\b(eyJrIjoi[A-Za-z0-9+/]{70,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-cloud-api-token",source:`\\b(glc_[A-Za-z0-9+/]{32,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-service-account-token",source:`\\b(glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"sentry-user-token",source:`\\b(sntryu_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"sentry-org-token",source:"\\bsntrys_eyJpYXQiO[a-zA-Z0-9+/]{10,200}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10,200}={0,2}_[a-zA-Z0-9+/]{43}",confidence:"high"},{id:"stripe-access-token",source:`\\b((?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"shopify-access-token",source:"shpat_[a-fA-F0-9]{32}",confidence:"high"},{id:"shopify-shared-secret",source:"shpss_[a-fA-F0-9]{32}",confidence:"high"}],_de=64;function BA(e,t){let n=/-----BEGIN[ A-Z0-9_-]{0,100}?PRIVATE KEY(?: BLOCK)?-----/gi,r=/-----END[ A-Z0-9_-]{0,100}?PRIVATE KEY(?: BLOCK)?-----/gi;n.lastIndex=t;let o=n.exec(e);if(!o)return null;r.lastIndex=o.index+o[0].length+_de;let s=r.exec(e);if(!s)return null;return{start:o.index,end:s.index+s[0].length}}function yde(e){return BA(e,0)!==null}function bde(e){let t=BA(e,0);if(!t)return e;let n="",r=0;while(t)n+=e.slice(r,t.start)+"[REDACTED]",r=t.end,t=BA(e,r);return n+e.slice(r)}var ez=`(?:[\\x60'"\\s;]|\\\\[nr]|$)`,tz="(?=[^a-zA-Z0-9_\\-+=]|$)",Sde="(?<![a-zA-Z0-9_\\-])";function Ede(){return rz.map((e)=>({id:e.id,confidence:e.confidence,re:new RegExp(e.confidence!=="high"?e.source:Sde+(e.source.endsWith(ez)?e.source.slice(0,-ez.length)+tz:e.source+tz),(e.flags??"").replace("g","")+"g")}))}function nz(e){return rz.map((t)=>({id:t.id,confidence:t.confidence,re:new RegExp(t.source,e?(t.flags??"").replace("g","")+"g":t.flags??"")}))}function oz(e,t){if(typeof t!=="string")return"[REDACTED]";let n=t.length>=2&&(t[0]==='"'||t[0]==="'")&&t.at(-1)===t[0]?t[0]:"",r=e.lastIndexOf(t);return`${e.slice(0,r)}${n}[REDACTED]${n}${e.slice(r+t.length)}`}var xde=512,vde=512;class sz{testRules=null;redactRules=null;displayRules=null;resultCache=new Map;scan(e){this.testRules??=nz(!1);let t=[];for(let n of this.testRules)if(n.confidence==="high"&&n.re.test(e))t.push({ruleId:n.id,label:n.id.split("-").map((r)=>Cde[r]??Ru(r)).join(" ")});if(yde(e))t.push({ruleId:"private-key",label:"Private Key"});return t}redact(e){let t=e.length<=xde;if(t){let r=this.resultCache.get(e);if(r!==void 0)return r}this.redactRules??=nz(!0);let n=bde(e);for(let r of this.redactRules)n=n.replace(r.re,oz);if(t){if(this.resultCache.size>=vde)this.resultCache.delete(this.resultCache.keys().next().value);this.resultCache.set(e,n)}return n}redactForDisplay(e){this.displayRules??=Ede();let t=e;for(let n of this.displayRules){if(n.confidence!=="high")continue;t=t.replace(n.re,kde)}return t}}var wde=new sz;function iz(e){return wde.redact(e)}var Ade=/[$\x60|;&<>()\s]/,Tde=/[/.@:~*?\\]/;function kde(e,t){let n=typeof t==="string"?t:e;if(Ade.test(n)||Tde.test(n))return e;return oz(e,t)}var Cde={aws:"AWS",gcp:"GCP",api:"API",pat:"PAT",ad:"AD",tf:"TF",oauth:"OAuth",npm:"NPM",pypi:"PyPI",jwt:"JWT",ci:"CI",scim:"SCIM",github:"GitHub",gitlab:"GitLab",openai:"OpenAI",digitalocean:"DigitalOcean",huggingface:"HuggingFace",hashicorp:"HashiCorp",sendgrid:"SendGrid"};var WA={verbose:0,debug:1,info:2,warn:3,error:4},Ide=10485760;function Dde(e){return Object.hasOwn(WA,e)}function lz(e){return YP(e)?null:Pde(e)}function uz(){}var Lde={sessionId:"",fromBackend:!1};function dz(e,t,n,r){let o=Zs(t,"debug"),s=Zs(o,`${e.sessionId}.txt`),i;if(n===null)i=s;else if(r!==null&&n===r)i=Zs(r,`${e.sessionId}.txt`);else i=n;let a=!e.fromBackend&&i===s?"v5":"raw";return{target:i,arm:a,configHome:t,rotate:a==="raw"&&!(ul(i)===o&&i.endsWith(".txt"))}}function Mde(e,t=KF){return t?e:void 0}async function Nde(e,t,n){let r={namespace:"log",sessionId:t,channel:"debug"};return(await $A.run(!0,()=>e.append(r,[{data:n}]))).ok}class pz{deps;minLevel;filter;toStderr;filePath;runtimeDebugEnabled=!1;hasFormattedOutput=!1;debugFromLaunch;storageV5;writer=null;redirect=null;pendingWrite=Promise.resolve();unflushedChunks=[];backendLinesLogged=0;exiting=!1;exitHandlerRegistered=!1;successor=null;writtenBytes=-1;rotating=!1;resolvedLogPath=null;overrideDirectory=null;rotationTarget=null;latestSymlinkUpdated=!1;constructor(e){this.deps=e;if(this.storageV5=Mde(e.storageV5),e.launchIdentity!==void 0){this.minLevel=e.launchIdentity.minLevel,this.filter=e.launchIdentity.filter,this.toStderr=e.launchIdentity.toStderr,this.filePath=e.launchIdentity.filePath,this.debugFromLaunch=e.launchIdentity.debugFromLaunch;return}let t=Array.isArray(e.argv)?e.argv:[],n=t.indexOf("--"),r=n===-1?t:t.slice(0,n),o=e.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();this.minLevel=o&&Dde(o)?o:"debug";let s=r.find((a)=>a.startsWith("--debug="));this.filter=s?ZF(s.substring(8)):null,this.toStderr=r.includes("--debug-to-stderr")||r.includes("-d2e");let i=null;for(let a=0;a<r.length;a++){let c=r[a];if(c.startsWith("--debug-file=")){i=lz(c.substring(13));break}if(c==="--debug-file"&&a+1<r.length){i=lz(r[a+1]);break}}this.filePath=i,this.debugFromLaunch=Re(e.env.DEBUG)||Re(e.env.DEBUG_SDK)||r.includes("--debug")||r.includes("-d")||this.toStderr||s!==void 0||this.filePath!==null}isDebugMode(){return this.runtimeDebugEnabled||this.debugFromLaunch}launchIdentity(){return{minLevel:this.minLevel,filter:this.filter,toStderr:this.toStderr,filePath:this.filePath,debugFromLaunch:this.debugFromLaunch,isAnt:this.deps.isAnt,isTestEnvironment:this.deps.isTestEnvironment}}enableDebugLogging(){let e=this.isDebugMode()||this.deps.isAnt;return this.runtimeDebugEnabled=!0,e}logPath(){return this.filePath??(this.overrideDirectory!==null&&this.overrideDirectory===this.deps.env.CLAUDE_CODE_DEBUG_LOGS_DIR?Zs(this.overrideDirectory,`${this.deps.sessionId()}.txt`):null)??this.resolvedLogPath??this.deps.env.CLAUDE_CODE_DEBUG_LOGS_DIR??this.defaultLogPath()}defaultLogPath(e=this.deps.sessionId()){return Zs(this.deps.configHomeDir(),"debug",`${e}.txt`)}learnedOverrideDirectory(){return this.overrideDirectory}isArmed(){return this.storageV5!==void 0}log(e,{level:t}={level:"debug"}){if(WA[t]<WA[this.minLevel])return;if(!this.shouldLog(e))return;if(this.hasFormattedOutput&&e.includes(`
`))e=fe(e);let r=`${new Date().toISOString()} [${t.toUpperCase()}] ${iz(e.trim())}
`;if(this.toStderr){this.deps.writeToStderr(r);return}this.write(r)}write(e){let t=this.getWriter(),n=Lde;if(this.storageV5!==void 0){if(n={sessionId:this.deps.sessionId(),fromBackend:$A.getStore()===!0},n.fromBackend)this.backendLinesLogged++}if(t.write({origin:n,content:e}),this.exiting)t.flush()}async flush(){let e=this.backendLinesLogged;if(this.writer?.flush(),await this.pendingWrite,this.storageV5!==void 0&&this.successor)return this.successor.flush();for(let t=0;this.backendLinesLogged!==e&&t<3;t++)e=this.backendLinesLogged,this.writer?.flush(),await this.pendingWrite}dispose(e){this.redirect=e;try{this.writer?.dispose()}finally{this.redirect=null,this.writer=null}}succeed(e){this.runtimeDebugEnabled=e.runtimeDebugEnabled,this.hasFormattedOutput=e.hasFormattedOutput,this.pendingWrite=e.pendingWrite,this.unflushedChunks=e.unflushedChunks,this.exitHandlerRegistered=e.exitHandlerRegistered,e.successor=this,e.dispose((t)=>{this.write(t)})}handleExit(){if(this.successor){this.successor.handleExit();return}this.exiting=!0,this.writer?.flush(),this.drainSync()}async maybeRotate(e,t,n=Ide){if(this.writtenBytes<0)this.writtenBytes=await Rde(e).then((r)=>r.size).catch(()=>0);else this.writtenBytes+=t;if(this.writtenBytes<=n||this.rotating)return;this.rotating=!0;try{let r=e.endsWith(".txt")?`${e.slice(0,-4)}.1.txt`:`${e}.1`;try{await cz(e,r)}catch(o){if(!pr(o))await GA(r).catch(()=>{}),await cz(e,r).catch(()=>GA(e).catch(()=>{}))}this.writtenBytes=0}finally{this.rotating=!1}}shouldLog(e){if(this.deps.isTestEnvironment&&!this.toStderr&&this.filePath===null)return!1;if(!this.deps.isAnt&&!this.isDebugMode())return!1;if(typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;return YF(e,this.filter)}resolveDirToFile(e){return this.resolvedLogPath=Zs(e,`${this.deps.sessionId()}.txt`),this.resolvedLogPath}async appendGroup(e,t,n,r){if(this.storageV5!==void 0&&e.arm==="v5"){await this.appendV5AndMark(this.storageV5,t,n);return}if(r)await az(ul(e.target),{recursive:!0}).catch(()=>{});let o=e;try{await KA(e.target,n)}catch(s){if(!Ow(s))throw s;if(this.storageV5===void 0)o={...e,target:this.resolveDirToFile(e.target)},await KA(o.target,n);else{if(this.overrideDirectory=e.target,o=dz(t,e.configHome,e.target,e.target),o.arm==="v5"){await this.appendV5AndMark(this.storageV5,t,n);return}await az(ul(o.target),{recursive:!0}).catch(()=>{});try{await KA(o.target,n)}catch{return}}}if(o.rotate){if(this.storageV5!==void 0&&o.target!==this.rotationTarget)this.rotationTarget=o.target,this.writtenBytes=-1;await this.maybeRotate(o.target,Buffer.byteLength(n)).catch(uz)}this.markLatestSymlink()}async appendV5AndMark(e,t,n){if(await Nde(e,t.sessionId,n))this.markLatestSymlink()}markLatestSymlink(){if(!this.latestSymlinkUpdated)this.latestSymlinkUpdated=!0,this.updateLatestSymlink()}shiftUnflushedChunk(){this.unflushedChunks.shift()}drainSync(){if(this.unflushedChunks.length===0)return;let e=[];for(let t of this.unflushedChunks.splice(0)){let n=e.at(-1);if(n!==void 0&&n.armed===t.armed&&(!t.armed||n.target===t.target))n.parts.push(t);else e.push({target:t.target,armed:t.armed,parts:[t]})}for(let{target:t,armed:n,parts:r}of e){let o=n?t:this.logPath(),s=r.map((i)=>i.content).join("");try{Xe().mkdirSync(ul(o))}catch{}try{Xe().appendFileSync(o,s)}catch(i){if(Ow(i))try{if(!n)Xe().appendFileSync(this.resolveDirToFile(o),s);else{let a=(u,p)=>{try{Xe().appendFileSync(Zs(o,`${u}.txt`),p)}catch{}},c=r[0]?.sessionId,l="";for(let u of r){if(u.sessionId!==c)a(c,l),c=u.sessionId,l="";l+=u.content}a(c,l)}}catch{}}}}groupLines(e){let t=e[0];if(t===void 0)return[];if(this.storageV5===void 0)return[{decision:{target:this.logPath(),arm:"raw",configHome:"",rotate:!0},origin:t.origin,lines:e}];let n=[];for(let r of e){let o=n.at(-1);if(o!==void 0&&o.origin.sessionId===r.origin.sessionId&&o.origin.fromBackend===r.origin.fromBackend)o.lines.push(r);else n.push({decision:dz(r.origin,this.deps.configHomeDir(),this.filePath??this.deps.env.CLAUDE_CODE_DEBUG_LOGS_DIR??null,this.overrideDirectory),origin:r.origin,lines:[r]})}return n}getWriter(){if(this.writer)return this.writer;let e=null,t=this.storageV5!==void 0;if(this.writer=GF({writeBatch:(n)=>{if(this.redirect){this.redirect(n.map((r)=>r.content).join(""));return}if(this.exiting){for(let r of this.groupLines(n))this.unflushedChunks.push({target:r.decision.target,sessionId:r.origin.sessionId,armed:t,content:r.lines.map((o)=>o.content).join("")});this.drainSync();return}for(let r of this.groupLines(n)){let o=r.lines.map((a)=>a.content).join(""),s=ul(r.decision.target),i=r.decision.arm==="raw"&&(r.origin.fromBackend||e!==s);if(r.decision.arm==="raw")e=s;this.unflushedChunks.push({target:r.decision.target,sessionId:r.origin.sessionId,armed:t,content:o}),this.pendingWrite=this.pendingWrite.then(this.appendGroup.bind(this,r.decision,r.origin,o,i)).catch(uz).then(this.shiftUnflushedChunk.bind(this))}},sizeOf:(n)=>n.content.length,flushIntervalMs:1000,maxBufferSize:100,immediateMode:this.isDebugMode()}),this.deps.registerCleanup(async()=>{this.writer?.dispose(),await this.pendingWrite}),!this.exitHandlerRegistered)this.exitHandlerRegistered=!0,this.deps.onExit(this.handleExit.bind(this));return this.writer}async updateLatestSymlink(){try{let e=this.logPath(),t=Zs(ul(e),"latest");await GA(t).catch(()=>{}),await Ode(e,t)}catch{}}}class fz{instance=void 0;init={};setInstance(e){this.instance=e}setInit(e){this.init=e}}var Ude=new ft(()=>new fz);function Fde(){return Ude.of(Nt().host)}function zde(e,t){return new pz({argv:process.argv,env:process.env,sessionId:()=>TA(),configHomeDir:()=>jt(),onExit:(n)=>{process.on("exit",n)},registerCleanup:(n)=>{Og(n)},writeToStderr:(n)=>{JF(n)},isAnt:t?.isAnt??!1,isTestEnvironment:t?.isTestEnvironment??!1,launchIdentity:t,storageV5:e.init.storageV5!==void 0&&e.init.configHome===jt()?e.init.storageV5:void 0})}function $de(){let e=Fde(),t=e.instance;if(t)return t;let n=zde(e);return e.setInstance(n),n}function de(e,t={level:"debug"}){$de().log(e,t)}var Tut=(()=>{let e=process.env.CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS;if(e!==void 0){let t=Number(e);if(!Number.isNaN(t)&&t>=0)return t}return 1/0})();var jde={[Symbol.dispose](){}};function Hde(){return jde}var Yt=Hde;function fe(e,t,n){let o=[];try{const r=Dt(o,Yt`JSON.stringify(${e})`,0);return JSON.stringify(e,t,n)}catch(s){var i=s,a=1}finally{Lt(o,i,a)}}var yt=(e,t)=>{let r=[];try{const n=Dt(r,Yt`JSON.parse(${e})`,0);return typeof t>"u"?JSON.parse(e):JSON.parse(e,t)}catch(o){var s=o,i=1}finally{Lt(r,s,i)}};function mz(e){return JSON.parse(e)}function ns(e,t){let r=[];try{const n=Dt(r,Yt`structuredClone(${e})`,0);return structuredClone(e,t)}catch(o){var s=o,i=1}finally{Lt(r,s,i)}}var ope="→",qA=process.platform==="win32"?/[\\/]+/:/\/+/;function YA(e){let t="";for(let r of e.split(/([\\/]+)/)){if(r==="."||r==="..")break;t+=r}let n=t.replace(/(?<=[^\\/])[\\/]+$/,"");return n===""?e:n}function spe(e){let t=Qt.join(e).replace(/(?<=[^\\/])[\\/]+$/,"");if(Bo(t)&&!Ei(t))return t;return YA(e)}function ipe(e){if(e.startsWith("\\\\"))return YA(e);let t=e.replace(/^\/+/,"/"),n=$b(t);if(n!==null)return n;return YA(e)}var ape=process.platform==="win32"?spe:ipe;function _z(e,t,n){let r=Cu(e);if(t.length===0||r||t.some((o)=>o==="."||o==="..")){if(n!==void 0&&(t.length>0||r))n(Qt.join(e,...t));return r?ape(e):e}return Qt.join(e,...t)}var Sz="\x00unverified-ancestry";function yz(e,t){if(t?.unreadableAncestry!=="unverified")return;let n=e!==void 0&&typeof e==="object"&&"errno"in e?e.errno:void 0;return n==="ENOENT"||n==="ENOTDIR"?void 0:Sz}function VA(e){return ZP(e)&&!_s(e)}function ZA(e,t){return t===void 0||t.every((n)=>VP(e,n))}function bz(e,t){return t===void 0||t.every((n)=>qP(e,n))}function cpe(e){if(e?.anchors!==void 0&&e.anchors.length>0)return e.anchors;return e?.anchor!==void 0?[e.anchor]:void 0}async function Ez(e){return Hb(e)||_s(e)||await upe(vz,e)!==void 0}function lpe(e,t,n){return dpe(xz(t,n),(r)=>{if(r.kind==="lstat")return e.lstatSync(r.path);return e.readlinkSync(r.path)})}function upe(e,t,n){return ppe(xz(t,n),(r)=>r.kind==="lstat"?e.lstat(r.path):e.readlink(r.path))}function dpe(e,t){let n;for(;;){let r=e.next(n);if(r.done)return r.value;try{n=t(r.value)}catch(o){n={errno:De(o)}}}}async function ppe(e,t){let n;for(;;){let r=e.next(n);if(r.done)return r.value;try{n=await t(r.value)}catch(o){n={errno:De(o)}}}}function*xz(e,t){let n=cpe(t);if(Bo(e)&&!Ei(e)&&bz(e,n)||Ba(e)&&ZA(e,n))return;if(VA(e))return e;let r=Qt.resolve(e),o=Qt.parse(r).root,s=o,i=r.slice(o.length).split(qA).filter(Boolean),a=0,c=64;while(i.length>0&&a<c){let l=Qt.join(s,i[0]);if(Ba(l)&&ZA(l,n)||VA(l))return _z(l,i.slice(1),t?.onCollapsedLanding);let u=yield{kind:"lstat",path:l};if(u===void 0||typeof u==="string"||"errno"in u)return yz(u,t);if(!u.isSymbolicLink()){i.shift(),s=l;continue}a++;let f=yield{kind:"readlink",path:l};if(typeof f!=="string")return yz(f,t);let m=f;if(!Qt.isAbsolute(m)){i.shift(),i=[...m.split(qA).filter(Boolean),...i];continue}let h=m;if(Bo(h)&&!Ei(h)&&bz(h,n)||Ba(h)&&ZA(h,n)||VA(h))return i.shift(),_z(h,i,t?.onCollapsedLanding);if(t?.surfaceNetworkRaw===!0&&Cu(h))return i.shift(),i.length===0?h:h+Qt.sep+i.join(Qt.sep);i.shift();let y=Qt.parse(h).root||Qt.sep;s=y,i=[...h.slice(y.length).split(qA).filter(Boolean),...i]}if(i.length>0&&t?.surfaceNetworkRaw)return Sz;return}function Tp(e,t){if(Bo(t)&&!Ei(t)||Ba(t))return{resolvedPath:t,isSymlink:!1,isCanonical:!1};let n=lpe(e,t);if(n!==void 0)return{resolvedPath:n,isSymlink:!0,isCanonical:!1};try{let r=e.realpathSync(t);return{resolvedPath:r,isSymlink:r!==t,isCanonical:!0}}catch(r){return{resolvedPath:t,isSymlink:!1,isCanonical:!1}}}var vz={cwd(){return process.cwd()},existsSync(e){let n=[];try{const t=Dt(n,Yt`fs.existsSync(${e})`,0);return Fe.existsSync(e)}catch(r){var o=r,s=1}finally{Lt(n,o,s)}},async stat(e){return tpe(e)},async lstat(e){return qde(e)},async readdir(e){return Zde(e,{withFileTypes:!0})},async unlink(e){return rpe(e)},async rmdir(e){return Qde(e)},async rm(e,t){return epe(e,t)},async mkdir(e,t){try{await Vde(e,{recursive:!0,...t})}catch(n){if(De(n)!=="EEXIST")throw n}},async readFile(e,t){return gz(e,{encoding:t.encoding})},async rename(e,t){return Xde(e,t)},async realpath(e){return ct(await Jde(e))},async readlink(e){return Yde(e)},async copyFile(e,t){return Gde(e,t)},async appendFile(e,t,n){if(n?.mode!==void 0)try{let r=await hz(e,"ax",n.mode);try{await r.appendFile(t)}finally{await r.close()}return}catch(r){if(De(r)!=="EEXIST")throw r}return Bde(e,t)},async symlink(e,t,n){return npe(e,t,n)},async link(e,t){return Wde(e,t)},async chmod(e,t){return Kde(e,t)},statSync(e){let n=[];try{const t=Dt(n,Yt`fs.statSync(${e})`,0);return Fe.statSync(e)}catch(r){var o=r,s=1}finally{Lt(n,o,s)}},lstatSync(e){let n=[];try{const t=Dt(n,Yt`fs.lstatSync(${e})`,0);return Fe.lstatSync(e)}catch(r){var o=r,s=1}finally{Lt(n,o,s)}},readFileSync(e,t){let r=[];try{const n=Dt(r,Yt`fs.readFileSync(${e})`,0);return Fe.readFileSync(e,{encoding:t.encoding})}catch(o){var s=o,i=1}finally{Lt(r,s,i)}},readSync(e,t){let o=[];try{const n=Dt(o,Yt`fs.readSync(${e}, ${t.length} bytes)`,0);let r=void 0;try{r=Fe.openSync(e,"r");let c=Buffer.alloc(t.length),l=Fe.readSync(r,c,0,t.length,0);return{buffer:c,bytesRead:l}}finally{if(r)Fe.closeSync(r)}}catch(s){var i=s,a=1}finally{Lt(o,i,a)}},appendFileSync(e,t,n){let o=[];try{const r=Dt(o,Yt`fs.appendFileSync(${e}, ${t.length} chars)`,0);if(n?.mode!==void 0)try{let c=Fe.openSync(e,"ax",n.mode);try{Fe.appendFileSync(c,t)}finally{Fe.closeSync(c)}return}catch(c){if(De(c)!=="EEXIST")throw c}Fe.appendFileSync(e,t)}catch(s){var i=s,a=1}finally{Lt(o,i,a)}},unlinkSync(e){let n=[];try{const t=Dt(n,Yt`fs.unlinkSync(${e})`,0);Fe.unlinkSync(e)}catch(r){var o=r,s=1}finally{Lt(n,o,s)}},renameSync(e,t){let r=[];try{const n=Dt(r,Yt`fs.renameSync(${e} ${ope} ${t})`,0);Fe.renameSync(e,t)}catch(o){var s=o,i=1}finally{Lt(r,s,i)}},readlinkSync(e){let n=[];try{const t=Dt(n,Yt`fs.readlinkSync(${e})`,0);return Fe.readlinkSync(e)}catch(r){var o=r,s=1}finally{Lt(n,o,s)}},realpathSync(e){let n=[];try{const t=Dt(n,Yt`fs.realpathSync(${e})`,0);return ct(Fe.realpathSync(e))}catch(r){var o=r,s=1}finally{Lt(n,o,s)}},mkdirSync(e,t){let o=[];try{const n=Dt(o,Yt`fs.mkdirSync(${e})`,0);let r={recursive:!0};if(t?.mode!==void 0)r.mode=t.mode;try{Fe.mkdirSync(e,r)}catch(c){if(De(c)!=="EEXIST")throw c}}catch(s){var i=s,a=1}finally{Lt(o,i,a)}},readdirSync(e){let n=[];try{const t=Dt(n,Yt`fs.readdirSync(${e})`,0);return Fe.readdirSync(e,{withFileTypes:!0})}catch(r){var o=r,s=1}finally{Lt(n,o,s)}},rmSync(e,t){let r=[];try{const n=Dt(r,Yt`fs.rmSync(${e})`,0);Fe.rmSync(e,t)}catch(o){var s=o,i=1}finally{Lt(r,s,i)}},createWriteStream(e){return Fe.createWriteStream(e)},async readFileBytes(e,t){if(t===void 0)return gz(e);let n=await hz(e,"r");try{let{size:r}=await n.stat(),o=Math.min(r,t),s=Buffer.allocUnsafe(o),i=0;while(i<o){let{bytesRead:a}=await n.read(s,i,o-i,i);if(a===0)break;i+=a}return i<o?s.subarray(0,i):s}finally{await n.close()}}};function Xe(){return vz}import{readdir as Edt,readFile as Oz}from"fs/promises";import{release as Spe}from"os";var fpe="channel",Mut=`<${fpe} source="`;import wt from"node:path";import wz from"node:os";import JA from"node:process";var Ys=wz.homedir(),XA=wz.tmpdir(),{env:dl}=JA,mpe=(e)=>{let t=wt.join(Ys,"Library");return{data:wt.join(t,"Application Support",e),config:wt.join(t,"Preferences",e),cache:wt.join(t,"Caches",e),log:wt.join(t,"Logs",e),temp:wt.join(XA,e)}},hpe=(e)=>{let t=dl.APPDATA||wt.join(Ys,"AppData","Roaming"),n=dl.LOCALAPPDATA||wt.join(Ys,"AppData","Local");return{data:wt.join(n,e,"Data"),config:wt.join(t,e,"Config"),cache:wt.join(n,e,"Cache"),log:wt.join(n,e,"Log"),temp:wt.join(XA,e)}},gpe=(e)=>{let t=wt.basename(Ys);return{data:wt.join(dl.XDG_DATA_HOME||wt.join(Ys,".local","share"),e),config:wt.join(dl.XDG_CONFIG_HOME||wt.join(Ys,".config"),e),cache:wt.join(dl.XDG_CACHE_HOME||wt.join(Ys,".cache"),e),log:wt.join(dl.XDG_STATE_HOME||wt.join(Ys,".local","state"),e),temp:wt.join(XA,t,e)}};function QA(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(JA.platform==="darwin")return mpe(e);if(JA.platform==="win32")return hpe(e);return gpe(e)}function eT(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return t}var qut=QA("claude-cli");function ype(){if(process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC)return"essential-traffic";if(process.env.DISABLE_TELEMETRY)return"no-telemetry";if(Re(process.env.DO_NOT_TRACK))return"no-telemetry";return"default"}function Az(){return ype()==="essential-traffic"}var bpe=100;class kz{recentErrors=[];queue=[];sink=null;hardFailMode=void 0;remember(e){if(this.recentErrors.length>=bpe)this.recentErrors.shift();this.recentErrors.push(e)}dispatch(e){if(this.sink===null){this.queue.push(e);return}switch(e.type){case"error":this.sink.logError(e.error);break;case"mcpError":this.sink.logMCPError(e.serverName,e.error);break;case"mcpDebug":this.sink.logMCPDebug(e.serverName,e.message);break}}attachSink(e){if(this.sink!==null)return;this.sink=e;let t=this.queue;this.queue=[];for(let n of t)this.dispatch(n)}isHardFailMode(){return this.hardFailMode??=process.argv.includes("--hard-fail"),this.hardFailMode}reset(){this.recentErrors=[],this.queue=[],this.sink=null,this.hardFailMode=void 0}}var Tz=new kz;function Pg(e){let t=Or(e);try{if(Re(process.env.CLAUDE_CODE_USE_BEDROCK)||Re(process.env.CLAUDE_CODE_USE_VERTEX)||Re(process.env.CLAUDE_CODE_USE_FOUNDRY)||Re(process.env.CLAUDE_CODE_USE_ANTHROPIC_AWS)||Re(process.env.CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD)||Re(process.env.CLAUDE_CODE_USE_MANTLE)||process.env.DISABLE_ERROR_REPORTING||Az())return;let r={error:t.stack||t.message,timestamp:new Date().toISOString()};Tz.remember(r),Tz.dispatch({type:"error",error:t})}catch{}}function Cz(){try{return Xe().readFileSync("/proc/version",{encoding:"utf8"}).toLowerCase()}catch{return}}function Rz(e){return e.includes("microsoft")||e.includes("wsl")}class Pz{sources;primedProcVersion;fallbackProcVersion;fallbackProcVersionRead=!1;platform;wslVersion=null;macOSMajorVersion=null;linuxDistroInfo;constructor(e){this.sources=e}kernelString(){if(this.primedProcVersion!==void 0)return this.primedProcVersion;if(!this.fallbackProcVersionRead)this.fallbackProcVersion=this.sources.readProcVersionSync(),this.fallbackProcVersionRead=!0;return this.fallbackProcVersion}getPlatform(){if(this.platform!==void 0)return this.platform;try{if(this.sources.platform==="darwin")this.platform="macos";else if(this.sources.platform==="win32")this.platform="windows";else if(this.sources.platform==="linux")if(this.sources.env.WSL_DISTRO_NAME||this.sources.env.WSL_INTEROP)this.platform="wsl";else{let e=this.kernelString();this.platform=e!==void 0&&Rz(e)?"wsl":"linux"}else this.platform="unknown"}catch(e){Pg(e),this.platform="unknown"}return this.platform}getWslVersion(){if(this.wslVersion!==null)return this.wslVersion;if(this.sources.platform!=="linux"){this.wslVersion=void 0;return}let e=this.kernelString();if(e===void 0){this.wslVersion=void 0;return}let t=e.match(/wsl(\d+)/);if(t&&t[1])this.wslVersion=t[1];else if(e.includes("microsoft"))this.wslVersion="1";else this.wslVersion=void 0;return this.wslVersion}getMacOSMajorVersion(){if(this.macOSMajorVersion!==null)return this.macOSMajorVersion;if(this.sources.platform!=="darwin"){this.macOSMajorVersion=void 0;return}let e=this.sources.osRelease().match(/^(\d+)\./);return this.macOSMajorVersion=e&&e[1]?parseInt(e[1],10)-9:void 0,this.macOSMajorVersion}getLinuxDistroInfo(){return this.linuxDistroInfo??=this.readLinuxDistroInfo()}async readLinuxDistroInfo(){if(this.sources.platform!=="linux")return;let e={linuxKernel:this.sources.osRelease()};try{let t=await this.sources.readOsRelease();for(let n of t.split(`
`)){let r=n.match(/^(ID|VERSION_ID)=(.*)$/);if(r&&r[1]&&r[2]){let o=r[2].replace(/^"|"$/g,"");if(r[1]==="ID")e.linuxDistroId=o;else e.linuxDistroVersion=o}}}catch{}return e}async prime(){if(this.primedProcVersion!==void 0||this.sources.platform!=="linux")return;try{let e=await this.sources.readProcVersion();this.primedProcVersion=e.toLowerCase()}catch(e){de(`Failed to read /proc/version for WSL detection: ${e}`,{level:"error"});return}this.platform=void 0,this.wslVersion=null}}var Epe;function xpe(){return Epe??=new Pz({platform:process.platform,env:process.env,readProcVersionSync:Cz,readProcVersion:()=>Oz("/proc/version",{encoding:"utf8"}),osRelease:Spe,readOsRelease:()=>Oz("/etc/os-release","utf8")})}function rs(){return xpe().getPlatform()}import{isAbsolute as vpe}from"path";function wpe(e){let t=process.cwd();return e.filter((n)=>!ym(n,t))}function Iz(e){let t=Bun.which(e);if(!t||process.platform!=="win32")return t;if(vpe(e))return t;return wpe([t])[0]??null}var Dz=async(e)=>Iz(e),Lz=Iz;function Mz(){if(process.platform!=="linux")return!1;return Xe().existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")}function Nz(){if(process.platform!=="linux")return;try{return Xe().readFileSync("/sys/hypervisor/uuid",{encoding:"utf8"}).trim().toLowerCase()}catch{return}}function Uz(){if(process.platform!=="linux")return!1;return Xe().existsSync("/.dockerenv")}function M_e(){if(Xe().existsSync(Zp(jt(),".config.json")))return Zp(jt(),".config.json");let e=`.claude${jF()}.json`;return Zp(process.env.CLAUDE_CONFIG_DIR||D_e(),e)}async function N_e(){try{let{externalHttp:e}=await Promise.resolve().then(() => (uB(),lB));return await e.head("http://1.1.1.1",{signal:AbortSignal.timeout(1000)}),!0}catch{return!1}}async function U_e(){return null}async function kl(e){try{return!!await Dz(e)}catch{return!1}}async function F_e(){let e=[];if(await kl("npm"))e.push("npm");if(await kl("yarn"))e.push("yarn");if(await kl("pnpm"))e.push("pnpm");return e}async function z_e(){let e=[];if(await kl("bun"))e.push("bun");if(await kl("deno"))e.push("deno");if(await kl("node"))e.push("node");return e}var dB=["git","node","npm","npx","yarn","pnpm","bun","deno","tsc","python","python3","py","pip","uv","poetry","ruby","gem","bundle","rake","dotnet","msbuild","nuget","cl","nmake","cmake","ninja","make","gcc","g++","clang","cargo","rustc","go","java","javac","mvn","gradle","docker"],$_e=1000;async function j_e(e){try{return/appinstaller/i.test(await I_e(e))}catch{return!1}}async function H_e(e,t){let n=rs()==="windows",r=new Set(e),o=n?(process.env.PATHEXT??".COM;.EXE;.BAT;.CMD").toLowerCase().split(";").filter(Boolean):[],s=ea((process.env.PATH??"").split(L_e).map((i)=>i.replace(/^"|"$/g,"")).filter(Boolean));await Promise.all(s.map(async(i)=>{let a;try{a=await O_e(i,{withFileTypes:!0})}catch{return}let c=n&&/[\\/]microsoft[\\/]windowsapps[\\/]?$/i.test(i);for(let l of a){if(l.isDirectory())continue;let u=l.name;if(n){let p=u.toLowerCase(),f=p.lastIndexOf(".");if(f<=0||!o.includes(p.slice(f)))continue;u=p.slice(0,f)}if(!r.has(u)||t.has(u))continue;if(n){if(c&&await j_e(Zp(i,l.name)))continue}else try{await yk(Zp(i,l.name),R_e.X_OK)}catch{continue}t.add(u)}}))}async function B_e(){let e=new Set;try{await Er(H_e(dB,e),$_e,"build tool PATH scan timed out")}catch{}return dB.filter((t)=>e.has(t))}function K_e(e){try{if(!e.isWslEnvironment())return!1;let t=Lz("npm");if(t===null)return!1;return t.startsWith("/mnt/c/")}catch(t){return!1}}function G_e(){return process.env.__CFBundleIdentifier==="com.conductor.app"}var pB=["pycharm","intellij","webstorm","phpstorm","rubymine","clion","goland","rider","datagrip","appcode","dataspell","aqua","gateway","fleet","jetbrains","androidstudio"];function W_e(e){let t=e.toLowerCase();return t.includes("windsurf")||t.includes("devin.app")||t.includes("devin desktop")||t.includes("devin-desktop")||/appdata[\\/]local[\\/](programs[\\/])?devin[\\/]/.test(t)}function q_e(){if(process.env.CURSOR_TRACE_ID)return"cursor";let e=process.env.VSCODE_GIT_ASKPASS_MAIN?.toLowerCase()??"";if(e.includes("cursor"))return"cursor";if(W_e(e))return"windsurf";if(e.includes("antigravity"))return"antigravity";let t=process.env.__CFBundleIdentifier?.toLowerCase();if(t?.includes("vscodium"))return"codium";if(t?.includes("windsurf")||t?.includes("devin"))return"windsurf";if(t?.includes("com.google.android.studio"))return"androidstudio";if(t){for(let n of pB)if(t.includes(n))return n}if(process.env.VisualStudioVersion)return"visualstudio";if(process.env.TERMINAL_EMULATOR==="JetBrains-JediTerm")return"pycharm";if(process.env.TERM==="xterm-ghostty")return"ghostty";if(process.env.TERM?.includes("kitty"))return"kitty";if(process.env.TERM_PROGRAM){if(/^devin([ -]desktop)?$/i.test(process.env.TERM_PROGRAM))return"windsurf";return process.env.TERM_PROGRAM}if(process.env.TMUX)return"tmux";if(process.env.STY)return"screen";if(process.env.KONSOLE_VERSION)return"konsole";if(process.env.GNOME_TERMINAL_SERVICE)return"gnome-terminal";if(process.env.XTERM_VERSION)return"xterm";if(process.env.VTE_VERSION)return"vte-based";if(process.env.TERMINATOR_UUID)return"terminator";if(process.env.KITTY_WINDOW_ID)return"kitty";if(process.env.ALACRITTY_LOG)return"alacritty";if(process.env.TILIX_ID)return"tilix";if(process.env.WT_SESSION)return"windows-terminal";if(process.env.SESSIONNAME&&process.env.TERM==="cygwin")return"cygwin";if(process.env.MSYSTEM)return process.env.MSYSTEM.toLowerCase();if(process.env.ConEmuANSI||process.env.ConEmuPID||process.env.ConEmuTask)return"conemu";if(process.env.WSL_DISTRO_NAME)return`wsl-${process.env.WSL_DISTRO_NAME}`;if(hB())return"ssh-session";if(process.env.TERM){let n=process.env.TERM;if(n.includes("alacritty"))return"alacritty";if(n.includes("rxvt"))return"rxvt";if(n.includes("termite"))return"termite";return process.env.TERM}if(!process.stdout.isTTY)return"non-interactive";return null}class fB{sources;globalClaudeFile;internetAccess;packageManagers;runtimes;detectedBuildTools;wslEnvironment;npmFromWindowsPath;deploymentEnvironment;primedWslInteropExists;primedHypervisorUuid;primedDockerenvExists;fallbackWslInteropExists;fallbackHypervisorUuid;fallbackDockerenvExists;constructor(e){this.sources=e}getGlobalClaudeFile(){return this.globalClaudeFile??=M_e()}hasInternetAccess(){return this.internetAccess??=N_e()}getPackageManagers(){return this.packageManagers??=F_e()}getRuntimes(){return this.runtimes??=z_e()}getDetectedBuildTools(){return this.detectedBuildTools??=B_e()}isWslEnvironment(){return this.wslEnvironment??=this.primedWslInteropExists??(process.platform==="linux"?this.fallbackWslInteropExists??=this.sources.wslInteropExistsSync():!1)}isNpmFromWindowsPath(){return this.npmFromWindowsPath??=K_e(this)}hypervisorUuid(){return this.primedHypervisorUuid??(this.fallbackHypervisorUuid??=this.sources.readHypervisorUuidSync()??"")}isDockerenvPresent(){return this.primedDockerenvExists??(this.fallbackDockerenvExists??=this.sources.dockerenvExistsSync())}detectDeploymentEnvironment(){return this.deploymentEnvironment??=Z_e(this)}async prime(){if(this.primedWslInteropExists!==void 0||process.platform!=="linux")return;let[e,t,n]=await Promise.all([yk("/proc/sys/fs/binfmt_misc/WSLInterop").then(()=>!0,()=>!1),P_e("/sys/hypervisor/uuid",{encoding:"utf8"}).then((r)=>r.trim().toLowerCase(),()=>{return}),yk("/.dockerenv").then(()=>!0,()=>!1)]);this.primedWslInteropExists=e,this.primedHypervisorUuid=t??"",this.primedDockerenvExists=n,this.wslEnvironment=void 0,this.npmFromWindowsPath=void 0,this.deploymentEnvironment=void 0}}var V_e=new ft(()=>new fB({wslInteropExistsSync:Mz,readHypervisorUuidSync:Nz,dockerenvExistsSync:Uz}));function Tl(){return V_e.of(Nt().host)}function mB(){return Tl().detectDeploymentEnvironment()}function Z_e(e){if(Re(process.env.CODESPACES))return"codespaces";if(process.env.GITPOD_WORKSPACE_ID)return"gitpod";if(Re(process.env.CODER)||process.env.CODER_WORKSPACE_NAME)return"coder";if(Re(process.env.DEVPOD)||process.env.DEVPOD_WORKSPACE_UID)return"devpod";if(process.env.DAYTONA_WS_ID)return"daytona";if(Re(process.env.GOOGLE_CLOUD_WORKSTATIONS))return"gcp-cloud-workstations";if(process.env.C9_PID||process.env.C9_USER)return"aws-cloud9";if(process.env.REPL_ID||process.env.REPL_SLUG)return"replit";if(process.env.PROJECT_DOMAIN)return"glitch";if(Re(process.env.VERCEL))return"vercel";if(process.env.RAILWAY_ENVIRONMENT_NAME||process.env.RAILWAY_SERVICE_NAME)return"railway";if(Re(process.env.RENDER))return"render";if(Re(process.env.NETLIFY))return"netlify";if(process.env.DYNO)return"heroku";if(process.env.FLY_APP_NAME||process.env.FLY_MACHINE_ID)return"fly.io";if(Re(process.env.CF_PAGES))return"cloudflare-pages";if(process.env.DENO_DEPLOYMENT_ID)return"deno-deploy";if(process.env.AWS_LAMBDA_FUNCTION_NAME)return"aws-lambda";if(process.env.AWS_EXECUTION_ENV==="AWS_ECS_FARGATE")return"aws-fargate";if(process.env.AWS_EXECUTION_ENV==="AWS_ECS_EC2")return"aws-ecs";if(e.hypervisorUuid().startsWith("ec2"))return"aws-ec2";if(process.env.K_SERVICE)return"gcp-cloud-run";if(process.env.GOOGLE_CLOUD_PROJECT)return"gcp";if(process.env.WEBSITE_SITE_NAME||process.env.WEBSITE_SKU)return"azure-app-service";if(process.env.AZURE_FUNCTIONS_ENVIRONMENT)return"azure-functions";if(process.env.APP_URL?.includes("ondigitalocean.app"))return"digitalocean-app-platform";if(process.env.SPACE_CREATOR_USER_ID)return"huggingface-spaces";if(Re(process.env.GITHUB_ACTIONS))return"github-actions";if(Re(process.env.GITLAB_CI))return"gitlab-ci";if(process.env.CIRCLECI)return"circleci";if(process.env.BUILDKITE)return"buildkite";if(Re(!1))return"ci";if(process.env.KUBERNETES_SERVICE_HOST)return"kubernetes";if(e.isDockerenvPresent())return"docker";if(Yp.platform==="darwin")return"unknown-darwin";if(Yp.platform==="linux")return"unknown-linux";if(Yp.platform==="win32")return"unknown-win32";return"unknown"}function hB(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}var Yp={hasInternetAccess(){return Tl().hasInternetAccess()},probeInternalNetworkAccess:U_e,isCI:Re(!1),platform:["win32","darwin"].includes(process.platform)?process.platform:"linux",arch:process.arch,nodeVersion:process.version,terminal:q_e(),isSSH:hB,getPackageManagers(){return Tl().getPackageManagers()},getRuntimes(){return Tl().getRuntimes()},isRunningWithBun:Ga,isWslEnvironment(){return Tl().isWslEnvironment()},isNpmFromWindowsPath(){return Tl().isNpmFromWindowsPath()},isConductor:G_e,detectDeploymentEnvironment:mB};var bk={};Xt(bk,{CLAUDE_AX_PREPARK_MS:()=>X_e,CLAUDE_AX_SCREEN_READER:()=>Y_e,CLAUDE_AX_STARTUP_QUIET_MS:()=>J_e,CLAUDE_CHROME_CLASSIFIER_FLOOR:()=>Q_e,CLAUDE_CODE_ACCESSIBILITY:()=>Bbe,CLAUDE_CODE_ACT_DONT_REDERIVE:()=>Kbe,CLAUDE_CODE_ALT_SCREEN_FULL_REPAINT:()=>nye,CLAUDE_CODE_AMBER_ASTROLABE:()=>ybe,CLAUDE_CODE_ARTIFACT_ASSETS:()=>sSe,CLAUDE_CODE_ARTIFACT_COMMENTS:()=>Jbe,CLAUDE_CODE_ARTIFACT_COMMENTS_AUTOREACT:()=>Xbe,CLAUDE_CODE_ARTIFACT_COMMENT_FAST_ACK:()=>eSe,CLAUDE_CODE_ARTIFACT_COMMENT_FAST_ACK_FIXED:()=>tSe,CLAUDE_CODE_ARTIFACT_COMMENT_RESPONDER:()=>Qbe,CLAUDE_CODE_ARTIFACT_DB:()=>nSe,CLAUDE_CODE_ARTIFACT_DELETE:()=>rSe,CLAUDE_CODE_ARTIFACT_ROOM:()=>oSe,CLAUDE_CODE_ARTIFACT_TYPES:()=>iSe,CLAUDE_CODE_ARTIFACT_VERIFY:()=>aSe,CLAUDE_CODE_AUTO_CONNECT_IDE:()=>cSe,CLAUDE_CODE_BASALT_COVE:()=>iye,CLAUDE_CODE_BASH_OUTPUT_AUDIENCE_NOTE:()=>Ybe,CLAUDE_CODE_BASH_SANDBOX_SHOW_INDICATOR:()=>lSe,CLAUDE_CODE_BG_TASKS_REPORT_RUNNING:()=>aye,CLAUDE_CODE_BISON_CAIRN:()=>bbe,CLAUDE_CODE_BUBBLEWRAP:()=>uSe,CLAUDE_CODE_CHILD_SESSION:()=>dSe,CLAUDE_CODE_COLD_COMPACT:()=>pSe,CLAUDE_CODE_COWORK_FRAME_ARTIFACTS:()=>cye,CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING:()=>dye,CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION:()=>lye,CLAUDE_CODE_DISABLE_ADVISOR_TOOL:()=>pye,CLAUDE_CODE_DISABLE_AGENT_VIEW:()=>fye,CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN:()=>mye,CLAUDE_CODE_DISABLE_ARTIFACT:()=>hye,CLAUDE_CODE_DISABLE_ATTACHMENTS:()=>gye,CLAUDE_CODE_DISABLE_AUTO_MEMORY:()=>_ye,CLAUDE_CODE_DISABLE_BACKGROUND_TASKS:()=>yye,CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_DEFAULT:()=>bye,CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARD:()=>Sye,CLAUDE_CODE_DISABLE_BG_EXIT_HANDOFF:()=>Eye,CLAUDE_CODE_DISABLE_BUNDLED_SKILLS:()=>xye,CLAUDE_CODE_DISABLE_CLAUDE_API_SKILL:()=>vye,CLAUDE_CODE_DISABLE_CLAUDE_CODE_SKILL:()=>wye,CLAUDE_CODE_DISABLE_CLAUDE_MDS:()=>Aye,CLAUDE_CODE_DISABLE_CRON:()=>Tye,CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS:()=>kye,CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS:()=>Cye,CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY:()=>Rye,CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING:()=>Oye,CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS:()=>Pye,CLAUDE_CODE_DISABLE_LAUNCH_COMPOSER:()=>Iye,CLAUDE_CODE_DISABLE_MEMORY_BULK_INFLATE:()=>Dye,CLAUDE_CODE_DISABLE_MEMORY_MASS_DELETE_HOLD:()=>Lye,CLAUDE_CODE_DISABLE_MEMORY_PERIODIC_RESYNC:()=>Mye,CLAUDE_CODE_DISABLE_MEMORY_STREAM_LIST:()=>Nye,CLAUDE_CODE_DISABLE_MOUSE:()=>zye,CLAUDE_CODE_DISABLE_MOUSE_CLICKS:()=>$ye,CLAUDE_CODE_DISABLE_NESTED_CHAIN_IDLE:()=>jye,CLAUDE_CODE_DISABLE_NESTED_USER_REPAIR:()=>Hye,CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:()=>Bye,CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK:()=>Kye,CLAUDE_CODE_DISABLE_NOTIFICATION_PRESENCE_CHECK:()=>Gye,CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL:()=>Wye,CLAUDE_CODE_DISABLE_ORG_MEMORY:()=>qye,CLAUDE_CODE_DISABLE_PERMISSION_PROMPT_NOTIFY_HOOKS:()=>Uye,CLAUDE_CODE_DISABLE_POLICY_SKILLS:()=>Vye,CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP:()=>Zye,CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK:()=>Yye,CLAUDE_CODE_DISABLE_TERMINAL_TITLE:()=>Qye,CLAUDE_CODE_DISABLE_THINKING:()=>tbe,CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL:()=>nbe,CLAUDE_CODE_DISABLE_WORKFLOWS:()=>rbe,CLAUDE_CODE_ENABLE_APPEND_SUBAGENT_PROMPT:()=>sbe,CLAUDE_CODE_ENABLE_AWAY_SUMMARY:()=>ibe,CLAUDE_CODE_ENABLE_BACKGROUND_PLUGIN_REFRESH:()=>abe,CLAUDE_CODE_ENABLE_CFC:()=>cbe,CLAUDE_CODE_ENABLE_DESIGN_SYNC:()=>lbe,CLAUDE_CODE_ENABLE_EXPERIMENTAL_ADVISOR_TOOL:()=>ube,CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL:()=>dbe,CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING:()=>pbe,CLAUDE_CODE_ENABLE_LAUNCH_COMPOSER:()=>fbe,CLAUDE_CODE_ENABLE_MENU_KIND_LANES:()=>mbe,CLAUDE_CODE_ENABLE_NARRATION:()=>kbe,CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION:()=>Abe,CLAUDE_CODE_ENABLE_REFRESH_MCP_TOOLS:()=>Tbe,CLAUDE_CODE_ENABLE_REMOTE_RECAP:()=>Cbe,CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING:()=>Rbe,CLAUDE_CODE_ENABLE_TASKS:()=>Obe,CLAUDE_CODE_ENABLE_TODO_TOOLS:()=>Pbe,CLAUDE_CODE_ENABLE_TOKEN_USAGE_ATTACHMENT:()=>Ibe,CLAUDE_CODE_ENABLE_XAA:()=>Dbe,CLAUDE_CODE_EVAL_INTERVIEW_SESSION:()=>QSe,CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS:()=>fSe,CLAUDE_CODE_EXPERIMENTAL_OBSERVER_AGENTS:()=>mSe,CLAUDE_CODE_FLEETVIEW_SIMPLE:()=>hbe,CLAUDE_CODE_FORCE_MID_CONVERSATION_SYSTEM:()=>ESe,CLAUDE_CODE_FORCE_SESSION_PERSISTENCE:()=>bSe,CLAUDE_CODE_FORCE_STRIKETHROUGH:()=>SSe,CLAUDE_CODE_FORCE_WINDOWS_CREDMAN:()=>xSe,CLAUDE_CODE_FORK_SUBAGENT:()=>hSe,CLAUDE_CODE_FORWARD_SUBAGENT_TEXT:()=>vSe,CLAUDE_CODE_GAULT_KESTREL:()=>Ebe,CLAUDE_CODE_GB_DISK_CACHE_WHEN_TELEMETRY_OFF:()=>gbe,CLAUDE_CODE_GLOB_HIDDEN:()=>gSe,CLAUDE_CODE_GLOB_NO_IGNORE:()=>_Se,CLAUDE_CODE_GORSE_PLOVER:()=>xbe,CLAUDE_CODE_HARBOR_KITE:()=>Lbe,CLAUDE_CODE_HARBOR_KITE_CLOUD:()=>Nbe,CLAUDE_CODE_HARBOR_KITE_PACING_OFF:()=>Mbe,CLAUDE_CODE_HIDE_CWD:()=>ySe,CLAUDE_CODE_HOVER_REST:()=>_be,CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL:()=>wSe,CLAUDE_CODE_IDE_SKIP_VALID_CHECK:()=>ASe,CLAUDE_CODE_INCLUDE_PARTIAL_MESSAGES:()=>TSe,CLAUDE_CODE_INTRO_FRAME:()=>Gbe,CLAUDE_CODE_JUNIPER_SUNDIAL:()=>wbe,CLAUDE_CODE_KB_COHESION_FIXES:()=>Hbe,CLAUDE_CODE_LANTERN_PRISM:()=>Ube,CLAUDE_CODE_LARCH_CISTERN:()=>Sbe,CLAUDE_CODE_MEMORY_PUSH_DELETE_MODE:()=>Fye,CLAUDE_CODE_NANKEEN_KESTREL:()=>uye,CLAUDE_CODE_NATIVE_CURSOR:()=>kSe,CLAUDE_CODE_NEW_INIT:()=>CSe,CLAUDE_CODE_NO_FLICKER:()=>RSe,CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE:()=>OSe,CLAUDE_CODE_PARCHMENT_FERN:()=>vbe,CLAUDE_CODE_PEWTER_OWL:()=>uEe,CLAUDE_CODE_PEWTER_OWL_TOOL:()=>dEe,CLAUDE_CODE_PLAN_MODE_REQUIRED:()=>PSe,CLAUDE_CODE_PLUGIN_BINARY_ASSETS:()=>sEe,CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE:()=>oEe,CLAUDE_CODE_PLUGIN_PREFER_HTTPS:()=>aEe,CLAUDE_CODE_PLUGIN_USE_ZIP_CACHE:()=>iEe,CLAUDE_CODE_POLL_EVENTS:()=>ISe,CLAUDE_CODE_POWERSHELL_RESPECT_EXECUTION_POLICY:()=>cEe,CLAUDE_CODE_PRINT_ENGINE_LOOP:()=>DSe,CLAUDE_CODE_PROACTIVE:()=>LSe,CLAUDE_CODE_PROPAGATE_TRACEPARENT:()=>lEe,CLAUDE_CODE_REFUSAL_FALLBACK_CATCH_ALL:()=>Jye,CLAUDE_CODE_REPORT_FINDINGS:()=>Xye,CLAUDE_CODE_SEND_FEEDBACK:()=>ebe,CLAUDE_CODE_SILENT_TURN_REMINDER:()=>qbe,CLAUDE_CODE_SILENT_TURN_REMINDER_TEXT:()=>Zbe,CLAUDE_CODE_SILENT_TURN_REMINDER_TURNS:()=>Vbe,CLAUDE_CODE_SKILL_PROPOSALS:()=>MSe,CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS:()=>NSe,CLAUDE_CODE_SKIP_PLUGIN_MCP_SERVERS_EXCEPT:()=>USe,CLAUDE_CODE_SKIP_PROJECT_BACKFILL:()=>FSe,CLAUDE_CODE_SKIP_PROMPT_HISTORY:()=>zSe,CLAUDE_CODE_SKIP_REPO_UPLOAD:()=>$Se,CLAUDE_CODE_SUBAGENT_CACHE_EVICT:()=>jSe,CLAUDE_CODE_SUPPRESS_SESSION_ATTRIBUTION:()=>HSe,CLAUDE_CODE_SYNC_PLUGINS:()=>KSe,CLAUDE_CODE_SYNC_PLUGIN_INSTALL:()=>BSe,CLAUDE_CODE_SYNC_SKILLS:()=>GSe,CLAUDE_CODE_TAG_ISMETA_MESSAGES:()=>WSe,CLAUDE_CODE_THISTLE_GREBE:()=>rye,CLAUDE_CODE_THRIFTY_SONIC:()=>sye,CLAUDE_CODE_TOASTY_THIMBLE:()=>oye,CLAUDE_CODE_TODO_REMINDER_MODE:()=>Fbe,CLAUDE_CODE_TOTAL_TOKENS_REMINDER:()=>zbe,CLAUDE_CODE_TOTAL_TOKENS_REMINDER_AFTER_USER_TURN:()=>jbe,CLAUDE_CODE_TOTAL_TOKENS_REMINDER_BUDGET:()=>$be,CLAUDE_CODE_TRANSCRIPT_LOCAL_GC:()=>qSe,CLAUDE_CODE_TURN_UPDATES:()=>Wbe,CLAUDE_CODE_TWO_STAGE_CLASSIFIER:()=>VSe,CLAUDE_CODE_USE_COWORK_PLUGINS:()=>ZSe,CLAUDE_CODE_USE_NATIVE_FILE_SEARCH:()=>YSe,CLAUDE_CODE_USE_POWERSHELL_TOOL:()=>JSe,CLAUDE_CODE_WALNUT_SPIRE:()=>XSe,CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS:()=>tEe,CLAUDE_CODE_WEBFETCH_USE_CCR_PROXY:()=>nEe,CLAUDE_CODE_WEBSEARCH_USE_CCR_PROXY:()=>rEe,CLAUDE_CODE_WEB_FETCH_AGENT:()=>eEe,CLAUDE_CODE_WORKFLOWS:()=>obe,CLAUDE_CODE_WORKFLOW_PREFIX_STAGGER_MS:()=>yEe,CLAUDE_CODE_WORKFLOW_SIZE_WARNING_AGENTS:()=>gEe,CLAUDE_CODE_WORKFLOW_SIZE_WARNING_TOKENS:()=>_Ee,CLAUDE_DISABLE_ADOPT:()=>pEe,CLAUDE_IMPORT_CONVERSATIONS:()=>fEe,CLAUDE_PREVIEW_CLASSIFIER_FLOOR:()=>eye,CLAUDE_RUNNER_DISABLE_AWAITING_ACTION_OVERRIDE:()=>mEe,CLAUDE_WORKFLOW_NAME_ONLY:()=>hEe,DISABLE_AUTOUPDATER:()=>SEe,DISABLE_AUTO_COMPACT:()=>bEe,DISABLE_BRIEF_MODE_STOP_HOOK:()=>EEe,DISABLE_BUG_COMMAND:()=>xEe,DISABLE_COMPACT:()=>vEe,DISABLE_COST_WARNINGS:()=>wEe,DISABLE_DOCTOR_COMMAND:()=>AEe,DISABLE_ERROR_REPORTING:()=>TEe,DISABLE_EXTRA_USAGE_COMMAND:()=>kEe,DISABLE_FEEDBACK_COMMAND:()=>CEe,DISABLE_GROWTHBOOK:()=>REe,DISABLE_INSTALLATION_CHECKS:()=>PEe,DISABLE_INSTALL_GITHUB_APP_COMMAND:()=>OEe,DISABLE_INTERLEAVED_THINKING:()=>IEe,DISABLE_LOGIN_COMMAND:()=>DEe,DISABLE_LOGOUT_COMMAND:()=>LEe,DISABLE_PROMPT_CACHING:()=>MEe,DISABLE_PROMPT_CACHING_FABLE:()=>zEe,DISABLE_PROMPT_CACHING_HAIKU:()=>NEe,DISABLE_PROMPT_CACHING_MYTHOS:()=>$Ee,DISABLE_PROMPT_CACHING_OPUS:()=>UEe,DISABLE_PROMPT_CACHING_SONNET:()=>FEe,DISABLE_TELEMETRY:()=>jEe,DISABLE_UPDATES:()=>HEe,DISABLE_UPGRADE_COMMAND:()=>BEe,EMBEDDED_SEARCH_TOOLS:()=>ixe,ENABLE_BETA_TRACING_DETAILED:()=>KEe,ENABLE_CLAUDEAI_MCP_SERVERS:()=>GEe,ENABLE_ENHANCED_TELEMETRY_BETA:()=>WEe,ENABLE_LOCKLESS_UPDATES:()=>qEe,ENABLE_LSP_TOOL:()=>VEe,ENABLE_MCP_LARGE_OUTPUT_FILES:()=>ZEe,ENABLE_PID_BASED_VERSION_LOCKING:()=>YEe,ENABLE_PROMPT_CACHING_1H:()=>JEe,ENABLE_PROMPT_CACHING_1H_BEDROCK:()=>XEe,ENABLE_SESSION_BACKGROUNDING:()=>QEe,ENABLE_SESSION_PERSISTENCE:()=>exe,ENABLE_TOOL_SEARCH:()=>txe,FORCE_AUTOUPDATE_PLUGINS:()=>nxe,FORCE_CODE_TERMINAL:()=>rxe,FORCE_PROMPT_CACHING_5M:()=>oxe,FORCE_VCR:()=>sxe,INK_SCREEN_READER:()=>tye,USE_API_CONTEXT_MANAGEMENT:()=>axe});var Y_e=d.triBool(),J_e=d.int({min:0}),X_e=d.int({min:0}),Q_e=d.triBool(),eye=d.triBool(),tye=d.bool(),nye=d.bool(),rye=d.str(),oye=d.str(),sye=d.triBool(),iye=d.bool(),aye=d.bool(),cye=d.bool(),lye=d.bool(),uye=d.bool(),dye=d.bool(),pye=d.bool(),fye=d.bool(),mye=d.bool(),hye=d.bool(),gye=d.bool(),_ye=d.bool(),yye=d.bool(),bye=d.bool(),Sye=d.bool(),Eye=d.bool(),xye=d.bool(),vye=d.bool(),wye=d.bool(),Aye=d.bool(),Tye=d.bool(),kye=d.bool(),Cye=d.bool(),Rye=d.bool(),Oye=d.bool(),Pye=d.bool(),Iye=d.bool(),Dye=d.bool(),Lye=d.bool(),Mye=d.bool(),Nye=d.bool(),Uye=d.bool(),Fye=d.enum(["corroborate","immediate","never"]),zye=d.triBool(),$ye=d.triBool(),jye=d.bool(),Hye=d.bool(),Bye=d.bool(),Kye=d.bool(),Gye=d.bool(),Wye=d.bool(),qye=d.bool(),Vye=d.bool(),Zye=d.bool(),Yye=d.bool(),Jye=d.triBool(),Xye=d.bool(),Qye=d.bool(),ebe=d.triBool(),tbe=d.bool(),nbe=d.bool(),rbe=d.bool(),obe=d.triBool(),sbe=d.bool(),ibe=d.bool(),abe=d.bool(),cbe=d.triBool(),lbe=d.bool(),ube=d.bool(),dbe=d.bool(),pbe=d.bool(),fbe=d.bool(),mbe=d.bool(),hbe=d.bool(),gbe=d.bool(),_be=d.triBool(),ybe=d.bool(),bbe=d.bool(),Sbe=d.bool(),Ebe=d.bool(),xbe=d.bool(),vbe=d.bool(),wbe=d.int({min:1,digitsOnly:!0}),Abe=d.triBool(),Tbe=d.bool(),kbe=d.triBool(),Cbe=d.triBool(),Rbe=d.bool(),Obe=d.triBool(),Pbe=d.bool(),Ibe=d.bool(),Dbe=d.bool(),Lbe=d.bool(),Mbe=d.bool(),Nbe=d.bool(),Ube=d.bool(),Fbe=d.enum(["baseline","off"]),zbe=d.str(),$be=d.int(),jbe=d.triBool(),Hbe=d.bool(),Bbe=d.bool(),Kbe=d.triBool(),Gbe=d.triBool(),Wbe=d.triBool(),qbe=d.triBool(),Vbe=d.int({min:1}),Zbe=d.str(),Ybe=d.triBool(),Jbe=d.triBool(),Xbe=d.triBool(),Qbe=d.triBool(),eSe=d.triBool(),tSe=d.triBool(),nSe=d.triBool(),rSe=d.triBool(),oSe=d.triBool(),sSe=d.triBool(),iSe=d.triBool(),aSe=d.triBool(),cSe=d.triBool(),lSe=d.bool(),uSe=d.bool(),dSe=d.bool(),pSe=d.bool(),fSe=d.bool(),mSe=d.bool(),hSe=d.triBool(),gSe=d.bool(),_Se=d.bool(),ySe=d.bool(),bSe=d.bool(),SSe=d.bool(),ESe=d.bool(),xSe=d.str(),vSe=d.bool(),wSe=d.bool(),ASe=d.bool(),TSe=d.bool(),kSe=d.bool(),CSe=d.bool(),RSe=d.triBool(),OSe=d.bool(),PSe=d.bool(),ISe=d.bool(),DSe=d.bool(),LSe=d.bool(),MSe=d.bool(),NSe=d.bool(),USe=d.str(),FSe=d.bool(),zSe=d.bool(),$Se=d.bool(),jSe=d.bool(),HSe=d.bool(),BSe=d.bool(),KSe=d.bool(),GSe=d.bool(),WSe=d.bool(),qSe=d.triBool(),VSe=d.bool(),ZSe=d.bool(),YSe=d.bool(),JSe=d.bool(),XSe=d.bool(),QSe=d.bool(),eEe=d.triBool(),tEe=d.int({min:1,digitsOnly:!0}),nEe=d.bool(),rEe=d.bool(),oEe=d.bool(),sEe=d.bool(),iEe=d.bool(),aEe=d.bool(),cEe=d.bool(),lEe=d.bool(),uEe=d.triBool(),dEe=d.triBool(),pEe=d.bool(),fEe=d.bool(),mEe=d.bool(),hEe=d.bool(),gEe=d.int({min:1}),_Ee=d.int({min:1}),yEe=d.int({min:0}),bEe=d.bool(),SEe=d.bool(),EEe=d.bool(),xEe=d.bool(),vEe=d.bool(),wEe=d.bool(),AEe=d.bool(),TEe=d.bool(),kEe=d.bool(),CEe=d.bool(),REe=d.bool(),OEe=d.bool(),PEe=d.bool(),IEe=d.bool(),DEe=d.bool(),LEe=d.bool(),MEe=d.bool(),NEe=d.bool(),UEe=d.bool(),FEe=d.bool(),zEe=d.bool(),$Ee=d.bool(),jEe=d.bool(),HEe=d.bool(),BEe=d.bool(),KEe=d.bool(),GEe=d.bool(),WEe=d.bool(),qEe=d.bool(),VEe=d.bool(),ZEe=d.triBool(),YEe=d.triBool(),JEe=d.bool(),XEe=d.bool(),QEe=d.bool(),exe=d.bool(),txe=d.str(),nxe=d.bool(),rxe=d.bool(),oxe=d.bool(),sxe=d.bool(),ixe=d.bool(),axe=d.bool();var Sk={};Xt(Sk,{ALACRITTY_LOG:()=>gve,APPDATA:()=>Uxe,APP_URL:()=>Bwe,AWS_EXECUTION_ENV:()=>Pwe,AWS_LAMBDA_FUNCTION_NAME:()=>Owe,AZURE_FUNCTIONS_ENVIRONMENT:()=>Hwe,BAT_THEME:()=>Vwe,BROWSER:()=>Axe,BUILDKITE:()=>dwe,BUN_CHROME_PATH:()=>qwe,BUN_INSTALL:()=>Wwe,CF_PAGES:()=>Cwe,CI:()=>lwe,CIRCLECI:()=>uwe,CLOUDSDK_CONFIG:()=>zwe,CODER:()=>gwe,CODER_WORKSPACE_NAME:()=>_we,CODESPACES:()=>hwe,COLORFGBG:()=>Qxe,COLORTERM:()=>Xxe,COMSPEC:()=>gxe,CURSOR_TRACE_ID:()=>Lve,ComSpec:()=>yxe,ConEmuANSI:()=>kve,ConEmuPID:()=>Cve,ConEmuTask:()=>Rve,DAYTONA_WS_ID:()=>Swe,DEMO_VERSION:()=>eAe,DENO_DEPLOYMENT_ID:()=>Rwe,DISPLAY:()=>Txe,DO_NOT_TRACK:()=>eve,DYNO:()=>kwe,EDITOR:()=>vxe,FORCE_COLOR:()=>Jxe,GCLOUD_PROJECT:()=>Lwe,GCM_INTERACTIVE:()=>Hve,GH_ENTERPRISE_TOKEN:()=>qve,GH_HOST:()=>Wve,GH_TOKEN:()=>Gve,GITHUB_ACTIONS:()=>Xve,GITHUB_ACTION_INPUTS:()=>Qve,GITHUB_ACTION_PATH:()=>ewe,GITHUB_ACTOR:()=>twe,GITHUB_ACTOR_ID:()=>nwe,GITHUB_ENTERPRISE_TOKEN:()=>Zve,GITHUB_ENV:()=>Yve,GITHUB_EVENT_NAME:()=>rwe,GITHUB_EVENT_PATH:()=>owe,GITHUB_REPOSITORY:()=>swe,GITHUB_REPOSITORY_ID:()=>iwe,GITHUB_REPOSITORY_OWNER:()=>awe,GITHUB_REPOSITORY_OWNER_ID:()=>cwe,GITHUB_TOKEN:()=>Vve,GITHUB_WORKSPACE:()=>Jve,GITLAB_CI:()=>pwe,GITPOD_WORKSPACE_ID:()=>ywe,GIT_ASKPASS:()=>jve,GIT_CONFIG_COUNT:()=>Bve,GIT_CONFIG_GLOBAL:()=>Kve,GIT_SSH_COMMAND:()=>zve,GIT_TERMINAL_PROMPT:()=>$ve,GNOME_TERMINAL_SERVICE:()=>mve,GOOGLE_APPLICATION_CREDENTIALS:()=>Mwe,GOOGLE_CLOUD_PROJECT:()=>Dwe,GOOGLE_CLOUD_WORKSTATIONS:()=>bwe,HISTFILE:()=>Bxe,HOME:()=>cxe,INTELLIJ_TERMINAL_COMMAND_BLOCKS:()=>Ove,INTELLIJ_TERMINAL_COMMAND_BLOCKS_REWORKED:()=>Pve,IS_DEMO:()=>Qwe,IS_SANDBOX:()=>Xwe,ITERM_SESSION_ID:()=>uve,JAVA_HOME:()=>Vxe,JAVA_TOOL_OPTIONS:()=>Zxe,KITTY_WINDOW_ID:()=>dve,KONSOLE_VERSION:()=>pve,KUBERNETES_SERVICE_HOST:()=>Gwe,K_SERVICE:()=>Iwe,LANG:()=>Cxe,LC_ALL:()=>Rxe,LC_TERMINAL:()=>ove,LC_TIME:()=>Oxe,LOCALAPPDATA:()=>Fxe,MSYSTEM:()=>Tve,NETLIFY:()=>Twe,NODE_EXTRA_CA_CERTS:()=>Gxe,NODE_OPTIONS:()=>Kxe,NO_COLOR:()=>Yxe,NoDefaultCurrentDirectoryInExePath:()=>xxe,P4PORT:()=>Zwe,PATH:()=>lxe,PATHEXT:()=>Exe,PLAYWRIGHT_BROWSERS_PATH:()=>Ywe,PREFIX:()=>dxe,PROJECT_DOMAIN:()=>vwe,PWD:()=>uxe,ProgramFiles:()=>Sxe,RENDER:()=>Awe,REPL_ID:()=>Ewe,REPL_SLUG:()=>xwe,RUNNER_ENVIRONMENT:()=>mwe,RUNNER_OS:()=>fwe,SAFEUSER:()=>zxe,SESSIONNAME:()=>yve,SHELL:()=>hxe,SPACE_CREATOR_USER_ID:()=>Kwe,SSH_AUTH_SOCK:()=>Fve,SSH_CLIENT:()=>Mve,SSH_CONNECTION:()=>Nve,SSH_TTY:()=>Uve,SSL_CERT_FILE:()=>Wxe,STY:()=>bve,SUDO_GID:()=>Dxe,SUDO_UID:()=>Ixe,SUDO_USER:()=>Lxe,SYSTEMROOT:()=>_xe,SystemRoot:()=>bxe,TEMP:()=>mxe,TERM:()=>tve,TERMINAL:()=>sve,TERMINAL_EMULATOR:()=>ive,TERMINATOR_UUID:()=>ave,TERMUX_VERSION:()=>cve,TERM_PROGRAM:()=>nve,TERM_PROGRAM_VERSION:()=>rve,TILIX_ID:()=>lve,TMP:()=>fxe,TMPDIR:()=>pxe,TMUX:()=>Sve,TMUX_PANE:()=>Eve,TRACEPARENT:()=>tAe,TRACESTATE:()=>nAe,USER:()=>Pxe,USERNAME:()=>Mxe,USERPROFILE:()=>Nxe,USE_BUILTIN_RIPGREP:()=>Jwe,UV_THREADPOOL_SIZE:()=>qxe,VERCEL:()=>wwe,VISUAL:()=>wxe,VSCODE_GIT_ASKPASS_MAIN:()=>Dve,VTE_VERSION:()=>hve,WAYLAND_DISPLAY:()=>kxe,WEBSITE_SITE_NAME:()=>$we,WEBSITE_SKU:()=>jwe,WSL_DISTRO_NAME:()=>wve,WSL_INTEROP:()=>Ave,WT_SESSION:()=>_ve,XDG_CONFIG_HOME:()=>jxe,XDG_DATA_HOME:()=>Hxe,XDG_RUNTIME_DIR:()=>$xe,XTERM_VERSION:()=>fve,ZED_TERM:()=>vve,ZELLIJ:()=>xve,__CFBundleIdentifier:()=>Ive,gcloud_project:()=>Nwe,google_application_credentials:()=>Fwe,google_cloud_project:()=>Uwe});var cxe=d.str(),lxe=d.str(),uxe=d.str(),dxe=d.str(),pxe=d.str(),fxe=d.str(),mxe=d.str(),hxe=d.str(),gxe=d.str(),_xe=d.str(),yxe=d.str(),bxe=d.str(),Sxe=d.str(),Exe=d.str(),xxe=d.str(),vxe=d.str(),wxe=d.str(),Axe=d.str(),Txe=d.str(),kxe=d.str(),Cxe=d.str(),Rxe=d.str(),Oxe=d.str(),Pxe=d.str(),Ixe=d.int({min:0,digitsOnly:!0}),Dxe=d.int({min:0,digitsOnly:!0}),Lxe=d.str(),Mxe=d.str(),Nxe=d.str(),Uxe=d.str(),Fxe=d.str(),zxe=d.str(),$xe=d.str(),jxe=d.str(),Hxe=d.str(),Bxe=d.str(),Kxe=d.str(),Gxe=d.str(),Wxe=d.str(),qxe=d.str(),Vxe=d.str(),Zxe=d.str(),Yxe=d.str(),Jxe=d.str(),Xxe=d.str(),Qxe=d.str(),eve=d.str(),tve=d.str(),nve=d.str(),rve=d.str(),ove=d.str(),sve=d.str(),ive=d.str(),ave=d.str(),cve=d.str(),lve=d.str(),uve=d.str(),dve=d.str(),pve=d.str(),fve=d.str(),mve=d.str(),hve=d.str(),gve=d.str(),_ve=d.str(),yve=d.str(),bve=d.str(),Sve=d.str(),Eve=d.str(),xve=d.str(),vve=d.str(),wve=d.str(),Ave=d.str(),Tve=d.str(),kve=d.str(),Cve=d.str(),Rve=d.str(),Ove=d.str(),Pve=d.str(),Ive=d.str(),Dve=d.str(),Lve=d.str(),Mve=d.str(),Nve=d.str(),Uve=d.str(),Fve=d.str(),zve=d.str(),$ve=d.str(),jve=d.str(),Hve=d.str(),Bve=d.str(),Kve=d.str(),Gve=d.str(),Wve=d.str(),qve=d.str(),Vve=d.str(),Zve=d.str(),Yve=d.str(),Jve=d.str(),Xve=d.str(),Qve=d.str(),ewe=d.str(),twe=d.str(),nwe=d.str(),rwe=d.str(),owe=d.str(),swe=d.str(),iwe=d.str(),awe=d.str(),cwe=d.str(),lwe=d.str(),uwe=d.str(),dwe=d.str(),pwe=d.str(),fwe=d.str(),mwe=d.str(),hwe=d.str(),gwe=d.str(),_we=d.str(),ywe=d.str(),bwe=d.str(),Swe=d.str(),Ewe=d.str(),xwe=d.str(),vwe=d.str(),wwe=d.str(),Awe=d.str(),Twe=d.str(),kwe=d.str(),Cwe=d.str(),Rwe=d.str(),Owe=d.str(),Pwe=d.str(),Iwe=d.str(),Dwe=d.str(),Lwe=d.str(),Mwe=d.str(),Nwe=d.str(),Uwe=d.str(),Fwe=d.str(),zwe=d.str(),$we=d.str(),jwe=d.str(),Hwe=d.str(),Bwe=d.str(),Kwe=d.str(),Gwe=d.str(),Wwe=d.str(),qwe=d.str(),Vwe=d.str(),Zwe=d.str(),Ywe=d.str(),Jwe=d.str(),Xwe=d.str(),Qwe=d.str(),eAe=d.str(),tAe=d.str(),nAe=d.str();var Ek={};Xt(Ek,{AI_AGENT:()=>Ike,ALLOW_ANT_COMPUTER_USE_MCP:()=>Dke,ANTHROPIC_CONFIG_DIR:()=>rAe,BASH_MAX_OUTPUT_LENGTH:()=>WCe,CLAUBBIT:()=>Lke,CLAUDECODE:()=>Mke,CLAUDE_AFK_COUNTDOWN_MS:()=>qCe,CLAUDE_AFK_TIMEOUT_MS:()=>VCe,CLAUDE_AFTER_LAST_COMPACT:()=>oAe,CLAUDE_AGENTS_SELECT:()=>sAe,CLAUDE_AGENT_SDK_CLIENT_APP:()=>iAe,CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS:()=>Nke,CLAUDE_AGENT_SDK_MCP_NO_PREFIX:()=>Uke,CLAUDE_AGENT_SDK_VERSION:()=>aAe,CLAUDE_ASYNC_AGENT_STALL_TIMEOUT_MS:()=>ZCe,CLAUDE_AUTOCOMPACT_PCT_OVERRIDE:()=>cAe,CLAUDE_AUTO_BACKGROUND_TASKS:()=>Fke,CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR:()=>zke,CLAUDE_BG_AUTH_SNAPSHOT_PATH:()=>lAe,CLAUDE_BG_BACKEND:()=>uAe,CLAUDE_BG_CLAIM_AUTH:()=>dAe,CLAUDE_BG_ISOLATION:()=>pAe,CLAUDE_BG_MEMORY_TOGGLED_OFF:()=>fAe,CLAUDE_BG_POST_CLEAR_RESPAWN:()=>mAe,CLAUDE_BG_PTY_AUTH:()=>hAe,CLAUDE_BG_RENDEZVOUS_SOCK:()=>gAe,CLAUDE_BG_RV_AUTH:()=>_Ae,CLAUDE_BG_SESSION_PERMISSION_RULES:()=>yAe,CLAUDE_BG_SOCKET_TOKENS_PATH:()=>bAe,CLAUDE_BG_SOURCE:()=>SAe,CLAUDE_BG_STARTUP_WEDGE_MS:()=>YCe,CLAUDE_BG_TCC_DISCLAIMED:()=>EAe,CLAUDE_BRIDGE_BASE_URL:()=>xAe,CLAUDE_BRIDGE_OAUTH_TOKEN:()=>vAe,CLAUDE_BRIDGE_REATTACH_GROUPING:()=>wAe,CLAUDE_BRIDGE_REATTACH_NO_BACKFILL:()=>$ke,CLAUDE_BRIDGE_REATTACH_OUTBOUND_ONLY:()=>jke,CLAUDE_BRIDGE_REATTACH_OWNER_ACCT:()=>AAe,CLAUDE_BRIDGE_REATTACH_OWNER_ORG:()=>TAe,CLAUDE_BRIDGE_REATTACH_SEQ:()=>JCe,CLAUDE_BRIDGE_REATTACH_SESSION:()=>kAe,CLAUDE_BRIDGE_SESSION_INGRESS_URL:()=>CAe,CLAUDE_CHROME_PERMISSION_MODE:()=>RAe,CLAUDE_CLIENT_PRESENCE_FILE:()=>OAe,CLAUDE_CODE_ACTION:()=>PAe,CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD:()=>IAe,CLAUDE_CODE_ADDITIONAL_PROTECTION:()=>Hke,CLAUDE_CODE_ADOPT_UNDERIVABLE_PARKED_PERMISSION:()=>ACe,CLAUDE_CODE_AGENT:()=>DAe,CLAUDE_CODE_ARTIFACT:()=>LAe,CLAUDE_CODE_ARTIFACTS_API_BASE_URL:()=>NAe,CLAUDE_CODE_ARTIFACTS_API_TOKEN:()=>UAe,CLAUDE_CODE_ARTIFACT_ASSET_BASE_URL:()=>FAe,CLAUDE_CODE_ARTIFACT_AUTO_OPEN:()=>MAe,CLAUDE_CODE_ARTIFACT_LIVE_BASE_URL:()=>zAe,CLAUDE_CODE_ARTIFACT_SYNC_BASE_URL:()=>$Ae,CLAUDE_CODE_ARTIFACT_VIEWER_BASE_URL:()=>jAe,CLAUDE_CODE_AUTO_COMPACT_WINDOW:()=>HAe,CLAUDE_CODE_AUTO_MODE_EXTERNAL_PERMISSIONS:()=>Bke,CLAUDE_CODE_BASE_REF:()=>BAe,CLAUDE_CODE_BASE_REFS:()=>KAe,CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE:()=>GAe,CLAUDE_CODE_BRIDGE_MCP_CARRIER:()=>WAe,CLAUDE_CODE_BRIDGE_PROMPT_SHA256:()=>qAe,CLAUDE_CODE_BRIDGE_SESSION_ID:()=>VAe,CLAUDE_CODE_BRIEF:()=>Kke,CLAUDE_CODE_BRIEF_UPLOAD:()=>Gke,CLAUDE_CODE_CLASSIFIER_SUMMARY:()=>ZAe,CLAUDE_CODE_CONTAINER_ID:()=>YAe,CLAUDE_CODE_DAEMON_COLD_START:()=>Wke,CLAUDE_CODE_DECSTBM:()=>JAe,CLAUDE_CODE_DEV_RAW_CHANGELOG_URL:()=>XAe,CLAUDE_CODE_DIR_SYNC_DISABLE_ANCHORING:()=>QAe,CLAUDE_CODE_DIR_SYNC_GIT:()=>tTe,CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP:()=>qke,CLAUDE_CODE_DISABLE_DIR_SYNC:()=>eTe,CLAUDE_CODE_DISABLE_HOOK_FORWARDING:()=>nTe,CLAUDE_CODE_DISABLE_PLUGIN_FORWARDING:()=>rTe,CLAUDE_CODE_DISABLE_VITALS_EMITTER:()=>oTe,CLAUDE_CODE_DISABLE_WORKING_SYNC:()=>sTe,CLAUDE_CODE_DONT_INHERIT_ENV:()=>Vke,CLAUDE_CODE_DOWNLOAD_DEADLINE_MS_FOR_TESTING:()=>iTe,CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS:()=>Zke,CLAUDE_CODE_EMIT_TOOL_USE_SUMMARIES:()=>Yke,CLAUDE_CODE_ENTRYPOINT:()=>aTe,CLAUDE_CODE_ENVIRONMENT_KIND:()=>cTe,CLAUDE_CODE_ENVIRONMENT_RUNNER_VERSION:()=>lTe,CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER:()=>Jke,CLAUDE_CODE_EXIT_AFTER_STOP_DELAY:()=>XCe,CLAUDE_CODE_FORCE_BRIDGE:()=>Xke,CLAUDE_CODE_FORCE_EVALUATE_MEMORY:()=>Qke,CLAUDE_CODE_FORCE_FULLSCREEN_UPSELL:()=>eCe,CLAUDE_CODE_FORCE_FULL_LOGO:()=>tCe,CLAUDE_CODE_FORCE_MEMORY_SURVEY:()=>nCe,CLAUDE_CODE_FORCE_TIP_ID:()=>uTe,CLAUDE_CODE_GIT_BASH_PATH:()=>dTe,CLAUDE_CODE_GLOB_TIMEOUT_SECONDS:()=>QCe,CLAUDE_CODE_GOAL_CHECKIN_MINUTES:()=>eRe,CLAUDE_CODE_HIDE_SETTINGS_HINT:()=>pTe,CLAUDE_CODE_HOLD_REPORT_PARK_AT_INIT:()=>kCe,CLAUDE_CODE_HOLD_UNANSWERED_PARKED_PERMISSION:()=>wCe,CLAUDE_CODE_HOME_SEED_HOLD_TIMEOUT_MS:()=>fTe,CLAUDE_CODE_HOME_SEED_VERDICT_TIMEOUT_MS:()=>mTe,CLAUDE_CODE_HOST_PLATFORM:()=>hTe,CLAUDE_CODE_IDE_HOST_OVERRIDE:()=>gTe,CLAUDE_CODE_IDLE_THRESHOLD_MINUTES:()=>tRe,CLAUDE_CODE_IDLE_TOKEN_THRESHOLD:()=>nRe,CLAUDE_CODE_IS_COWORK:()=>rCe,CLAUDE_CODE_LOOP_KEEPALIVE:()=>oCe,CLAUDE_CODE_LOOP_PERSISTENT:()=>sCe,CLAUDE_CODE_MANAGED_SETTINGS_PATH:()=>_Te,CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS:()=>rRe,CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH:()=>oRe,CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION:()=>sRe,CLAUDE_CODE_MCP_ALLOWLIST_ENV:()=>yTe,CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS:()=>KRe,CLAUDE_CODE_MCP_MEMORY_CGROUP:()=>UCe,CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT:()=>BRe,CLAUDE_CODE_MOCK_REMOTE_SETTINGS:()=>iCe,CLAUDE_CODE_MOCK_TRIAL:()=>aCe,CLAUDE_CODE_OVERRIDE_DATE:()=>bTe,CLAUDE_CODE_PARKED_PERMISSION_WAIT_MS:()=>xCe,CLAUDE_CODE_PARKED_STOP_RETIRES:()=>TCe,CLAUDE_CODE_PERFORCE_MODE:()=>STe,CLAUDE_CODE_PLAN_V2_AGENT_COUNT:()=>iRe,CLAUDE_CODE_PLAN_V2_EXPLORE_AGENT_COUNT:()=>aRe,CLAUDE_CODE_PLUGIN_CACHE_DIR:()=>ETe,CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS:()=>cRe,CLAUDE_CODE_PLUGIN_SEED_DIR:()=>xTe,CLAUDE_CODE_POWERUP_ONBOARDING:()=>vTe,CLAUDE_CODE_PROJECT_DIR_NAME:()=>wTe,CLAUDE_CODE_PWSH_PARSE_TIMEOUT_MS:()=>lRe,CLAUDE_CODE_QUESTION_PREVIEW_FORMAT:()=>ATe,CLAUDE_CODE_RELAUNCH_TERMINAL_SIZE:()=>TTe,CLAUDE_CODE_REMOTE:()=>cCe,CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE:()=>kTe,CLAUDE_CODE_REMOTE_HERMETIC_MODE:()=>lCe,CLAUDE_CODE_REMOTE_MEMORY_DIR:()=>CTe,CLAUDE_CODE_REMOTE_RAW_EVENTS_FILE:()=>RTe,CLAUDE_CODE_REMOTE_SEND_KEEPALIVES:()=>uCe,CLAUDE_CODE_REMOTE_SESSION_ID:()=>OTe,CLAUDE_CODE_REMOTE_SESSION_ORIGIN:()=>PTe,CLAUDE_CODE_REMOTE_SETTINGS_PATH:()=>ITe,CLAUDE_CODE_REMOTE_SETTINGS_POLL_MS:()=>uRe,CLAUDE_CODE_REPL:()=>dCe,CLAUDE_CODE_REPO_CHECKOUTS:()=>DTe,CLAUDE_CODE_RESUME_FROM_SESSION:()=>LTe,CLAUDE_CODE_RESUME_INTERRUPTED_TURN:()=>pCe,CLAUDE_CODE_RESUME_INTERRUPTED_TURN_MAX_AGE_MS:()=>mCe,CLAUDE_CODE_RESUME_PROMPT:()=>MTe,CLAUDE_CODE_RESUME_SOURCE_ALIVE:()=>fCe,CLAUDE_CODE_RESUME_THRESHOLD_MINUTES:()=>dRe,CLAUDE_CODE_RESUME_TOKEN_THRESHOLD:()=>pRe,CLAUDE_CODE_RETIRE_UNANSWERED_PARKED_PERMISSION:()=>vCe,CLAUDE_CODE_SAFE_MODE:()=>hCe,CLAUDE_CODE_SANDBOXED:()=>gCe,CLAUDE_CODE_SCRIPT_CAPS:()=>fRe,CLAUDE_CODE_SCROLL_SPEED:()=>NTe,CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS:()=>mRe,CLAUDE_CODE_SESSION_ID:()=>UTe,CLAUDE_CODE_SESSION_KIND:()=>FTe,CLAUDE_CODE_SESSION_NAME:()=>zTe,CLAUDE_CODE_SHELL:()=>$Te,CLAUDE_CODE_SHELL_PREFIX:()=>jTe,CLAUDE_CODE_SIMPLE:()=>_Ce,CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT:()=>HTe,CLAUDE_CODE_SPAWN_TIMESTAMP_MS:()=>hRe,CLAUDE_CODE_SSE_PORT:()=>gRe,CLAUDE_CODE_STALL_TIMEOUT_MS_FOR_TESTING:()=>BTe,CLAUDE_CODE_STOP_HOOK_BLOCK_CAP:()=>_Re,CLAUDE_CODE_SUBPROCESS_ENV_SCRUB:()=>yCe,CLAUDE_CODE_SUPERVISED:()=>bCe,CLAUDE_CODE_SYNC_PLUGINS_BUFFERED_DOWNLOAD:()=>SCe,CLAUDE_CODE_SYNC_PLUGINS_DOWNLOAD_STALL_MS:()=>ECe,CLAUDE_CODE_SYNC_PLUGINS_INSTALL_TIMEOUT_MS:()=>bRe,CLAUDE_CODE_SYNC_PLUGINS_MCP_TIMEOUT_MS:()=>SRe,CLAUDE_CODE_SYNC_PLUGIN_INSTALL_TIMEOUT_MS:()=>yRe,CLAUDE_CODE_SYNC_SESSION_REFS:()=>CCe,CLAUDE_CODE_SYNC_SKILLS_INSTALL_TIMEOUT_MS:()=>ERe,CLAUDE_CODE_SYNC_SKILLS_WAIT_TIMEOUT_MS:()=>xRe,CLAUDE_CODE_SYNTAX_HIGHLIGHT:()=>RCe,CLAUDE_CODE_SYSTEM_PROMPT_GB_FEATURE:()=>KTe,CLAUDE_CODE_TAGS:()=>GTe,CLAUDE_CODE_TASK_LIST_ID:()=>qTe,CLAUDE_CODE_TEAM_TEARDOWN_PARK_TIMEOUT_MS:()=>vRe,CLAUDE_CODE_TERMINAL_MCP_TOOLS:()=>WTe,CLAUDE_CODE_TEST_ALLOW_REAL_NETWORK:()=>OCe,CLAUDE_CODE_TEST_FIXTURES_ROOT:()=>VTe,CLAUDE_CODE_TEST_FORCE_DENY:()=>PCe,CLAUDE_CODE_TEST_NO_GIT_BASH:()=>ICe,CLAUDE_CODE_TEST_NO_PWSH:()=>DCe,CLAUDE_CODE_TMPDIR:()=>ZTe,CLAUDE_CODE_TMUX_PREFIX:()=>YTe,CLAUDE_CODE_TMUX_PREFIX_CONFLICTS:()=>LCe,CLAUDE_CODE_TMUX_SESSION:()=>JTe,CLAUDE_CODE_TMUX_TRUECOLOR:()=>MCe,CLAUDE_CODE_TOOL_MEMORY_LIMIT:()=>NCe,CLAUDE_CODE_TRIGGER_ID:()=>XTe,CLAUDE_CODE_TUI_JUST_SWITCHED:()=>FCe,CLAUDE_CODE_TUI_TRIAL:()=>zCe,CLAUDE_CODE_ULTRAREVIEW_PREFLIGHT_FIXTURE:()=>QTe,CLAUDE_CODE_ULTRAREVIEW_QUOTA_FIXTURE:()=>eke,CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS:()=>wRe,CLAUDE_CODE_VOICE_FORWARD_INTERIMS_TYPED:()=>$Ce,CLAUDE_CODE_WORKER_EPOCH:()=>ARe,CLAUDE_CODE_WORKSPACE_HOST_PATHS:()=>tke,CLAUDE_CONFIG_DIR:()=>nke,CLAUDE_COWORK_MEMORY_EXTRA_GUIDELINES:()=>rke,CLAUDE_COWORK_MEMORY_GUIDELINES:()=>oke,CLAUDE_COWORK_MEMORY_INDEX_CONTENT:()=>ske,CLAUDE_COWORK_MEMORY_PATH_OVERRIDE:()=>ike,CLAUDE_ENV_FILE:()=>ake,CLAUDE_FORCE_DISPLAY_SURVEY:()=>jCe,CLAUDE_INTERNAL_ASSISTANT_TEAM_NAME:()=>cke,CLAUDE_INTERNAL_FC_OVERRIDES:()=>lke,CLAUDE_JOB_DIR:()=>uke,CLAUDE_MEMORY_STORES:()=>dke,CLAUDE_PROJECT_UUID:()=>pke,CLAUDE_PTY_HEARTBEAT_MS:()=>TRe,CLAUDE_PTY_HOST_EXEC:()=>fke,CLAUDE_PTY_ORPHAN_CHECK_MS:()=>kRe,CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX:()=>mke,CLAUDE_REMOTE_WORKFLOW_ARGS:()=>hke,CLAUDE_REMOTE_WORKFLOW_SCRIPT:()=>gke,CLAUDE_REPL_VARIANT:()=>_ke,CLAUDE_RUNNER_ACTIVITY_FD:()=>CRe,CLAUDE_RUNNER_FETCH_DEPTH:()=>yke,CLAUDE_SECURESTORAGE_CONFIG_DIR:()=>bke,CLAUDE_SERVE_DRAIN_TIMEOUT_MS:()=>RRe,CLAUDE_SNIP:()=>Ske,CLAUDE_SSH_LOCAL_BINARY:()=>Eke,CLAUDE_SSH_VERSION:()=>xke,CLAUDE_STAGE_FILE_ROOT:()=>vke,CLAUDE_SUBAGENT_BG_SHELL_MAX_MS:()=>ORe,CLAUDE_TMPDIR:()=>wke,LOCAL_BRIDGE:()=>HCe,MCP_CONNECTION_NONBLOCKING:()=>BCe,MCP_CONNECT_TIMEOUT_MS:()=>PRe,MCP_DISCOVERY_CACHE:()=>IRe,MCP_DISCOVERY_CACHE_MAX_STALE_S:()=>DRe,MCP_DISCOVERY_CACHE_STRIKES:()=>LRe,MCP_DISCOVERY_CACHE_TTL_S:()=>MRe,MCP_OAUTH_CALLBACK_PORT:()=>NRe,MCP_OAUTH_CLIENT_METADATA_URL:()=>Ake,MCP_PROTOCOL_NEGOTIATION:()=>URe,MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE:()=>FRe,MCP_SDK_GENERATION:()=>$Re,MCP_SERVER_CONNECTION_BATCH_SIZE:()=>zRe,MCP_TIMEOUT:()=>jRe,MCP_TOOL_TIMEOUT:()=>HRe,MCP_TRUNCATION_PROMPT_OVERRIDE:()=>Tke,SDK_NATIVE_BIN:()=>kke,SESSION_INGRESS_URL:()=>Cke,SLASH_COMMAND_TOOL_CHAR_BUDGET:()=>GRe,TASK_MAX_OUTPUT_LENGTH:()=>WRe,TEST_ENABLE_SESSION_PERSISTENCE:()=>KCe,ULTRAPLAN_PROMPT_FILE:()=>Rke,VCR_RECORD:()=>GCe,VITALS_EMITTER_BIN:()=>Oke,VOICE_STREAM_BASE_URL:()=>Pke});var rAe=d.str(),oAe=d.str(),sAe=d.str(),iAe=d.str(),aAe=d.str(),cAe=d.str(),lAe=d.str(),uAe=d.str(),dAe=d.str(),pAe=d.str(),fAe=d.str(),mAe=d.bool(),hAe=d.str(),gAe=d.str(),_Ae=d.str(),yAe=d.str(),bAe=d.str(),SAe=d.str(),EAe=d.str(),xAe=d.str(),vAe=d.str(),wAe=d.str(),AAe=d.str(),TAe=d.str(),kAe=d.str(),CAe=d.str(),RAe=d.str(),OAe=d.str(),PAe=d.str(),IAe=d.str(),DAe=d.str(),LAe=d.str(),MAe=d.str(),NAe=d.str(),UAe=d.str(),FAe=d.str(),zAe=d.str(),$Ae=d.str(),jAe=d.str(),HAe=d.str(),BAe=d.str(),KAe=d.str(),GAe=d.str(),WAe=d.enum(["1","spent"]),qAe=d.str(),VAe=d.str(),ZAe=d.str(),YAe=d.str(),JAe=d.str(),XAe=d.str(),QAe=d.bool(),eTe=d.bool(),tTe=d.bool(),nTe=d.bool(),rTe=d.bool(),oTe=d.bool(),sTe=d.bool(),iTe=d.str(),aTe=d.str(),cTe=d.str(),lTe=d.str(),uTe=d.str(),dTe=d.str(),pTe=d.str(),fTe=d.int({min:0}),mTe=d.int({min:0}),hTe=d.str(),gTe=d.str(),_Te=d.str(),yTe=d.str(),bTe=d.str(),STe=d.str(),ETe=d.str(),xTe=d.str(),vTe=d.str(),wTe=d.str(),ATe=d.str(),TTe=d.str(),kTe=d.str(),CTe=d.str(),RTe=d.str(),OTe=d.str(),PTe=d.str(),ITe=d.str(),DTe=d.str(),LTe=d.str(),MTe=d.str(),NTe=d.str(),UTe=d.str(),FTe=d.str(),zTe=d.str(),$Te=d.str(),jTe=d.str(),HTe=d.str(),BTe=d.str(),KTe=d.str(),GTe=d.str(),WTe=d.str(),qTe=d.str(),VTe=d.str(),ZTe=d.str(),YTe=d.str(),JTe=d.str(),XTe=d.str(),QTe=d.str(),eke=d.str(),tke=d.str(),nke=d.str(),rke=d.str(),oke=d.str(),ske=d.str(),ike=d.str(),ake=d.str(),cke=d.str(),lke=d.str(),uke=d.str(),dke=d.str(),pke=d.str(),fke=d.str(),mke=d.str(),hke=d.str(),gke=d.str(),_ke=d.str(),yke=d.str(),bke=d.str(),Ske=d.str(),Eke=d.str(),xke=d.str(),vke=d.str(),wke=d.str(),Ake=d.str(),Tke=d.str(),kke=d.str(),Cke=d.str(),Rke=d.str(),Oke=d.str(),Pke=d.str(),Ike=d.bool(),Dke=d.bool(),Lke=d.bool(),Mke=d.bool(),Nke=d.bool(),Uke=d.bool(),Fke=d.bool(),zke=d.bool(),$ke=d.bool(),jke=d.bool(),Hke=d.bool(),Bke=d.bool(),Kke=d.bool(),Gke=d.bool(),Wke=d.bool(),qke=d.bool(),Vke=d.bool(),Zke=d.bool(),Yke=d.bool(),Jke=d.bool(),Xke=d.bool(),Qke=d.bool(),eCe=d.bool(),tCe=d.bool(),nCe=d.bool(),rCe=d.bool(),oCe=d.bool(),sCe=d.bool(),iCe=d.str(),aCe=d.bool(),cCe=d.bool(),lCe=d.bool(),uCe=d.bool(),dCe=d.triBool(),pCe=d.bool(),fCe=d.str(),mCe=d.str(),hCe=d.bool(),gCe=d.bool(),_Ce=d.bool(),yCe=d.triBool(),bCe=d.bool(),SCe=d.bool(),ECe=d.int({min:1}),xCe=d.int({min:0}),vCe=d.bool(),wCe=d.bool(),ACe=d.bool(),TCe=d.bool(),kCe=d.bool(),CCe=d.bool(),RCe=d.str(),OCe=d.bool(),PCe=d.bool(),ICe=d.str(),DCe=d.str(),LCe=d.bool(),MCe=d.bool(),NCe=d.str(),UCe=d.str(),FCe=d.str(),zCe=d.str(),$Ce=d.bool(),jCe=d.bool(),HCe=d.bool(),BCe=d.bool(),KCe=d.bool(),GCe=d.bool(),WCe=d.int(),qCe=d.int(),VCe=d.int(),ZCe=d.int(),YCe=d.int(),JCe=d.int(),XCe=d.int(),QCe=d.int({min:1}),eRe=d.int({min:0,max:10080,digitsOnly:!0}),tRe=d.int(),nRe=d.int(),rRe=d.int({min:1,digitsOnly:!0}),oRe=d.int({min:1,digitsOnly:!0}),sRe=d.int({min:1,digitsOnly:!0}),iRe=d.int(),aRe=d.int(),cRe=d.int(),lRe=d.int(),uRe=d.int(),dRe=d.int(),pRe=d.int(),fRe=d.int(),mRe=d.int(),hRe=d.int(),gRe=d.int(),_Re=d.int(),yRe=d.int({min:1}),bRe=d.int({min:1}),SRe=d.int({min:0}),ERe=d.int(),xRe=d.int(),vRe=d.int({min:1000,max:60000}),wRe=d.int(),ARe=d.int(),TRe=d.int({min:1}),kRe=d.int({min:1}),CRe=d.int({min:3}),RRe=d.int({min:1}),ORe=d.int({min:1}),PRe=d.int(),IRe=d.triBool(),DRe=d.int({min:1}),LRe=d.int({min:1}),MRe=d.int({min:1}),NRe=d.int({min:1}),URe=d.str(),FRe=d.int({min:1}),zRe=d.int({min:1}),$Re=d.str(),jRe=d.int(),HRe=d.int({min:1}),BRe=d.int(),KRe=d.int(),GRe=d.int({min:1}),WRe=d.int();var xk={};Xt(xk,{ANTHROPIC_CUSTOM_MODEL_OPTION:()=>uOe,ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION:()=>pOe,ANTHROPIC_CUSTOM_MODEL_OPTION_NAME:()=>dOe,ANTHROPIC_DEFAULT_FABLE_MODEL:()=>YRe,ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION:()=>XRe,ANTHROPIC_DEFAULT_FABLE_MODEL_NAME:()=>JRe,ANTHROPIC_DEFAULT_HAIKU_MODEL:()=>sOe,ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION:()=>aOe,ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME:()=>iOe,ANTHROPIC_DEFAULT_MODEL:()=>VRe,ANTHROPIC_DEFAULT_OPUS_MODEL:()=>QRe,ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION:()=>tOe,ANTHROPIC_DEFAULT_OPUS_MODEL_NAME:()=>eOe,ANTHROPIC_DEFAULT_SONNET_MODEL:()=>nOe,ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION:()=>oOe,ANTHROPIC_DEFAULT_SONNET_MODEL_NAME:()=>rOe,ANTHROPIC_MODEL:()=>qRe,ANTHROPIC_SMALL_FAST_MODEL:()=>ZRe,CLAUDE_CODE_3P_PROBE_WROTE_OPUS_DEFAULT:()=>lOe,CLAUDE_CODE_3P_PROBE_WROTE_SONNET_DEFAULT:()=>cOe,CLAUDE_CODE_ALWAYS_ENABLE_EFFORT:()=>vOe,CLAUDE_CODE_AUTO_MODE_MODEL:()=>mOe,CLAUDE_CODE_BG_CLASSIFIER_MODEL:()=>hOe,CLAUDE_CODE_DISABLE_1M_CONTEXT:()=>kOe,CLAUDE_CODE_DISABLE_EXPLORE_INHERIT_CAP:()=>SOe,CLAUDE_CODE_DISABLE_FAST_MODE:()=>wOe,CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP:()=>EOe,CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT:()=>COe,CLAUDE_CODE_EFFORT_LEVEL:()=>xOe,CLAUDE_CODE_NO_MODEL_FALLBACK:()=>bOe,CLAUDE_CODE_SKIP_FAST_MODE_NETWORK_ERRORS:()=>AOe,CLAUDE_CODE_SKIP_FAST_MODE_ORG_CHECK:()=>TOe,CLAUDE_CODE_SUBAGENT_MODEL:()=>fOe,CLAUDE_CONTEXT_COLLAPSE:()=>_Oe,CLAUDE_CONTEXT_COLLAPSE_MODEL:()=>gOe,FALLBACK_FOR_ALL_PRIMARY_MODELS:()=>yOe});var qRe=d.str(),VRe=d.str(),ZRe=d.str(),YRe=d.str(),JRe=d.str(),XRe=d.str(),QRe=d.str(),eOe=d.str(),tOe=d.str(),nOe=d.str(),rOe=d.str(),oOe=d.str(),sOe=d.str(),iOe=d.str(),aOe=d.str(),cOe=d.str(),lOe=d.str(),uOe=d.str(),dOe=d.str(),pOe=d.str(),fOe=d.str(),mOe=d.str(),hOe=d.str(),gOe=d.str(),_Oe=d.bool(),yOe=d.str(),bOe=d.bool(),SOe=d.bool(),EOe=d.bool(),xOe=d.str(),vOe=d.bool(),wOe=d.bool(),AOe=d.bool(),TOe=d.bool(),kOe=d.bool(),COe=d.bool();var vk={};Xt(vk,{ALL_PROXY:()=>MOe,ANTHROPIC_BETAS:()=>HOe,ANTHROPIC_CUSTOM_HEADERS:()=>BOe,API_FORCE_IDLE_TIMEOUT:()=>rPe,API_TIMEOUT_MS:()=>nPe,CLAUDE_BYTE_STREAM_IDLE_TIMEOUT_MS:()=>lPe,CLAUDE_CODE_ATTRIBUTION_HEADER:()=>WOe,CLAUDE_CODE_CERT_STORE:()=>jOe,CLAUDE_CODE_CLIENT_CERT:()=>UOe,CLAUDE_CODE_CLIENT_KEY:()=>FOe,CLAUDE_CODE_CLIENT_KEY_PASSPHRASE:()=>zOe,CLAUDE_CODE_DISABLE_MTLS_RELOAD_ON_STALE_CONNECTION:()=>$Oe,CLAUDE_CODE_EAGER_FLUSH:()=>pPe,CLAUDE_CODE_EXTRA_BODY:()=>KOe,CLAUDE_CODE_EXTRA_METADATA:()=>GOe,CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS:()=>YOe,CLAUDE_CODE_FORCE_SYNC_OUTPUT:()=>fPe,CLAUDE_CODE_GZIP_REQUEST_BODIES:()=>aPe,CLAUDE_CODE_MAX_CONTEXT_TOKENS:()=>ZOe,CLAUDE_CODE_MAX_OUTPUT_TOKENS:()=>VOe,CLAUDE_CODE_MAX_RETRIES:()=>qOe,CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY:()=>JOe,CLAUDE_CODE_MAX_TURNS:()=>XOe,CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS:()=>gPe,CLAUDE_CODE_RETRY_WATCHDOG:()=>dPe,CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS:()=>hPe,CLAUDE_ENABLE_BYTE_WATCHDOG:()=>oPe,CLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK:()=>sPe,CLAUDE_ENABLE_STREAM_WATCHDOG:()=>iPe,CLAUDE_MOCK_HEADERLESS_429:()=>mPe,CLAUDE_SLOW_FIRST_BYTE_MS:()=>uPe,CLAUDE_STREAM_IDLE_TIMEOUT_MS:()=>cPe,HTTPS_PROXY:()=>OOe,HTTP_PROXY:()=>ROe,MAX_MCP_OUTPUT_TOKENS:()=>tPe,MAX_STRUCTURED_OUTPUT_RETRIES:()=>ePe,MAX_THINKING_TOKENS:()=>QOe,NO_PROXY:()=>POe,all_proxy:()=>NOe,http_proxy:()=>IOe,https_proxy:()=>DOe,no_proxy:()=>LOe});var ROe=d.str(),OOe=d.str(),POe=d.str(),IOe=d.str(),DOe=d.str(),LOe=d.str(),MOe=d.str(),NOe=d.str(),UOe=d.str(),FOe=d.str(),zOe=d.str(),$Oe=d.bool(),jOe=d.str(),HOe=d.str(),BOe=d.str(),KOe=d.str(),GOe=d.str(),WOe=d.str(),qOe=d.int(),VOe=d.int(),ZOe=d.int(),YOe=d.int(),JOe=d.int({min:1}),XOe=d.str(),QOe=d.int(),ePe=d.int(),tPe=d.int(),nPe=d.int(),rPe=d.int(),oPe=d.triBool(),sPe=d.bool(),iPe=d.triBool(),aPe=d.triBool(),cPe=d.int({min:1}),lPe=d.int({min:1}),uPe=d.int({min:1}),dPe=d.bool(),pPe=d.bool(),fPe=d.bool(),mPe=d.bool(),hPe=d.int(),gPe=d.int({min:0});var wk={};Xt(wk,{AGENT_PROXY_URL:()=>gIe,ANTHROPIC_AWS_BASE_URL:()=>OPe,ANTHROPIC_AWS_WORKSPACE_ID:()=>PPe,ANTHROPIC_BASE_URL:()=>vPe,ANTHROPIC_BEDROCK_BASE_URL:()=>TPe,ANTHROPIC_BEDROCK_MANTLE_BASE_URL:()=>RPe,ANTHROPIC_BEDROCK_REGION_PREFIX:()=>kPe,ANTHROPIC_BEDROCK_SERVICE_TIER:()=>CPe,ANTHROPIC_FOUNDRY_BASE_URL:()=>zPe,ANTHROPIC_FOUNDRY_RESOURCE:()=>$Pe,ANTHROPIC_GOOGLE_CLOUD_BASE_URL:()=>MPe,ANTHROPIC_GOOGLE_CLOUD_LOCATION:()=>DPe,ANTHROPIC_GOOGLE_CLOUD_PROJECT:()=>IPe,ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID:()=>LPe,ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION:()=>JPe,ANTHROPIC_UNIX_SOCKET:()=>XPe,ANTHROPIC_VERTEX_BASE_URL:()=>NPe,ANTHROPIC_VERTEX_PROJECT_ID:()=>UPe,AWS_ACCESS_KEY_ID:()=>WPe,AWS_CONFIG_FILE:()=>KPe,AWS_DEFAULT_REGION:()=>HPe,AWS_ENDPOINT_URL:()=>ZPe,AWS_ENDPOINT_URL_STS:()=>YPe,AWS_PROFILE:()=>BPe,AWS_REGION:()=>jPe,AWS_SECRET_ACCESS_KEY:()=>qPe,AWS_SESSION_TOKEN:()=>VPe,AWS_SHARED_CREDENTIALS_FILE:()=>GPe,CCR_AGENT_PROXY_ENABLED:()=>cIe,CCR_AGENT_PROXY_INCLUDE_HOSTS:()=>pIe,CCR_AGENT_PROXY_RELAY_MODE:()=>dIe,CCR_ENABLE_BUNDLE:()=>fIe,CCR_FORCE_BUNDLE:()=>mIe,CCR_ON_BRANCH_DEFAULT_GUARD:()=>hIe,CLAUDE_CODE_AGENT_PROXY_GH_SHIM:()=>uIe,CLAUDE_CODE_AGENT_PROXY_GIT_CONFIG:()=>lIe,CLAUDE_CODE_API_BASE_URL:()=>APe,CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY:()=>sIe,CLAUDE_CODE_GB_BASE_URL:()=>iIe,CLAUDE_CODE_GB_REFRESH_INTERVAL_MS:()=>aIe,CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST:()=>QPe,CLAUDE_CODE_PROXY_RESOLVES_HOSTS:()=>tIe,CLAUDE_CODE_SIMULATE_PROXY_USAGE:()=>eIe,CLAUDE_CODE_SKIP_HFI_VERSION_CHECK:()=>_Ie,CLAUDE_CODE_USE_ANTHROPIC_AWS:()=>SPe,CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD:()=>EPe,CLAUDE_CODE_USE_BEDROCK:()=>_Pe,CLAUDE_CODE_USE_FOUNDRY:()=>bPe,CLAUDE_CODE_USE_GATEWAY:()=>nIe,CLAUDE_CODE_USE_MANTLE:()=>xPe,CLAUDE_CODE_USE_VERTEX:()=>yPe,CLAUDE_GATEWAY_ALLOW_LOOPBACK:()=>rIe,CLAUDE_GATEWAY_LOG_LEVEL:()=>oIe,CLOUD_ML_REGION:()=>FPe,_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL:()=>wPe});var gB=["us","eu","apac","jp","au","global"];var _Pe=d.bool(),yPe=d.bool(),bPe=d.bool(),SPe=d.bool(),EPe=d.bool(),xPe=d.bool(),vPe=d.str(),wPe=d.bool(),APe=d.str(),TPe=d.str(),kPe=d.enum(gB),CPe=d.str(),RPe=d.str(),OPe=d.str(),PPe=d.str(),IPe=d.str(),DPe=d.str(),LPe=d.str(),MPe=d.str(),NPe=d.str(),UPe=d.str(),FPe=d.str(),zPe=d.str(),$Pe=d.str(),jPe=d.str(),HPe=d.str(),BPe=d.str(),KPe=d.str(),GPe=d.str(),WPe=d.str(),qPe=d.str(),VPe=d.str(),ZPe=d.str(),YPe=d.str(),JPe=d.str(),XPe=d.str(),QPe=d.bool(),eIe=d.bool(),tIe=d.bool(),nIe=d.bool(),rIe=d.bool(),oIe=d.str(),sIe=d.bool(),iIe=d.str(),aIe=d.int(),cIe=d.bool(),lIe=d.bool(),uIe=d.bool(),dIe=d.str(),pIe=d.str(),fIe=d.bool(),mIe=d.bool(),hIe=d.enum(["enforce","observe","off"]),gIe=d.str(),_Ie=d.bool();var bIe={...UA,...wk,...xk,...bk,...vk,...Sk,...FA,...Ek};function Ak(e,t){let n=Object.create(t);for(let[r,o]of Object.entries(e)){let s=n,i;Object.defineProperty(n,r,{get:()=>{let a=process.env[r];if(a!==s)i=o.parse(a),s=a;return i},enumerable:!0,configurable:!0})}return Object.defineProperties(n,{set:{value:(r,o)=>{process.env[r]=UF(o)}},unset:{value:(r)=>{delete process.env[r]}}}),n}var Cn=Ak(bIe,Yp),SIe={},F_t=Ak(SIe,null),EIe={},z_t=Ak(EIe,null);class yB{debugFilePath=void 0;initPromise=null;logStem=null}var vIe=new ft(()=>new yB);function bB(){return vIe.of(Nt().host)}function SB(e){if(e.initPromise)return e.initPromise;if(!Cn.DEBUG_CLAUDE_AGENT_SDK)return e.debugFilePath=null,e.initPromise=Promise.resolve(),e.initPromise;let t=_B(jt(),"debug");return e.logStem=`sdk-${xIe()}`,e.debugFilePath=_B(t,`${e.logStem}.txt`),process.stderr.write(`SDK debug logs: ${e.debugFilePath}
`),e.initPromise=Vc().mkdir(t).catch(()=>{}),e.initPromise}function wIe(e){return e.logStem===null?null:{namespace:"log",sessionId:e.logStem,channel:"debug"}}function EB(){let e=bB();return SB(e),e.debugFilePath??null}function ln(e,t){let n=bB();if(n.debugFilePath===null)return;let o=`${new Date().toISOString()} ${e}
`;SB(n).then(()=>{if(t!==void 0){let s=wIe(n);if(s!==null)t.append(s,[{data:o}]).catch(()=>{});return}if(n.debugFilePath)Vc().append(n.debugFilePath,o).catch(()=>{})})}function AIe(e){let t=e.trim();return t.startsWith("{")&&t.endsWith("}")}function xB(e,t){let n={...e};if(!t)return n;let r=t.enabled===!0&&t.failIfUnavailable===void 0?{...t,failIfUnavailable:!0}:t,o=n.settings;if(o&&!AIe(o))throw Error("Cannot use both a settings file path and the sandbox option. Include the sandbox configuration in your settings file instead.");let s={sandbox:r};if(o)try{s={...yt(o),sandbox:r}}catch{}return n.settings=fe(s),n}function Tk(e,t,n){let r=String(n);if(r.length>1&&r.startsWith("-"))e.push(`--${t}=${r}`);else e.push(`--${t}`,r)}var OIe=2000,kk=2048,AB="sdk-exit-after-stderr-drained",PIe=200;function Ck(e){return e==="exit"?AB:e}class TB{#e=new Set;#t=!1;#n=()=>this.killAll();track(e){if(this.#e.add(e),!this.#t)this.#t=!0,process.on("exit",this.#n)}untrack(e){this.#e.delete(e)}isTracking(e){return this.#e.has(e)}get size(){return this.#e.size}killAll(){for(let e of this.#e)if(!e.killed)if(process.platform==="win32")try{e.stdin.end()}catch{}else e.kill("SIGTERM")}reset(){process.off("exit",this.#n),this.#t=!1,this.#e.clear()}}var g_=new TB,IIe=/[(),\u0000-\u001f\u007f-\u009f]/;function DIe(e){if(typeof e!=="string"||e.trim()==="")throw Error("Skill names must be non-empty strings.");if(!Em(e))throw new Ze(`Invalid skill name ${fe(e)}: the name contains an unpaired surrogate, which cannot survive the UTF-8 encoding of the CLI invocation; no skill discovered from the filesystem can have such a name.`,"skill name with unpaired surrogate rejected");if(e!==e.trim())throw new Ze(`Invalid skill name ${fe(e)}: leading or trailing whitespace is not allowed — the Skill tool trims the invoked name, so a padded rule can never match. Remove the padding.`,"skill name with surrounding whitespace rejected");if(IIe.test(e))throw new Ze(`Invalid skill name ${fe(e)}: parentheses, commas, and control characters are not allowed in skill names. Skill names match the skill's directory name (or 'plugin:skill' for plugin-qualified skills); rename the skill if its directory name contains these characters.`,"invalid skill name rejected");if(e==="*")throw Error("Invalid skill name '*': use skills: 'all' to enable every skill.");if(e.endsWith(":*")||e.endsWith(" *"))throw new Ze(`Invalid skill name ${fe(e)}: wildcard-suffix names are not allowed; list each skill by its exact name.`,"wildcard-suffix skill name rejected");if(e.startsWith("/"))throw new Ze(`Invalid skill name ${fe(e)}: skill names may not start with '/'. Skills are invoked as slash commands, but the skills option takes the skill's canonical name — the directory name, or 'plugin:skill'.`,"skill name with leading slash rejected");if(e.includes("\\\\"))throw new Ze(`Invalid skill name ${fe(e)}: consecutive backslashes are not allowed — the permission-rule parser collapses escaped backslashes, so the rule would name a different skill. Rename the skill.`,"skill name with consecutive backslashes rejected");if(e.endsWith("\\"))throw new Ze(`Invalid skill name ${fe(e)}: names may not end with an unpaired backslash.`,"skill name with unpaired trailing backslash rejected");return e}class Ok{options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitEventDelivered=!1;stderrTail="";exitListeners=[];abortHandler;forwardedAbort=ku();pendingWrites=[];pendingEndInput=!1;spawnResolve;spawnReject;spawnPromise;constructor(e){this.options=e;if(this.abortController=e.abortController||ku(),e.deferSpawn)this.spawnPromise=new Promise((t,n)=>{this.spawnResolve=t,this.spawnReject=n}),this.spawnPromise.catch(()=>{});else this.initialize()}spawn(){try{this.initialize()}catch(t){throw this.spawnAbort(Or(t)),t}let e=this.pendingWrites;if(this.pendingWrites=[],this.spawnResolve)this.spawnResolve(),this.spawnResolve=void 0,this.spawnReject=void 0;for(let t of e)this.write(t);if(this.pendingEndInput)this.pendingEndInput=!1,this.processStdin?.end()}spawnAbort(e){if(this.spawnReject)this.spawnReject(e),this.spawnReject=void 0,this.spawnResolve=void 0,this.pendingWrites=[]}updateEnv(e){if(this.options.env)Object.assign(this.options.env,e);else this.options.env={...e}}updateResume(e){this.options.resume=e}getDefaultExecutable(){return Ga()?"bun":"node"}spawnLocalProcess(e){let{command:t,args:n,cwd:r,env:o,signal:s}=e,i=TIe(t,n,{cwd:r,stdio:["pipe","pipe","pipe"],signal:s,env:o,windowsHide:!0}),a=new RIe("utf8"),c=!1,l=!1,u=!1,p,f=Re(o.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr!==void 0;i.stderr.on("data",(_)=>{if(u)return;let y=a.write(_);if(this.stderrTail+=y,this.stderrTail.length>2*kk)this.stderrTail=Gb(Vu(this.stderrTail),kk);if(f)ln(y),this.options.stderr?.(y)}),i.stderr.on("error",(_)=>{ln(`[ProcessTransport] stderr read failed: ${_.code??_.message}`)});let m=()=>{if(u)return;if(u=!0,p)clearTimeout(p);i.emit(AB,i.exitCode,i.signalCode);let _=i.stderr;if(UIe(_))_.unref();else _.destroy()};return i.stderr.once("close",()=>{if(this.stderrTail+=a.end(),c=!0,l)m()}),i.once("exit",()=>{if(l=!0,this.ready=!1,c)m();else p=setTimeout(m,PIe)}),{stdin:i.stdin,stdout:i.stdout,get killed(){return i.killed},get exitCode(){return i.exitCode},get signalCode(){return i.signalCode},kill:i.kill.bind(i),on:(_,y)=>i.on(Ck(_),y),once:(_,y)=>i.once(Ck(_),y),off:(_,y)=>i.off(Ck(_),y)}}initialize(){try{let{additionalDirectories:e=[],agent:t,betas:n,cwd:r,executable:o=this.getDefaultExecutable(),executableArgs:s=[],extraArgs:i={},pathToClaudeCodeExecutable:a,env:c={...process.env},thinkingConfig:l,maxTurns:u,maxBudgetUsd:p,taskBudget:f,model:m,fallbackModel:h,jsonSchema:_,permissionMode:y,allowDangerouslySkipPermissions:S,permissionPromptToolName:b,continueConversation:x,resume:v,settingSources:T,skills:U,disallowedTools:M=[],tools:F,mcpServers:W,strictMcpConfig:ce,canUseTool:ne,includePartialMessages:se,plugins:Se,sandbox:Te}=this.options,{allowedTools:St=[]}=this.options;if(U!==void 0){let ee=U==="all"?["Skill"]:U.map((we)=>`Skill(${DIe(we)})`),Ue=new Set(St);St=[...St,...ee.filter((we)=>!Ue.has(we))]}let Y=["--output-format","stream-json","--verbose","--input-format","stream-json"];if(l){switch(l.type){case"enabled":if(l.budgetTokens===void 0)Y.push("--thinking","adaptive");else Y.push("--max-thinking-tokens",l.budgetTokens.toString());break;case"disabled":Y.push("--thinking","disabled");break;case"adaptive":Y.push("--thinking","adaptive");break}if(l.type!=="disabled"&&l.display)Y.push("--thinking-display",l.display)}if(this.options.effort)Y.push("--effort",this.options.effort);if(u)Y.push("--max-turns",u.toString());if(p!==void 0)Y.push("--max-budget-usd",p.toString());if(f)Y.push("--task-budget",f.total.toString());if(m)Y.push("--model",m);if(t)Y.push("--agent",t);if(n&&n.length>0)Y.push("--betas",n.join(","));if(_)Y.push("--json-schema",fe(_));if(this.options.debugFile)Y.push("--debug-file",this.options.debugFile);else if(this.options.debug)Y.push("--debug");if(!this.options.debugFile&&!this.options.spawnClaudeCodeProcess){let ee=EB();if(ee)Y.push("--debug-file",ee)}if(ne){if(b)throw Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");Y.push("--permission-prompt-tool","stdio")}else if(b)Y.push("--permission-prompt-tool",b);if(x)Y.push("--continue");if(v)Y.push(`--resume=${v}`);if(this.options.channels&&this.options.channels.length>0)for(let ee of this.options.channels)Tk(Y,"channels",ee);if(St.length>0)Y.push("--allowedTools",St.join(","));if(M.length>0)Y.push("--disallowedTools",M.join(","));if(F!==void 0)if(Array.isArray(F))if(F.length===0)Y.push("--tools","");else Y.push("--tools",F.join(","));else Y.push("--tools","default");if(W&&Object.keys(W).length>0)Y.push("--mcp-config",fe({mcpServers:W}));if(T!==void 0)Y.push(`--setting-sources=${T.join(",")}`);if(ce)Y.push("--strict-mcp-config");if(y)Y.push("--permission-mode",y);if(S)Y.push("--allow-dangerously-skip-permissions");if(h){if(m&&h===m)throw Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");Y.push("--fallback-model",h)}if(this.options.includeHookEvents)Y.push("--include-hook-events");if(se)Y.push("--include-partial-messages");if(this.options.sessionMirror)Y.push("--session-mirror");for(let ee of e)Y.push("--add-dir",ee);if(Se&&Se.length>0)for(let ee of Se)if(ee.type==="local")Y.push(ee.skipMcpDiscovery?"--plugin-dir-no-mcp":"--plugin-dir",ee.path);else throw Error(`Unsupported plugin type: ${ee.type}`);if(this.options.forkSession)Y.push("--fork-session");if(this.options.resumeSessionAt)Y.push(`--resume-session-at=${this.options.resumeSessionAt}`);if(this.options.resumeDropsTurn!==void 0)Y.push(`--resume-drops-turn=${this.options.resumeDropsTurn}`);if(this.options.sessionId)Y.push(`--session-id=${this.options.sessionId}`);if(this.options.persistSession===!1)Y.push("--no-session-persistence");if(this.options.managedSettings)Y.push("--managed-settings",this.options.managedSettings);let Ye={...i??{}};if(this.options.settings)Ye.settings=this.options.settings;let Et=xB(Ye,Te);for(let[ee,Ue]of Object.entries(Et))if(Ue===null)Y.push(`--${ee}`);else Tk(Y,ee,Ue);if(!c.CLAUDE_CODE_ENTRYPOINT)c.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(delete c.NODE_OPTIONS,Re(c.DEBUG_CLAUDE_AGENT_SDK))c.DEBUG="1";else delete c.DEBUG;let ht=LIe(a),er=ht?a:o,Tt=ht?[...s,...Y]:[...s,a,...Y],re={command:er,args:Tt,cwd:r,env:c,signal:this.forwardedAbort.signal};if(this.options.spawnClaudeCodeProcess)ln(`Spawning Claude Code (custom): ${er} ${Tt.join(" ")}`),this.process=this.options.spawnClaudeCodeProcess(re);else ln(`Spawning Claude Code: ${er} ${Tt.join(" ")}`),this.process=this.spawnLocalProcess(re);if(this.processStdin=this.process.stdin,this.processStdout=this.process.stdout,this.processStdin.on("error",(ee)=>{ln(`[ProcessTransport] stdin write failed (child likely exited): ${ee.code??ee.message}`),this.ready=!1}),g_.track(this.process),this.abortHandler=()=>this.close(),this.abortController.signal.addEventListener("abort",this.abortHandler),this.abortController.signal.aborted)this.close();let Q=this.process;Q.on("error",(ee)=>{this.ready=!1;let Ue=ee,we=Ue.syscall!==void 0?Ue.syscall.startsWith("spawn"):Pw(ee);if(we&&!Q.killed)g_.untrack(Q);if(this.abortController.signal.aborted)this.exitError=__(),_n(ee,{telemetryMessage:"Claude Code process aborted by user",errorClass:"aborted"});else if(we&&Pw(ee)){let{message:Qe,telemetryMessage:tr,errorClass:rt}=MIe(a,ht),$r={telemetryMessage:`${tr}${Rk(ee)}`,errorClass:rt,code:fp(ee)};this.exitError=_n(ReferenceError(Qe),$r),_n(ee,$r),ln(this.exitError.message)}else{let Qe={telemetryMessage:we?`Failed to spawn Claude Code process${Rk(ee)}`:`Claude Code process error${Rk(ee)}`,errorClass:we?"spawn_failed":"process_error",code:fp(ee)};this.exitError=_n(Error(`Failed to spawn Claude Code process: ${Vu(ee.message)}`),Qe),_n(ee,Qe),ln(this.exitError.message)}}),Q.on("exit",(ee,Ue)=>{if(this.exitEventDelivered=!0,this.ready=!1,this.abortController.signal.aborted)this.exitError=__();else{let we=this.getProcessExitError(ee,Ue);if(we)this.exitError=we,ln(we.message)}}),this.ready=!this.abortController.signal.aborted}catch(e){throw this.ready=!1,e}}getProcessExitError(e,t){if(e!==0&&e!==null){let n=Number.isInteger(e)?e:void 0;return _n(Error(`Claude Code process exited with code ${e}${this.formatStderrTail()}`),{telemetryMessage:`Claude Code process exited with code ${n??"unknown"}`,errorClass:"process_exited_nonzero",exitCode:n})}else if(t){let n=/^SIG[A-Z0-9]{1,8}$/.test(t)?t:"unknown";return _n(Error(`Claude Code process terminated by signal ${t}${this.formatStderrTail()}`),{telemetryMessage:`Claude Code process terminated by signal ${n}`,errorClass:"process_killed_by_signal",signal:n})}return}formatStderrTail(){let e=Gb(Vu(this.stderrTail),kk).trim();return e?`. stderr: ${e}`:""}write(e){if(this.abortController.signal.aborted)throw vB();if(this.spawnResolve){this.pendingWrites.push(e);return}if(!this.ready||!this.processStdin)throw Error("ProcessTransport is not ready for writing");if(this.processStdin.writableEnded){ln("[ProcessTransport] Dropping write to ended stdin stream");return}if(this.process?.killed||this.process?.exitCode!==null)throw Error("Cannot write to terminated process");if(this.exitError)throw _n(Error(`Cannot write to process that exited with error: ${this.exitError.message}`),{telemetryMessage:`Cannot write to process that exited with error: ${VN(this.exitError)??"untagged exit error"}`,errorClass:wB(this.exitError,"errorClass"),code:fp(this.exitError),exitCode:NIe(this.exitError),signal:wB(this.exitError,"signal")});ln(`[ProcessTransport] Writing to stdin: ${e.substring(0,100)}`);try{if(!this.processStdin.write(e))ln("[ProcessTransport] Write buffer full, data queued")}catch(t){throw this.ready=!1,Error(`Failed to write to process stdin: ${Oo(t)}`)}}[Symbol.dispose](){this.close()}close(){if(this.spawnAbort(this.abortController.signal.aborted?__():Error("Query closed before spawn")),this.processStdin)this.processStdin.end(),this.processStdin=void 0;if(this.abortHandler)this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0;let e=this.process?.exitCode??null,t=this.process?.signalCode??null,n=!this.exitEventDelivered&&(e!==null&&e>=0||t!==null),r;if(n){if(this.exitEventDelivered=!0,r=this.abortController.signal.aborted?__():this.getProcessExitError(e,t),r&&!this.exitError)this.exitError=r}let o=this.exitListeners;this.exitListeners=[];for(let{callback:a,handler:c}of o)if(this.process?.off("exit",c),n)try{a(r)}catch(l){ln(`[ProcessTransport] onExit callback threw during close(): ${Oo(l)}`)}let s=()=>{if(this.abortController.signal.aborted)this.forwardedAbort.abort(this.abortController.signal.reason)},i=this.process;if(i&&!i.killed&&i.exitCode===null&&i.signalCode==null)setTimeout((a,c)=>{if(a.exitCode!==null||a.signalCode!=null){c();return}if(process.platform==="win32"){setTimeout((l,u)=>{if(l.exitCode===null)l.kill("SIGKILL");u()},5000,a,c).unref();return}a.kill("SIGTERM"),setTimeout((l)=>{if(l.exitCode===null)l.kill("SIGKILL")},5000,a).unref(),c()},OIe,i,s).unref(),i.once("exit",()=>g_.untrack(i));else if(i)g_.untrack(i),s();this.ready=!1}isReady(){return this.ready}async*readMessages(){if(this.spawnPromise)await this.spawnPromise,this.spawnPromise=void 0;if(!this.processStdout)throw Error("ProcessTransport output stream not available");if(this.exitError)throw this.exitError;let e=CIe({input:this.processStdout}),t=this.process?(()=>{let n=this.process,r=()=>e.close();return n.on("error",r),()=>n.off("error",r)})():void 0;if(this.exitError)e.close();try{for await(let n of e)if(n.trim()){let r;try{r=yt(n)}catch(o){ln(`Non-JSON stdout: ${n}`);continue}yield r}if(this.exitError)throw this.exitError;await this.waitForExit()}finally{t?.(),e.close()}}endInput(){if(this.spawnResolve){this.pendingEndInput=!0;return}if(this.processStdin)this.processStdin.end()}getInputStream(){return this.processStdin}onExit(e){if(!this.process)return()=>{};let t=(n,r)=>{let o=this.getProcessExitError(n,r);e(o)};return this.process.on("exit",t),this.exitListeners.push({callback:e,handler:t}),()=>{if(this.process)this.process.off("exit",t);let n=this.exitListeners.findIndex((r)=>r.handler===t);if(n!==-1)this.exitListeners.splice(n,1)}}async waitForExit(){if(this.exitError)throw this.exitError;if(!this.process||this.process.exitCode===0||this.process.killed&&this.exitEventDelivered)return;return new Promise((e,t)=>{let n=(o,s)=>{if(this.abortController.signal.aborted){t(vB());return}let i=this.getProcessExitError(o,s);if(i)t(i);else e()};this.process.once("exit",n);let r=(o)=>{this.process.off("exit",n),t(o)};this.process.once("error",r),this.process.once("exit",()=>{this.process.off("error",r)})})}}function LIe(e){return![".js",".mjs",".tsx",".ts",".jsx"].some((n)=>e.endsWith(n))}function MIe(e,t){let n=t?"native binary":"executable",r=Vu(e);if(kIe(e))return{message:t?`Claude Code native binary at ${r} exists but failed to launch. This usually means the binary does not match this system's libc — e.g. spawning a musl-linked binary on a glibc Linux host fails because the musl dynamic loader (/lib/ld-musl-*) is missing. Specify a matching binary with options.pathToClaudeCodeExecutable.`:`Claude Code executable at ${r} exists but failed to launch.`,telemetryMessage:`Claude Code ${n} exists at the configured path but failed to launch`,errorClass:"executable_launch_failed"};return{message:t?`Claude Code native binary not found at ${r}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.`:`Claude Code executable not found at ${r}. Is options.pathToClaudeCodeExecutable set?`,telemetryMessage:`Claude Code ${n} not found at the configured path`,errorClass:"executable_not_found"}}function Rk(e){let t=fp(e);return t===void 0?"":` (${t})`}function __(){return _n(new or("Claude Code process aborted by user"),{telemetryMessage:"Claude Code process aborted by user",errorClass:"aborted"})}function vB(){return _n(new or("Operation aborted"),{telemetryMessage:"Operation aborted",errorClass:"aborted"})}function wB(e,t){let n=Object.hasOwn(e,t)?Reflect.get(e,t):void 0;return typeof n==="string"?n:void 0}function NIe(e){let t=Object.hasOwn(e,"exitCode")?Reflect.get(e,"exitCode"):void 0;return typeof t==="number"?t:void 0}function UIe(e){return typeof Reflect.get(e,"unref")==="function"}import{existsSync as FIe}from"fs";var Cl="@anthropic-ai/claude-agent-sdk";function zIe(){if(process.platform!=="linux")return!1;let e=typeof process.report?.getReport==="function"?process.report.getReport():null;return e!=null&&e.header?.glibcVersionRuntime===void 0}function kB(e,t={}){let n=t.platform??process.platform,r=t.arch??process.arch,o=t.exists??FIe,s=t.preferMusl??zIe(),i="claude",a=n==="win32"?".exe":"",l=(n==="android"?[`${Cl}-linux-${r}-android`]:n==="linux"?s?[`${Cl}-linux-${r}-musl`,`${Cl}-linux-${r}`]:[`${Cl}-linux-${r}`,`${Cl}-linux-${r}-musl`]:[`${Cl}-${n}-${r}`]).map((u)=>`${u}/claude${a}`);for(let u of l)try{let p=e(u);if(o(p))return p}catch{}return null}var $Ie=["signed_out","identity_changed","transient","refresh_failed"];function CB(e){return $Ie.some((t)=>t===e)}class Jp{returned;queue=[];readResolve;readReject;isDone=!1;hasError;started=!1;constructor(e){this.returned=e}[Symbol.asyncIterator](){if(this.started)throw Error("Stream can only be iterated once");return this.started=!0,this}next(){if(this.queue.length>0)return Promise.resolve({done:!1,value:this.queue.shift()});if(this.isDone)return Promise.resolve({done:!0,value:void 0});if(this.hasError)return Promise.reject(this.hasError);return new Promise((e,t)=>{this.readResolve=e,this.readReject=t})}enqueue(e){if(this.readResolve){let t=this.readResolve;this.readResolve=void 0,this.readReject=void 0,t({done:!1,value:e})}else this.queue.push(e)}done(){if(this.isDone=!0,this.readResolve){let e=this.readResolve;this.readResolve=void 0,this.readReject=void 0,e({done:!0,value:void 0})}}error(e){if(this.hasError=e,this.readReject){let t=this.readReject;this.readResolve=void 0,this.readReject=void 0,t(e)}}return(){if(this.isDone=!0,this.returned)this.returned();return Promise.resolve({done:!0,value:void 0})}}var jIe=1000;function HIe(){return{eventQueue:[],sink:null,droppedEventCount:0}}function BIe(e,t){if(e.eventQueue.length>=jIe)e.eventQueue.shift(),e.droppedEventCount++;e.eventQueue.push(t)}class RB{state=HIe()}var KIe=new ft(()=>new RB);function GIe(){return KIe.of(Nt().host)}function Rl(e,t){let n=GIe().state;if(n.sink===null){BIe(n,{eventName:e,metadata:t,async:!1});return}n.sink.logEvent(e,t)}function Pk(e,t){Rl("tengu_feature_ok",{feature_name:Lc(e),...t})}function Ik(e,t,n){Rl("tengu_feature_bad",{...n,feature_name:Lc(e),error_code:t})}function OB(e,t,n){Rl("tengu_feature_sad",{...n,feature_name:Lc(e),error_code:t})}async function yr(e,t,n){try{let r=await t();return Pk(e),r}catch(r){throw Ik(e,n?.(r)??"error"),r}}class Dk{sendMcpMessage;isClosed=!1;constructor(e){this.sendMcpMessage=e}onclose;onerror;onmessage;async start(){}async send(e){if(this.isClosed)throw Error("Transport is closed");this.sendMcpMessage(e)}async close(){if(this.isClosed)return;this.isClosed=!0,this.onclose?.()}}var Xp=Symbol("suppressControlResponse");class y_{transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;onElicitation;getOAuthToken;getHostAuthToken;onUserDialog;pendingControlResponses=new Map;unmatchedControlResponses=new Map;static UNMATCHED_CONTROL_RESPONSES_MAX=1024;cleanupPerformed=!1;sdkMessages;inputStream=new Jp;initialization;cancelControllers=new Map;hookCallbacks=new Map;nextCallbackId=0;initHooksPayload;sdkMcpTransports=new Map;sdkMcpServerInstances=new Map;pendingMcpResponses=new Map;firstResultReceivedResolve;firstResultReceived=!1;lastErrorResultText;latestCommands;transcriptMirrorBatcher;cleanupCallbacks=[];cleanupPromise;setIsSingleUserTurn(e){this.isSingleUserTurn=e}setTranscriptMirrorBatcher(e){this.transcriptMirrorBatcher=e}reportMirrorError(e,t){let n={type:"system",subtype:"mirror_error",error:t,key:e,uuid:mp(),session_id:e.sessionId};this.inputStream.enqueue(n)}addCleanupCallback(e){if(this.cleanupPerformed)e();else this.cleanupCallbacks.push(e)}isClosed(){return this.cleanupPerformed}hasBidirectionalNeeds(){return this.sdkMcpTransports.size>0||this.hooks!==void 0&&Object.keys(this.hooks).length>0||this.canUseTool!==void 0||this.onElicitation!==void 0||this.onUserDialog!==void 0||this.getOAuthToken!==void 0||this.getHostAuthToken!==void 0}constructor(e,t,n,r,o,s=new Map,i,a,c,l,u,p){this.transport=e;this.isSingleUserTurn=t;this.canUseTool=n;this.hooks=r;this.abortController=o;this.jsonSchema=i;this.initConfig=a;this.onElicitation=c;this.getOAuthToken=l;this.getHostAuthToken=u;this.onUserDialog=p;for(let[f,m]of s)this.connectSdkMcpServer(f,m);this.sdkMessages=this.readSdkMessages(),this.readMessages(),this.initialization=this.initialize(),this.initialization.catch(()=>{})}setError(e){this.inputStream.error(e)}async stopTask(e){await this.request({subtype:"stop_task",task_id:e})}async backgroundTasks(e){return(await this.request({subtype:"background_tasks",tool_use_id:e})).response.backgrounded??!0}close(){this.cleanup()}cleanup(e){if(this.cleanupPromise)return this.cleanupPromise;return this.cleanupPerformed=!0,this.cleanupPromise=this.performCleanup(e),this.cleanupPromise}async performCleanup(e){for(let t of this.cleanupCallbacks)try{t()}catch{}if(this.cleanupCallbacks=[],this.transcriptMirrorBatcher)try{await this.transcriptMirrorBatcher.flush()}catch{}try{for(let n of this.cancelControllers.values())n.abort();this.cancelControllers.clear(),this.transport.close();let t=e??Error("Query closed before response received");for(let{reject:n}of this.pendingControlResponses.values())n(t);this.pendingControlResponses.clear(),this.unmatchedControlResponses.clear();for(let{reject:n}of this.pendingMcpResponses.values())n(t);this.pendingMcpResponses.clear(),this.hookCallbacks.clear();for(let n of this.sdkMcpTransports.values())n.close().catch(()=>{});if(this.sdkMcpTransports.clear(),e)this.inputStream.error(e);else this.inputStream.done()}catch(t){}if(this.transport.waitForExit){let t=new AbortController;try{await Promise.race([this.transport.waitForExit(),Hr(2000,t.signal)])}catch{}finally{t.abort()}}}next(...[e]){return this.sdkMessages.next(...[e])}async return(e){return await this.cleanup(),this.sdkMessages.return(e)}async throw(e){return await this.cleanup(),this.sdkMessages.throw(e)}[Symbol.asyncIterator](){return this.sdkMessages}async[Symbol.asyncDispose](){await this.cleanup()}async readMessages(){try{for await(let e of this.transport.readMessages()){if(e.type==="control_response"){let t=this.pendingControlResponses.get(e.response.request_id);if(t)t.handler(e.response);else{if(this.unmatchedControlResponses.size>=y_.UNMATCHED_CONTROL_RESPONSES_MAX){let n=this.unmatchedControlResponses.keys().next().value;if(n!==void 0)this.unmatchedControlResponses.delete(n)}this.unmatchedControlResponses.set(e.response.request_id,e.response)}continue}else if(e.type==="control_request"){this.handleControlRequest(e);continue}else if(e.type==="control_cancel_request"){this.handleControlCancelRequest(e);continue}else if(e.type==="keep_alive")continue;else if(e.type==="transcript_mirror"){this.transcriptMirrorBatcher?.enqueue(e.filePath,e.entries);continue}if(e.type==="system"&&e.subtype==="commands_changed"&&Array.isArray(e.commands))this.latestCommands=e.commands;if(e.type==="system"&&(e.subtype==="post_turn_summary"||e.subtype==="task_summary")){this.inputStream.enqueue(e);continue}if(e.type==="active_goal"){this.inputStream.enqueue(e);continue}if(e.type==="autocompact_state"){this.inputStream.enqueue(e);continue}if(e.type==="result"){if(this.transcriptMirrorBatcher)await this.transcriptMirrorBatcher.flush();let t=e.is_error?e.subtype==="success"?e.result:e.errors.map((n)=>n.trim()).filter(Boolean).join("; "):void 0;if(this.lastErrorResultText=t||void 0,this.firstResultReceived=!0,this.firstResultReceivedResolve)this.firstResultReceivedResolve();if(this.isSingleUserTurn)de("[Query.readMessages] First result received for single-turn query, closing stdin"),this.transport.endInput()}else if(!(e.type==="system"&&e.subtype==="session_state_changed"))this.lastErrorResultText=void 0;this.inputStream.enqueue(e)}if(this.transcriptMirrorBatcher)await this.transcriptMirrorBatcher.flush();if(this.firstResultReceivedResolve)this.firstResultReceivedResolve();this.inputStream.done(),this.cleanup()}catch(e){if(this.transcriptMirrorBatcher)await this.transcriptMirrorBatcher.flush();if(this.firstResultReceivedResolve)this.firstResultReceivedResolve();if(this.lastErrorResultText!==void 0&&!(e instanceof or)&&e?.name!=="SSEHttpError"){let t=_n(Error(`Claude Code returned an error result: ${this.lastErrorResultText}`),{telemetryMessage:"Claude Code returned an error result",errorClass:"error_result"});de(`[Query.readMessages] Replacing exit error with result text. Original: ${Oo(e)}`),this.inputStream.error(t),this.cleanup(t);return}this.inputStream.error(e),this.cleanup(e)}}async handleControlRequest(e){if(this.cancelControllers.has(e.request_id)){de(`[Query.handleControlRequest] Duplicate delivery of in-flight request ${e.request_id} (${e.request.subtype}) — skipping`);return}let t=new AbortController;this.cancelControllers.set(e.request_id,t);try{let n=await this.processControlRequest(e,t.signal);if(this.cleanupPerformed)return;if(n===Xp)return;let r={type:"control_response",response:{subtype:"success",request_id:e.request_id,response:n}};await Promise.resolve(this.transport.write(fe(r)+`
`))}catch(n){if(this.cleanupPerformed)return;let r={type:"control_response",response:{subtype:"error",request_id:e.request_id,error:Oo(n)}};try{await Promise.resolve(this.transport.write(fe(r)+`
`))}catch(o){de(`[Query.handleControlRequest] Error-response write failed: ${Oo(o)}`,{level:"error"})}}finally{this.cancelControllers.delete(e.request_id)}}handleControlCancelRequest(e){let t=this.cancelControllers.get(e.request_id);if(t)t.abort(),this.cancelControllers.delete(e.request_id)}async processControlRequest(e,t){if(e.request.subtype==="can_use_tool"){if(!this.canUseTool)throw Error("canUseTool callback is not provided.");let n=await this.canUseTool(e.request.tool_name,e.request.input,{signal:t,suggestions:e.request.permission_suggestions,blockedPath:e.request.blocked_path,decisionReason:e.request.decision_reason,title:e.request.title,displayName:e.request.display_name,description:e.request.description,toolUseID:e.request.tool_use_id,agentID:e.request.agent_id,requestId:e.request_id,...e.request.matched_ask_rule&&{matchedAskRule:{source:e.request.matched_ask_rule.source,toolName:e.request.matched_ask_rule.tool_name,...e.request.matched_ask_rule.rule_content!==void 0&&{ruleContent:e.request.matched_ask_rule.rule_content}}}});if(n===null)return Xp;return{...n,toolUseID:e.request.tool_use_id}}else if(e.request.subtype==="hook_callback")return await this.handleHookCallbacks(e.request.callback_id,e.request.input,e.request.tool_use_id,t);else if(e.request.subtype==="mcp_message"){let n=e.request,r=this.sdkMcpTransports.get(n.server_name);if(!r)throw Error(`SDK MCP server not found: ${n.server_name}`);if("method"in n.message&&"id"in n.message&&n.message.id!==null)return{mcp_response:await this.handleMcpControlRequest(n.server_name,n,r)};else{if(r.onmessage)r.onmessage(n.message);return{mcp_response:{jsonrpc:"2.0",result:{},id:0}}}}else if(e.request.subtype==="elicitation"){let n=e.request;if(this.onElicitation){let r=await this.onElicitation({serverName:n.mcp_server_name,message:n.message,mode:n.mode,url:n.url,elicitationId:n.elicitation_id,requestedSchema:n.requested_schema,title:n.title,displayName:n.display_name,description:n.description},{signal:t,requestId:e.request_id});if(r===null)return Xp;return r}return{action:"decline"}}else if(e.request.subtype==="request_user_dialog"){if(this.onUserDialog){let n=await this.onUserDialog({dialogKind:e.request.dialog_kind,payload:e.request.payload,toolUseID:e.request.tool_use_id},{signal:t,requestId:e.request_id});if(n===null)return Xp;return n}return de(`[Query] No onUserDialog handler for request_user_dialog (kind=${e.request.dialog_kind}) — staying silent so a capable client (or the worker's park deadline) settles it`),Rl("tengu_request_user_dialog_response_ignored",{shape:Lc("auto_cancel")}),Xp}else if(e.request.subtype==="oauth_token_refresh"){if(!this.getOAuthToken)throw Error("getOAuthToken callback is not provided.");let n,r=await this.getOAuthToken({signal:t,onDecline:(o)=>{if(CB(o))n=o}})??null;return r===null&&n!==void 0?{accessToken:r,reason:n}:{accessToken:r}}else if(e.request.subtype==="host_auth_token_refresh"){if(!this.getHostAuthToken)throw Error("getHostAuthToken callback is not provided.");let n=await this.getHostAuthToken({signal:t})??null;return typeof n==="string"||n===null?{authToken:n}:n}throw Error("Unsupported control request subtype: "+e.request.subtype)}async*readSdkMessages(){try{for await(let e of this.inputStream)yield e}finally{await this.cleanup()}}async initialize(){if(this.hooks&&!this.initHooksPayload){this.initHooksPayload={};for(let[r,o]of Object.entries(this.hooks))if(o.length>0)this.initHooksPayload[r]=o.map((s)=>{let i=[];for(let a of s.hooks){let c=`hook_${this.nextCallbackId++}`;this.hookCallbacks.set(c,a),i.push(c)}return{matcher:s.matcher,hookCallbackIds:i,timeout:s.timeout}})}let e=this.sdkMcpTransports.size>0?Array.from(this.sdkMcpTransports.keys()):void 0,t={subtype:"initialize",hooks:this.initHooksPayload,sdkMcpServers:e,jsonSchema:this.jsonSchema,systemPrompt:typeof this.initConfig?.systemPrompt==="string"?[this.initConfig.systemPrompt]:this.initConfig?.systemPrompt,appendSystemPrompt:this.initConfig?.appendSystemPrompt,planModeInstructions:this.initConfig?.planModeInstructions,appendSubagentSystemPrompt:this.initConfig?.appendSubagentSystemPrompt,toolAliases:this.initConfig?.toolAliases,excludeDynamicSections:this.initConfig?.excludeDynamicSections,agents:this.initConfig?.agents,title:this.initConfig?.title,skills:Array.isArray(this.initConfig?.skills)?this.initConfig.skills:void 0,webSearchIsolationExemptMcpServers:this.initConfig?.webSearchIsolationExemptMcpServers,promptSuggestions:this.initConfig?.promptSuggestions,agentProgressSummaries:this.initConfig?.agentProgressSummaries,forwardSubagentText:this.initConfig?.forwardSubagentText,supportedDialogKinds:this.initConfig?.supportedDialogKinds};return(await this.request(t)).response}async interrupt(){return yr("sdk_interrupt",async()=>{let t=(await this.request({subtype:"interrupt"})).response?.still_queued;return Array.isArray(t)?{still_queued:t.filter((n)=>typeof n==="string")}:void 0})}async setPermissionMode(e){await this.request({subtype:"set_permission_mode",mode:e})}async setMcpPermissionModeOverride(e,t){return(await this.request({subtype:"set_mcp_permission_mode_override",serverName:e,mode:t})).response??{}}awaitControlResponse(e){return this.transport.expectControlResponse?.(e),new Promise((t,n)=>{let r=(s)=>{if(s.subtype==="success"){let{pending_permission_requests:i,pending_user_dialog_requests:a,...c}=s;t(c)}else n(new Ze(s.error,"awaitControlResponse: CLI error verdict"));if(s.pending_permission_requests||s.pending_user_dialog_requests)de("[Query] Ignoring prompt-redelivery fields on awaitControlResponse response")};if(this.cleanupPerformed){n(Error("Query closed before response received"));return}let o=this.unmatchedControlResponses.get(e);if(o){this.unmatchedControlResponses.delete(e),r(o);return}this.pendingControlResponses.set(e,{handler:(s)=>{this.pendingControlResponses.delete(e),r(s)},reject:n})})}async setModel(e){await this.request({subtype:"set_model",model:e})}async setMaxThinkingTokens(e,t){await this.request({subtype:"set_max_thinking_tokens",max_thinking_tokens:e,thinking_display:t})}async applyFlagSettings(e){return yr("sdk_apply_flag_settings",async()=>{await this.request({subtype:"apply_flag_settings",settings:e})})}async getSettings(){return(await this.request({subtype:"get_settings"})).response}async rewindFiles(e,t){return yr("sdk_rewind_files",async()=>(await this.request({subtype:"rewind_files",user_message_id:e,dry_run:t?.dryRun})).response)}async cancelAsyncMessage(e){return(await this.request({subtype:"cancel_async_message",message_uuid:e})).response.cancelled}async seedReadState(e,t){await this.request({subtype:"seed_read_state",path:e,mtime:t})}async setCwd(e,t){return yr("sdk_set_cwd",async()=>(await this.request({subtype:"set_cwd",path:e,...t?.trustAccepted!==void 0&&{trust_accepted:t.trustAccepted},...t?.trustedDirectory!==void 0&&{trusted_directory:t.trustedDirectory}})).response)}async enableRemoteControl(e,t,n){return(await this.request({subtype:"remote_control",enabled:e,...t!==void 0&&{name:t},reattach_session_id:n?.reattachSessionId,keep_session_on_exit:n?.keepSessionOnExit})).response}async submitFeedback(e,t){return(await this.request({subtype:"submit_feedback",description:e,surface:t?.surface,draft_id:t?.draft_id,type:t?.type,title:t?.title,area:t?.area,attach_transcript:t?.attach_transcript})).response}async generateSessionTitle(e,t){return yr("sdk_session_title_generate",async()=>(await this.request({subtype:"generate_session_title",description:e,persist:t?.persist})).response.title)}async askSideQuestion(e,t){return yr("sdk_side_question",async()=>{let r=(await this.request({subtype:"side_question",question:e,...t?.history?.length&&{history:[...t.history]}},t)).response;return r.response===null?null:{response:r.response,synthetic:r.synthetic??!1,...r.refusal_fallback&&{refusalFallback:{originalModel:r.refusal_fallback.original_model,fallbackModel:r.refusal_fallback.fallback_model,content:r.refusal_fallback.content}}}},()=>t?.signal?.aborted?"cancelled":"error")}async launchUltrareview(e,t){return(await this.request({subtype:"ultrareview_launch",args:e,confirm:t?.confirm??!1})).response}async messageRated(e){await this.request({subtype:"message_rated",messageUuid:e.messageUuid,sentiment:e.sentiment,surface:e.surface,cleared:e.cleared??!1})}processPendingPermissionRequests(e){for(let t of e)if(t.request.subtype==="can_use_tool")this.handleControlRequest(t).catch(()=>{})}processPendingUserDialogRequests(e){for(let t of e)if(t.request.subtype==="request_user_dialog")this.handleControlRequest(t).catch(()=>{})}request(e,t){let n=Math.random().toString(36).substring(2,15);this.transport.expectControlResponse?.(n);let r={request_id:n,type:"control_request",request:e},o=e.subtype==="initialize";return new Promise((s,i)=>{let a=t?.signal,c,l=(p)=>{c?.(),s(p)},u=(p)=>{c?.(),i(p)};if(a){let p=()=>{this.pendingControlResponses.delete(n),u(Or(a.reason??"Control request aborted"));try{Promise.resolve(this.transport.write(fe({type:"control_cancel_request",request_id:n})+`
`)).catch(()=>{})}catch{}};if(a.aborted){p();return}a.addEventListener("abort",p,{once:!0}),c=()=>{a.removeEventListener("abort",p)}}this.pendingControlResponses.set(n,{handler:(p)=>{if(this.pendingControlResponses.delete(n),p.subtype==="success")l(p);else u(_n(Error(p.error),{telemetryMessage:`Claude Code control request failed (${e.subtype})`,errorClass:"control_request_failed"}));if(!o&&(p.pending_permission_requests||p.pending_user_dialog_requests))de(`[Query] Ignoring prompt-redelivery fields on non-initialize response (subtype=${e.subtype})`);else{if(p.pending_permission_requests)this.processPendingPermissionRequests(p.pending_permission_requests);if(p.pending_user_dialog_requests)this.processPendingUserDialogRequests(p.pending_user_dialog_requests)}},reject:u}),Promise.resolve(this.transport.write(fe(r)+`
`)).catch((p)=>{this.pendingControlResponses.delete(n),u(p)})})}initializationResult(){return this.initialization}reinitialize(){return yr("sdk_reinitialize",()=>this.initialize())}async supportedCommands(){let{commands:e}=await this.initialization;return this.latestCommands??e}async supportedModels(){return(await this.initialization).models}async supportedAgents(){return(await this.initialization).agents}async reconnectMcpServer(e){await this.request({subtype:"mcp_reconnect",serverName:e})}async toggleMcpServer(e,t){return yr("sdk_mcp_toggle_server",async()=>{await this.request({subtype:"mcp_toggle",serverName:e,enabled:t})})}async enableChannel(e){return yr("sdk_mcp_enable_channel",async()=>{await this.request({subtype:"channel_enable",serverName:e})})}async mcpAuthenticate(e,t){return(await this.request({subtype:"mcp_authenticate",serverName:e,redirectUri:t})).response}async mcpClearAuth(e){return(await this.request({subtype:"mcp_clear_auth",serverName:e})).response}async mcpSubmitOAuthCallbackUrl(e,t){return(await this.request({subtype:"mcp_oauth_callback_url",serverName:e,callbackUrl:t})).response}async claudeAuthenticate(e){return(await this.request({subtype:"claude_authenticate",loginWithClaudeAi:e})).response}async claudeOAuthCallback(e,t){return(await this.request({subtype:"claude_oauth_callback",authorizationCode:e,state:t})).response}async claudeOAuthWaitForCompletion(){return(await this.request({subtype:"claude_oauth_wait_for_completion"})).response}async mcpServerStatus(){return(await this.request({subtype:"mcp_status"})).response.mcpServers}async getContextUsage(){return(await this.request({subtype:"get_context_usage"})).response}async usage_EXPERIMENTAL_MAY_CHANGE_DO_NOT_RELY_ON_THIS_API_YET(){return(await this.request({subtype:"get_usage"})).response}async readFile(e,t){try{return(await this.request({subtype:"read_file",path:e,max_bytes:t?.maxBytes,encoding:t?.encoding})).response}catch{return null}}async reloadPlugins(){return yr("sdk_reload_plugins",async()=>(await this.request({subtype:"reload_plugins"})).response)}async reloadSkills(){return yr("sdk_reload_skills",async()=>(await this.request({subtype:"reload_skills"})).response)}async setMcpServers(e){return yr("sdk_mcp_set_servers",async()=>{let t={},n={};for(let[a,c]of Object.entries(e))if(c.type==="sdk"&&"instance"in c)t[a]=c.instance;else n[a]=c;let r=new Set(this.sdkMcpServerInstances.keys()),o=new Set(Object.keys(t));for(let a of r)if(!o.has(a))await this.disconnectSdkMcpServer(a);for(let[a,c]of Object.entries(t))if(!r.has(a))this.connectSdkMcpServer(a,c);let s={};for(let a of Object.keys(t))s[a]={type:"sdk",name:a};return(await this.request({subtype:"mcp_set_servers",servers:{...n,...s}})).response})}async accountInfo(){return(await this.initialization).account}async streamInput(e){de("[Query.streamInput] Starting to process input stream");try{let t=0;for await(let n of e){if(t++,de(`[Query.streamInput] Processing message ${t}: ${n.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(fe(n)+`
`))}if(de(`[Query.streamInput] Finished processing ${t} messages from input stream`),t>0&&this.hasBidirectionalNeeds())de("[Query.streamInput] Has bidirectional needs, waiting for first result"),await this.waitForFirstResult();de("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(t){if(!(t instanceof or))throw t}}waitForFirstResult(){if(this.firstResultReceived)return de("[Query.waitForFirstResult] Result already received, returning immediately"),Promise.resolve();return new Promise((e)=>{let t=this.abortController?.signal;if(this.cleanupPerformed||t?.aborted){e();return}let n=()=>e();t?.addEventListener("abort",n,{once:!0}),this.addCleanupCallback(()=>{t?.removeEventListener("abort",n),e()}),this.firstResultReceivedResolve=()=>{t?.removeEventListener("abort",n),e()}})}handleHookCallbacks(e,t,n,r){let o=this.hookCallbacks.get(e);if(!o)throw Error(`No hook callback found for ID: ${e}`);return o(t,n,{signal:r})}connectSdkMcpServer(e,t){let n=new Dk((r)=>this.sendMcpServerMessageToCli(e,r));this.sdkMcpTransports.set(e,n),this.sdkMcpServerInstances.set(e,t),t.connect(n).catch((r)=>{if(this.sdkMcpTransports.get(e)===n)this.sdkMcpTransports.delete(e);if(this.sdkMcpServerInstances.get(e)===t)this.sdkMcpServerInstances.delete(e);de(`[Query.connectSdkMcpServer] Failed to connect MCP server '${e}': ${r}`,{level:"error"})})}async disconnectSdkMcpServer(e){let t=this.sdkMcpTransports.get(e);if(t)await t.close(),this.sdkMcpTransports.delete(e);this.sdkMcpServerInstances.delete(e)}sendMcpServerMessageToCli(e,t){if("id"in t&&t.id!==null&&t.id!==void 0){let r=`${e}:${t.id}`,o=this.pendingMcpResponses.get(r);if(o){o.resolve(t),this.pendingMcpResponses.delete(r);return}}let n={type:"control_request",request_id:mp(),request:{subtype:"mcp_message",server_name:e,message:t}};Promise.resolve(this.transport.write(fe(n)+`
`)).catch((r)=>{de(`[Query.sendMcpServerMessageToCli] Transport write failed: ${r}`,{level:"error"})})}handleMcpControlRequest(e,t,n){let r="id"in t.message?t.message.id:null,o=`${e}:${r}`;return new Promise((s,i)=>{let a=()=>{this.pendingMcpResponses.delete(o)},c=(u)=>{a(),s(u)},l=(u)=>{a(),i(u)};if(this.pendingMcpResponses.set(o,{resolve:c,reject:l}),n.onmessage)n.onmessage(t.message);else{a(),i(Error("No message handler registered"));return}})}}var b_=500,Ol=1048576;var WIe=[200,800];class Lk{send;pending=[];pendingEntries=0;pendingBytes=0;flushPromise=null;sendTimeoutMs;onError;maxPendingEntries;maxPendingBytes;backoffMs;constructor(e,t){this.send=e;let{sendTimeoutMs:n=60000,onError:r,maxPendingEntries:o=b_,maxPendingBytes:s=Ol,backoffMs:i=WIe}=t??{};this.sendTimeoutMs=n,this.onError=r,this.maxPendingEntries=o,this.maxPendingBytes=s,this.backoffMs=i}enqueue(e,t){let n=fe(t).length;if(this.pending.push({filePath:e,entries:t,bytes:n}),this.pendingEntries+=t.length,this.pendingBytes+=n,this.pendingEntries>this.maxPendingEntries||this.pendingBytes>this.maxPendingBytes)this.flushPromise=this.drain(),this.flushPromise.catch(()=>{})}async flush(){let e=this.drain();if(this.flushPromise=e,await e,this.flushPromise===e)this.flushPromise=null}async drain(){let e=this.flushPromise,t=this.pending.splice(0);if(this.pendingEntries=0,this.pendingBytes=0,e)await e;if(t.length===0)return;await this.doFlush(t)}async doFlush(e){let t=new Map;for(let n of e){let r=t.get(n.filePath);if(r)r.push(...n.entries);else t.set(n.filePath,n.entries.slice())}for(let[n,r]of t)await this.sendWithRetry(n,r)}async sendWithRetry(e,t){let n=this.backoffMs.length+1,r=`SessionStore.append() timed out after ${this.sendTimeoutMs}ms for ${e}`,o,s=1;for(;s<=n;s++)try{await Er(this.send(e,t),this.sendTimeoutMs,r),o=void 0;break}catch(i){if(o=Or(i),o.message===r)break;let a=this.backoffMs[s-1];if(a===void 0)break;await Hr(a)}if(o){de(`[TranscriptMirrorBatcher] flush failed for ${e} after ${s} attempt(s): ${o}`,{level:"error"});try{this.onError?.(e,o)}catch(i){de(`[TranscriptMirrorBatcher] onError callback threw: ${i}`,{level:"error"})}}}}var Pb=$a(TG(),1);var kG="\\p{Default_Ignorable_Code_Point}\\u2800",Ml=`\\p{Cc}\\p{Cf}\\p{Cs}\\p{Co}\\p{Cn}\\u2028\\u2029${kG}`,_St=new RegExp(`[${Ml}]+`,"gu"),ySt=new RegExp(`[[${Ml}]--[\\u200D\\uFE0E\\uFE0F]]+`,"gv"),bSt=new RegExp(`[[${Ml}]--[\\u200D\\uFE0E\\uFE0F\\n]]+`,"gv");var SSt=new RegExp(`[\\p{Cf}\\p{Co}\\p{Cn}\\u2028\\u2029\\u007F-\\u009F${kG}]`,"gu");function lLe(e){let t=e.replace(/[\p{Cf}\p{Co}\p{Cn}]/gu,"");return t=t.replace(/[\u200B-\u200F]/g,"").replace(/[\u202A-\u202E]/g,"").replace(/[\u2066-\u2069]/g,"").replace(/[\uFEFF]/g,"").replace(/[\uE000-\uF8FF]/g,""),t}function uLe(e){let t=Wb(e);for(let n=0;n<10;n++){let r=lLe(t);if(r===t)return t;t=r}return t}function dLe(e){let t=e,n="",r=0,o=10;while(t!==n&&r<o)n=t,t=t.normalize("NFKC"),t=uLe(t),r++;if(r>=o)throw Error(`Unicode sanitization reached maximum iterations (${o}) for input: ${e.slice(0,100)}`);return t}function ya(e){if(typeof e==="string")return dLe(e);if(Array.isArray(e))return e.map(ya);if(e!==null&&typeof e==="object"){let t={};for(let[n,r]of Object.entries(e))t[ya(n)]=ya(r);return t}return e}function k_(e){return e.replace(/[\p{Cc}\p{Cf}\u2028\u2029]+/gu," ")}function Nl(e){return e.startsWith("\uFEFF")?e.slice(1):e}import{readFile as zMe}from"fs/promises";import{once as IG}from"events";import{createWriteStream as ALe}from"fs";import{open as $G,lstat as $St,readdir as sf,realpath as jG,rename as jSt,stat as TLe}from"fs/promises";import{basename as kLe,dirname as CLe,join as co}from"path";var CG=1e4;async function ao(e,t,n){let r=Math.max(1,Math.floor(n?.maxPages??1e4)),o;for(let s=0;s<r;s++){if(n?.budget!==void 0){if(n.budget.pagesLeft<1)return{status:"capped"};n.budget.pagesLeft--}let i=await e(o);if(!i.ok)return{status:"error",error:i.error};if(await t(i.value.items),n?.until?.())return{status:"done"};if(o=i.value.cursor,!o)return{status:"done"}}return{status:"capped"}}import{execFile as xLe}from"child_process";import{promisify as vLe}from"util";import{execFileSync as pLe}from"child_process";import{lstatSync as fLe}from"fs";import{join as mLe}from"path";function hLe(){return process.platform==="win32"}class OG{resolved=new Map;lookup(e){return this.resolved.get(e)}remember(e,t){this.resolved.set(e,t)}forget(e){this.resolved.delete(e)}}var gLe=new ft(()=>new OG),_Le=5000;function RG(e){try{return fLe(e,{throwIfNoEntry:!1})===void 0}catch{return!1}}var yLe=new Set([".com",".exe",".bat",".cmd"]);function bLe(e){let t=e.toLowerCase().replace(/.*[\\/]/,"").replace(/[. ]+$/,""),n=t.lastIndexOf(".");return n>0&&yLe.has(t.slice(n))}function SLe(e,t=!1){let n=gLe.of(Nt().host),r=n.lookup(e);if(r!==void 0)if(r!==null){if(!RG(r))return r;n.forget(e)}else{if(!t)return r;n.forget(e)}let o=Cn.SYSTEMROOT||"C:\\Windows",s=mLe(o,"System32","where.exe");try{let a=pLe(s,[e],{stdio:"pipe",encoding:"utf8",timeout:_Le,windowsHide:!0,env:process.env}).trim().split(/\r?\n/).filter(Boolean),c=process.cwd(),l=!1;for(let u of a){if(RG(u))continue;if(ym(u,c)){l=!0;continue}if(!bLe(u))continue;return n.remember(e,u),u}if(a.length>0&&!l)n.remember(e,null);return null}catch(i){if(ELe(i))n.remember(e,null);return null}}function ELe(e){if(e===null||typeof e!=="object")return!1;let t="status"in e?e.status:void 0,n="signal"in e?e.signal:void 0,r="code"in e?e.code:void 0;return t===1&&!n&&!r}function PG(e,t=!1){if(!hLe())return e;if(e.includes("/")||e.includes("\\"))return e;return SLe(e,t)}var wLe=vLe(xLe);async function is(e){let t=PG("git");if(t===null)return[];try{let{stdout:n}=await wLe(t,["-c","core.hooksPath=/dev/null","-c","core.fsmonitor=","worktree","list","--porcelain"],{cwd:e,timeout:5000,windowsHide:!0});if(!n)return[];return n.split(`
`).filter((r)=>r.startsWith("worktree ")).map((r)=>ct(r.slice(9)))}catch{return[]}}var br=65536,RLe=new Set(["sdk-cli","sdk-ts","sdk-py"]);function HG(e,t){let n=Ul(e,"entrypoint")??nn(t,"entrypoint");if(n&&RLe.has(n))return!0;let r=e.split(`
`).find((s)=>s.includes('"parentUuid":'))??e,o=Ul(r,"sessionKind");return o==="daemon"||o==="daemon-worker"}var OLe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function nt(e){if(typeof e!=="string")return null;return OLe.test(e)?e:null}function BG(e){if(!e.includes("\\"))return e;try{return JSON.parse(`"${e}"`)}catch{return e}}function Ul(e,t){let n=[`"${t}":"`,`"${t}": "`];for(let r of n){let o=e.indexOf(r);if(o<0)continue;let s=o+r.length,i=s;while(i<e.length){if(e[i]==="\\"){i+=2;continue}if(e[i]==='"')return BG(e.slice(s,i));i++}}return}function nn(e,t){let n=[`"${t}":"`,`"${t}": "`],r,o=-1;for(let s of n){let i=0;while(!0){let a=e.indexOf(s,i);if(a<0)break;let c=a+s.length,l=c;while(l<e.length){if(e[l]==="\\"){l+=2;continue}if(e[l]==='"'){if(a>o)r=BG(e.slice(c,l)),o=a;break}l++}i=l+1}}return r}function P_(e,t,n){let r=`"type":"${t}"`,o=`"${n}":`,s=e.length;while(s>0){let i=e.lastIndexOf(`
`,s-1),a=e.slice(i+1,s);if(s=i,a.includes(r)&&a.includes(o))try{let c=JSON.parse(a);if(typeof c==="object"&&c!==null&&c.type===t){let l=c[n];if(typeof l==="string")return l}}catch{}if(i<0)break}return}function CC(e,t){let n=`"${t}":`,r=0;while(r<e.length){let o=e.indexOf(`
`,r),s=o<0?e.slice(r):e.slice(r,o);if(r=o<0?e.length:o+1,s.includes(n))try{let i=JSON.parse(s);if(typeof i==="object"&&i!==null){let a=i[t];if(typeof a==="string")return a}}catch{}}return}async function cf(e,t,n){return PLe(e,t,"w",n)}async function PLe(e,t,n,r){if(r!==void 0&&r.hoverRestOn&&(n==="w"||t.length>0))return ILe(r.source,t,n);let o=ALe(e,{mode:384,flags:n});try{for(let s of t)if(!o.write(JSON.stringify(s)+`
`))await IG(o,"drain");o.end(),await IG(o,"finish")}catch(s){throw o.destroy(),s}}async function ILe(e,t,n){let{backend:r,key:o}=e,s=t.map((a)=>({data:JSON.stringify(a)+`
`}));if(n==="w"){let a=await r.replaceRecords(o,s,{publishDiscipline:"inPlace",mode:384});if(!a.ok)throw Error("transcript stream replace failed",{cause:a.error});return}let i=await r.append(o,s);if(!i.ok)throw Error("transcript stream append failed",{cause:i.error})}function I_(e){let t=0,n={commandFallback:""};while(t<e.length){let r=e.indexOf(`
`,t),o=r>=0?e.slice(t,r):e.slice(t);if(t=r>=0?r+1:e.length,!o.includes('"type":"user"')&&!o.includes('"type": "user"'))continue;if(o.includes('"tool_result"'))continue;if(o.includes('"isMeta":true')||o.includes('"isMeta": true'))continue;if(o.includes('"isCompactSummary":true')||o.includes('"isCompactSummary": true'))continue;try{let s=JSON.parse(o),i=Pu(s,n);if(i!==void 0)return i}catch{continue}}return n.commandFallback}function KG(e){let t={commandFallback:""};for(let n of e){if(typeof n!=="object"||n===null)continue;let r=Pu(n,t);if(r!==void 0)return r}return t.commandFallback}async function DLe(e){let{backend:t,key:n}=e;try{let r=await t.read([{key:n,offset:0,length:br},{key:n,tail:br}]);if(!r.ok)return null;let[o,s]=r.value.items;if(!o.found||o.value.length===0)return null;let i=DG(o.value),a=s.found&&s.value.length>0?DG(s.value):i;return{head:i,tail:a,mtimeMs:o.mtimeMs,totalBytes:o.totalBytes}}catch{return null}}function DG(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8")}var ZSt=Buffer.from('"type":"user"'),YSt=Buffer.from('"type":"assistant"');function D_(e,t){if(e.kind!=="scope"||e.scope.namespace!=="transcript"||e.scope.projectKey===void 0||e.scope.sessionId!==void 0||!t(e.scope.projectKey))return;return e.scope.projectKey}function GG(e){return{skipScopeStats:!0,skipKeyStats:!0,...e!==void 0&&{cursor:e}}}function LLe(e){let t=new Map,n=new Proxy(e.backend,{get(r,o,s){let i=Reflect.get(r,o,s);if(o!=="listEntries")return typeof i==="function"?i.bind(r):i;return(c,l)=>{if(!(c.namespace==="transcript"&&!("projectKey"in c)&&Object.keys(l??{}).every((m)=>m==="cursor"||m==="skipScopeStats"||m==="skipKeyStats")))return r.listEntries(c,l);let p=[l?.cursor??"",l?.skipScopeStats,l?.skipKeyStats].map(String).join("\x00"),f=t.get(p);if(f===void 0){f=r.listEntries(c,l),t.set(p,f);let m=()=>{t.delete(p)};f.then((h)=>{if(!h.ok)m()},m)}return f}}});return{...e,backend:n}}async function lf(e,t){if(t!==void 0&&t.hoverRestOn)return WG(t.source);try{let n=await $G(e,"r");try{let r=await n.stat(),o=Buffer.allocUnsafe(br),s=await n.read(o,0,br,0);if(s.bytesRead===0)return null;let i=o.toString("utf8",0,s.bytesRead),a=Math.max(0,r.size-br),c=i;if(a>0){let l=await n.read(o,0,br,a);c=o.toString("utf8",0,l.bytesRead)}return{mtime:r.mtime.getTime(),size:r.size,head:i,tail:c}}finally{await n.close()}}catch{return null}}async function WG(e){let t=await DLe(e);if(t===null)return null;return{mtime:Math.trunc(t.mtimeMs),size:t.totalBytes,head:t.head,tail:t.tail}}var as=200;function MLe(e){return Math.abs(eT(e)).toString(36)}function Fl(e){return e.replace(/[^a-zA-Z0-9]/g,"-")}function uf(e){let t=Fl(e);if(t.length<=as)return t;return`${t.slice(0,as)}-${MLe(e)}`}function C_(e,t){let n=e.replaceAll("\\","/");return t?n.toLowerCase():n}function LG(e,t,n){let r=ct(e),o=ct(t),s=(i)=>n?i.toLowerCase():i;if(s(Fl(r))!==s(Fl(o)))return!1;return C_(r,n)!==C_(o,n)}async function qG(e,t,n,r){if(!LG(e,t,n))return!1;if(jb(e)||jb(t))return!1;if(await r(e)||await r(t))return!1;let o;try{o=ct(await jG(e))}catch{return!1}let s=await ls(t);return LG(o,s,n)}function VG(e,t,n){if(t===void 0)return!1;let r=C_(ct(e),n);return t.some((o)=>{let s=C_(ct(o),n);return r===s||r.startsWith(s.endsWith("/")?s:s+"/")})}function RC(){return process.platform==="win32"||process.platform==="darwin"}function It(){return co(jt(),"projects")}function cs(e){return lL()??uf(e)}function OC(e){let t=uf(e);return t===cs(e)?void 0:t}function zl(e){return co(It(),cs(e))}function Sa(e,t){let n=kLe(e);return CLe(e)===It()&&t(n)?n:void 0}async function ls(e){try{return ct(await jG(e))}catch{return ct(e)}}async function $l(e,t,n,r){let o=r!==void 0&&r.hoverRestOn?r.source:void 0,s=o===void 0?void 0:Sa(e,o.isKeySegment);if(o!==void 0&&s!==void 0){let c=await NLe(s,t,n,o);if(c!==void 0)return c}let i=Fl(t),a;try{a=await sf(e,{withFileTypes:!0})}catch{return!1}for(let c of a){if(!c.isFile()||!c.name.endsWith(".jsonl"))continue;let l=await lf(co(e,c.name));if(l===null)continue;if(ZG(l,i,n))return!0}return!1}function ZG(e,t,n){let r=P_(e.tail,"relocated","relocatedCwd")??CC(e.head,"cwd");if(r===void 0)return!1;let o=Fl(ct(r));return n?o.toLowerCase()===t.toLowerCase():o===t}async function NLe(e,t,n,r){let{backend:o,transcriptKey:s,isKeySegment:i}=r,a=Fl(t),c=!1,l=new Set;try{let u=await ao((p)=>o.listEntries({namespace:"transcript",projectKey:e},GG(p)),async(p)=>{for(let f of p){if(f.kind!=="key"||f.key.namespace!=="transcript"||f.key.projectKey!==e||f.key.agentId!==void 0||!i(f.key.sessionId)||l.has(f.key.sessionId))continue;let m=f.key.sessionId,h=await WG({backend:o,key:s(e,m)});if(h===null)continue;if(l.add(m),ZG(h,a,n)){c=!0;return}}},{until:()=>c});if(c)return!0;if(u.status!=="done")return}catch{return}return!1}async function Gn(e,t){if(t!==void 0&&t.hoverRestOn)return ULe(e,t);let n=zl(e),r=[];try{await sf(n),r.push(n)}catch{}let o=OC(e);if(o!==void 0){let p=co(It(),o);try{await sf(p),r.push(p)}catch{}return r}let s=uf(e);if(s.length<=as)return r;let i=It(),a=process.platform==="win32",c=(p)=>a?p.toLowerCase():p,l=c(s.slice(0,as)+"-"),u=c(n);try{for(let p of await sf(i,{withFileTypes:!0})){if(!p.isDirectory()||!c(p.name).startsWith(l))continue;let f=co(i,p.name);if(c(f)!==u&&await $l(f,e,a))r.push(f)}}catch{}return r}async function ULe(e,t){let n=await jl(t.source);if(n===null){let r=OC(e);return[zl(e),...r!==void 0?[co(It(),r)]:[]]}return PC(e,n,process.platform==="win32",t)}async function jl(e){let{backend:t,isKeySegment:n}=e,r=[],o=new Set,s=0;try{if((await ao((a)=>t.listEntries({namespace:"transcript"},GG(a)),(a)=>{for(let c of a){let l=D_(c,n);if(l!==void 0&&!o.has(l))o.add(l),r.push(l)}s++})).status==="error")return s===0?null:r}catch{return s===0?null:r}return r}async function PC(e,t,n,r){let o=cs(e),s=zl(e),i=OC(e),a=i===void 0&&o.length>as?o.slice(0,as)+"-":void 0,c=It(),l=(S)=>n?S.toLowerCase():S,u=a!==void 0?l(a):void 0,p=l(o),f=!1,m,h=[],_=new Set;for(let S of t)if(S===o)f=!0;else if(i!==void 0){if(m===void 0&&l(S)===l(i))m=co(c,S)}else if(u!==void 0&&l(S).startsWith(u)&&l(S)!==p&&!_.has(l(S)))_.add(l(S)),h.push(S);let y=[];for(let S of h){let b=co(c,S);if(await $l(b,e,n,r))y.push(b)}return[...f?[s]:[],...m!==void 0?[m]:[],...y]}async function FLe(e,t){let n=[];for(let r of await is(e)){if(r===e)continue;let o=await Gn(r,t);if(t!==void 0&&t.hoverRestOn){let s=zl(r);if(!o.includes(s))o.push(s)}for(let s of o)n.push({worktreePath:r,projectDir:s})}return n}async function ti(e,t,n,r){let o=`${e}.jsonl`,s=r&&n!==void 0&&n.isKeySegment(e)?LLe(n):void 0,i=s===void 0?void 0:{source:s,hoverRestOn:r};async function a(u,p){let f=co(u,o);if(s){let m=Sa(u,s.isKeySegment);if(m!==void 0){try{let h=await s.backend.stat(s.transcriptKey(m,e));if(h.ok){let _=h.value.storedBytes??h.value.size;if(_>0)return{filePath:f,projectPath:p,fileSize:_}}}catch{}return}}try{let m=await TLe(f);if(m.size>0)return{filePath:f,projectPath:p,fileSize:m.size}}catch{}return}if(t){let u=await ls(t);for(let p of await Gn(u,i)){let f=await a(p,u);if(f)return f}for(let{worktreePath:p,projectDir:f}of await FLe(u,i)){let m=await a(f,p);if(m)return m}return}let c=It();if(s){let u=new Map;try{if((await ao((m)=>s.backend.listEntries({namespace:"transcript"},m!==void 0?{cursor:m}:void 0),(m)=>{for(let h of m){let _=D_(h,s.isKeySegment);if(_===void 0)continue;let y=h.kind==="scope"&&h.mtimeMs!==void 0?h.mtimeMs:Number.NEGATIVE_INFINITY,S=u.get(_);if(S===void 0)u.set(_,{projectKey:_,mtimeMs:y});else if(y>S.mtimeMs)S.mtimeMs=y}})).status==="error")return}catch{return}let p=[...u.values()];p.sort((f,m)=>f.mtimeMs!==m.mtimeMs?m.mtimeMs-f.mtimeMs:f.projectKey<m.projectKey?-1:f.projectKey>m.projectKey?1:0);for(let{projectKey:f}of p){let m=await a(co(c,f),void 0);if(m)return m}return}let l;try{l=await sf(c)}catch{return}for(let u of l){let p=await a(co(c,u),void 0);if(p)return p}return}var zLe=1048576,YG=5242880,$Le;function JG(e){try{let t=JSON.parse(e);if(t.type!=="system"||t.subtype!=="compact_boundary")return null;return{hasPreservedSegment:Boolean(t.compactMetadata?.preservedSegment||t.compactMetadata?.preservedMessages)}}catch{return null}}function ba(e,t,n,r){let o=r-n;if(o<=0)return;if(e.len+o>e.buf.length){let s=Buffer.allocUnsafe(Math.min(Math.max(e.buf.length*2,e.len+o),e.cap));e.buf.copy(s,0,0,e.len),e.buf=s}t.copy(e.buf,e.len,n,r),e.len+=o}function R_(e,t,n,r){return r-n>=t.length&&e.compare(t,0,t.length,n,n+t.length)===0}var O_=Buffer.from('{"type":"attribution-snapshot"'),jLe=Buffer.from('{"type":"system"'),af=10,HLe=Buffer.from([af]),BLe=256;function MG(e,t,n){if(e.straddleSnapCarryLen=0,e.straddleSnapTailEnd=0,e.carryLen===0)return 0;let r=e.carryBuf,o=t.indexOf(af);if(o===-1||o>=n)return 0;let s=o+1;if(R_(r,O_,0,e.carryLen))e.straddleSnapCarryLen=e.carryLen,e.straddleSnapTailEnd=s,e.lastSnapSrc=null;else if(e.carryLen<O_.length)return 0;else{if(R_(r,jLe,0,e.carryLen)){let i=JG(r.toString("utf-8",0,e.carryLen)+t.toString("utf-8",0,o));if(i?.hasPreservedSegment)e.hasPreservedSegment=!0;else if(i)e.out.len=0,e.boundaryStartOffset=e.bufFileOff,e.hasPreservedSegment=!1,e.lastSnapSrc=null}ba(e.out,r,0,e.carryLen),ba(e.out,t,0,s)}return e.bufFileOff+=e.carryLen+s,e.carryLen=0,s}function NG(e,t,n){let r=t.indexOf(n),o=0,s=0,i=-1,a=-1,c=t.indexOf(af);while(c!==-1){let l=c+1;if(r!==-1&&r<s)r=t.indexOf(n,s);if(R_(t,O_,s,l))ba(e.out,t,o,s),i=s,a=l,o=l;else if(r>=s&&r<Math.min(s+BLe,l)){let u=JG(t.toString("utf-8",s,c));if(u?.hasPreservedSegment)e.hasPreservedSegment=!0;else if(u)e.out.len=0,e.boundaryStartOffset=e.bufFileOff+s,e.hasPreservedSegment=!1,e.lastSnapSrc=null,i=-1,e.straddleSnapCarryLen=0,o=s;r=t.indexOf(n,r+n.length)}s=l,c=t.indexOf(af,s)}return ba(e.out,t,o,s),{lastSnapStart:i,lastSnapEnd:a,trailStart:s}}function UG(e,t,n,r,o){if(r!==-1){if(e.lastSnapLen=o-r,e.lastSnapBuf===void 0||e.lastSnapLen>e.lastSnapBuf.length)e.lastSnapBuf=Buffer.allocUnsafe(e.lastSnapLen);t.copy(e.lastSnapBuf,0,r,o),e.lastSnapSrc=e.lastSnapBuf}else if(e.straddleSnapCarryLen>0){if(e.lastSnapLen=e.straddleSnapCarryLen+e.straddleSnapTailEnd,e.lastSnapBuf===void 0||e.lastSnapLen>e.lastSnapBuf.length)e.lastSnapBuf=Buffer.allocUnsafe(e.lastSnapLen);e.carryBuf.copy(e.lastSnapBuf,0,0,e.straddleSnapCarryLen),n.copy(e.lastSnapBuf,e.straddleSnapCarryLen,0,e.straddleSnapTailEnd),e.lastSnapSrc=e.lastSnapBuf}}function FG(e,t,n){if(e.carryLen=t.length-n,e.carryLen>0){if(e.carryBuf===void 0||e.carryLen>e.carryBuf.length)e.carryBuf=Buffer.allocUnsafe(e.carryLen);t.copy(e.carryBuf,0,n,t.length)}}function zG(e){if(e.carryLen>0){let t=e.carryBuf;if(R_(t,O_,0,e.carryLen))e.lastSnapSrc=t,e.lastSnapLen=e.carryLen;else ba(e.out,t,0,e.carryLen)}if(e.lastSnapSrc){if(e.out.len>0&&e.out.buf[e.out.len-1]!==af)ba(e.out,HLe,0,1);ba(e.out,e.lastSnapSrc,0,e.lastSnapLen)}}async function XG(e,t,n){let r=$Le??=Buffer.from('"compact_boundary"'),o=zLe,s={out:{buf:Buffer.allocUnsafe(Math.min(t,8388608)),len:0,cap:t+1},boundaryStartOffset:0,hasPreservedSegment:!1,lastSnapSrc:null,lastSnapLen:0,lastSnapBuf:void 0,bufFileOff:0,carryLen:0,carryBuf:void 0,straddleSnapCarryLen:0,straddleSnapTailEnd:0};if(n!==void 0&&n.hoverRestOn){let{backend:c,key:l}=n.source,u=0;while(u<t){let p=await c.read([{key:l,offset:u,length:Math.min(o,t-u)}]);if(!p.ok)throw Error("transcript ranged read failed",{cause:p.error});let[f]=p.value.items;if(!f.found)throw Error("transcript stream absent during load");if(f.value.length===0)break;let m=Buffer.from(f.value.buffer,f.value.byteOffset,f.value.length),h=m.length;u+=h;let _=MG(s,m,h),y;if(s.carryLen>0){let b=s.carryLen+(h-_);y=Buffer.allocUnsafe(b),s.carryBuf.copy(y,0,0,s.carryLen),m.copy(y,s.carryLen,_,h)}else y=m.subarray(_,h);let S=NG(s,y,r);UG(s,y,m,S.lastSnapStart,S.lastSnapEnd),FG(s,y,S.trailStart),s.bufFileOff+=S.trailStart}return zG(s),{boundaryStartOffset:s.boundaryStartOffset,postBoundaryBuf:s.out.buf.subarray(0,s.out.len),hasPreservedSegment:s.hasPreservedSegment}}let i=Buffer.allocUnsafe(o),a=await $G(e,"r");try{let c=0;while(c<t){let{bytesRead:l}=await a.read(i,0,Math.min(o,t-c),c);if(l===0)break;c+=l;let u=MG(s,i,l),p;if(s.carryLen>0){let m=s.carryLen+(l-u);p=Buffer.allocUnsafe(m),s.carryBuf.copy(p,0,0,s.carryLen),i.copy(p,s.carryLen,u,l)}else p=i.subarray(u,l);let f=NG(s,p,r);UG(s,p,i,f.lastSnapStart,f.lastSnapEnd),FG(s,p,f.trailStart),s.bufFileOff+=f.trailStart}zG(s)}finally{await a.close()}return{boundaryStartOffset:s.boundaryStartOffset,postBoundaryBuf:s.out.buf.subarray(0,s.out.len),hasPreservedSegment:s.hasPreservedSegment}}var QG=/^[0-9a-f]{16}(?:[0-9a-f]{48})?@v\d+$/;function eW(e,t,n){return{type:"history-suppression",sessionId:e,cause:t,...n&&{vetoedAgainstAccountUuid:n},ts:new Date().toISOString()}}import{basename as AW,dirname as TW,isAbsolute as $Et,join as FMe,relative as jEt,sep as HEt}from"path";function X(e,t){return{code:"InvalidArgument",argument:e,...t!==void 0&&{reason:t}}}var KLe=String.fromCharCode(0),GLe=/^\.[0-9a-f]{16}\.aside$/;function WLe(e){if(e.charCodeAt(0)!==46)return!1;return ni(e).some((t)=>GLe.test(t))}function tW(e){return typeof e==="string"&&/^[. ]+$/.test(e)}function Wn(e){return!(typeof e!=="string"||e.length===0||tW(e)||e.includes("/")||e.includes("\\")||e.includes(KLe)||WLe(e))}function qn(e){return e.length>0&&e.every(Wn)}function DC(e){return ni(e).some((t)=>t.endsWith(".jsonl"))}function ni(e){let t=L_.get(e);if(t!==void 0)return t;let n=Object.freeze(qLe(e));if(L_.size>=VLe)L_.clear();return L_.set(e,n),n}function qLe(e){let t=e.toLowerCase(),n=t.indexOf(":");return n===-1?[IC(t)]:[IC(t),IC(t.slice(0,n))]}var L_=new Map,VLe=32768;function IC(e){let t=e.length;while(t>0){let n=e.charCodeAt(t-1);if(n!==46&&n!==32)break;t-=1}return t===e.length?e:e.slice(0,t)}function M_(e,t,n){return n===void 0?e:{...e,[t]:n}}function ZLe(e,t,n,r){let s=M_({namespace:"transcript",projectKey:e,sessionId:t},"agentId",n);return M_(s,"agentRelPath",r)}var un={transcript:ZLe,journal:(e,t,n)=>({namespace:"transcript",projectKey:e,sessionId:t,agentRelPath:n,journal:!0}),history:()=>({namespace:"history"}),log:(e,t,n)=>{let o=M_({namespace:"log",sessionId:e,channel:t},"agentId",n?.agentId);return M_(o,"runId",n?.runId)},globalConfig:()=>({namespace:"globalConfig"}),globalConfigCopy:(e,t)=>({namespace:"globalConfig",kind:e,stamp:t}),userSettings:()=>({namespace:"settings",layer:"user"}),projectSettings:(e)=>({namespace:"settings",layer:"project",projectKey:e}),localSettings:(e)=>({namespace:"settings",layer:"local",consentRootKey:e}),task:(e,t)=>({namespace:"task",listId:e,taskId:t}),taskListMeta:(e)=>({namespace:"task",listId:e,meta:!0}),taskListHighWaterMark:(e)=>({namespace:"task",listId:e,highWaterMark:!0}),memory:(e,t)=>({namespace:"memory",projectKey:e,relPath:t}),pluginRegistry:(e)=>({namespace:"pluginRegistry",file:e}),marketplaceCache:(e,t)=>({namespace:"marketplaceCache",marketplace:e,form:t}),pluginCache:(e,t,n,r)=>({namespace:"pluginCache",marketplace:e,plugin:t,version:n,relPath:r}),cache:(e,t)=>({namespace:"cache",store:e,id:t}),paste:(e)=>({namespace:"paste",id:e}),state:(e)=>({namespace:"state",id:e}),pluginAssetCache:(e)=>({namespace:"pluginAssetCache",digest:e}),plan:(e)=>({namespace:"plan",name:e}),daemon:(e)=>({namespace:"daemon",relPath:e}),feedbackDraft:(e)=>({namespace:"feedbackDraft",draftId:e}),agentMemory:(e,t)=>({namespace:"agentMemory",layer:"user",agentType:e,relPath:t}),identity:()=>({namespace:"identity"}),team:(e)=>({namespace:"team",team:e}),sidecar:(e,t,n)=>({namespace:"sidecar",projectKey:e,sessionId:t,relPath:n}),mailbox:(e,t)=>({namespace:"mailbox",team:e,teammate:t}),scratch:(e,t)=>({namespace:"scratch",sessionId:e,relPath:t}),userConfigDir:(e,t)=>({namespace:"userConfigDir",dir:e,relPath:t}),fileHistory:(e,t)=>({namespace:"fileHistory",sessionId:e,backupFileName:t}),job:(e,t)=>({namespace:"job",jobId:e,relPath:t}),jobTimeline:(e)=>({namespace:"jobTimeline",jobId:e}),recording:(e,t,n)=>({namespace:"recording",projectKey:e,sessionId:t,stamp:n}),sessionLog:(e,t,n)=>({namespace:"sessionLog",projectKey:e,year:t.year,month:t.month,day:t.day,logName:n}),jobPins:()=>({namespace:"jobsRoot",file:"pins"}),jobDraft:(e)=>({namespace:"jobsRoot",draftKey:e}),session:(e)=>({namespace:"session",file:e}),bridgePointer:(e)=>({namespace:"bridgePointer",projectKey:e}),sessionAliases:(e)=>({namespace:"sessionAliases",projectKey:e})};class nW{available=void 0;probing=void 0;procUnreadableLogged=!1}var wEt=new ft(()=>new nW);function eMe(e){return X(e,"expected a segment that is not empty or made only of dots and spaces, with no path separator, NUL or set-aside shape")}function Ea(e){if(typeof e!=="object"||e===null)return X("key","expected a key object");let t=aMe(e);if(t!==void 0)return t;let n=DMe(e);if(n===void 0)return X("key",`${e.namespace} is not a storage namespace`);return oW("key",n)}function oW(e,t){for(let[n,r,o]of t){let s=`${e}.${n}`;if(r===void 0){if(o!=="optional")return X(s,"required")}else if(tMe(n)){if(!Array.isArray(r)||!qn(r))return X(s,"expected a non-empty array of segments, none empty or made only of dots and spaces, with no path separator, NUL or set-aside shape")}else if(typeof r!=="string"||!Wn(r))return eMe(s)}return}function tMe(e){return e==="relPath"||e==="agentRelPath"}var sW=["commands","agents","output-styles","skills","workflows","routines","themes","rules","session-env","uploads","mcp-skill-archives","usage-data","mcp-discovery-cache"];var iW=new Set(sW),aW=`must be one of the userConfigDir directory names (${sW.join(", ")})`,cW=["installed","marketplaces","flagged","catalog","inUseSweep"];var nMe=new Set(cW),rMe=`must be one of the pluginRegistry files (${cW.join(", ")})`,lW=["manifest","catalog"];var oMe=new Set(lW),sMe=`must be one of the marketplaceCache forms (${lW.join(", ")})`;function iMe(e){return typeof e==="string"&&/^[0-9a-f]{64}$/.test(e)}function aMe(e){if(e.namespace==="transcript")return uMe(e);if(e.namespace==="pluginAssetCache"&&!iMe(e.digest))return X("key.digest","must be a SHA-256 digest: 64 lowercase hexadecimal characters");if(e.namespace==="globalConfig"&&"kind"in e){if(!fW(e.kind))return X("key.kind",pW);if(typeof e.stamp!=="string")return X("key.stamp","a recovery copy key carries its stamp")}if(e.namespace==="task")return wMe(e);if(e.namespace==="sidecar"){let t=U_("key.sessionId",e.sessionId);if(t!==void 0)return t;if(F_(e.relPath))return X("key.relPath",df);return _W(e.relPath)?X("key.relPath",hW):void 0}if(e.namespace==="recording")return U_("key.sessionId",e.sessionId)??(gW(e.stamp)?void 0:X("key.stamp",fMe));if(e.namespace==="jobsRoot")return AMe(e);if(e.namespace==="userConfigDir"&&!iW.has(e.dir))return X("key.dir",aW);if(e.namespace==="fileHistory")return cMe(e);if(e.namespace==="settings"&&!vMe(e.layer))return X("key.layer","must be user, project or local");if(e.namespace==="log"&&!SW(e.channel))return X("key.channel",bW);if(e.namespace==="job"&&vW(e.relPath))return X("key.relPath",xW);if(e.namespace==="sessionLog")return wW("key",e)??(OMe(e.logName)?void 0:X("key.logName","must be the session-log stem <sessionId8>[-<title-slug>]: up to eight word characters, then lower-case a-z / 0-9 runs joined by single hyphens; not a bare device name"));if(e.namespace==="pluginRegistry"&&!nMe.has(e.file))return X("key.file",rMe);if(e.namespace==="marketplaceCache"&&!oMe.has(e.form))return X("key.form",sMe);if(e.namespace!=="agentMemory")return;if(!uW(e.layer))return X("key.layer","must be user, project or local");if(e.layer==="user"&&"projectKey"in e)return X("key.projectKey","the user layer is not keyed by project");if(e.layer!=="user"&&typeof e.projectKey!=="string")return X("key.projectKey","required for the project and local layers");return typeof e.agentType==="string"?void 0:X("key.agentType","an agent memory key names its agent")}function cMe(e){return typeof e.backupFileName!=="string"||!QG.test(e.backupFileName)?X("key.backupFileName","must be a backup file name the engine has ever written (hex hash @v version)"):void 0}function uW(e){return e==="user"||e==="project"||e==="local"}var dW=["backup","corrupted"];var lMe=new Set(dW),pW=`must be one of the global-config copy kinds (${dW.join(", ")})`;function fW(e){return lMe.has(e)}function uMe(e){let t=U_("key.sessionId",e.sessionId);if(t!==void 0)return t;if(F_(e.agentRelPath))return X("key.agentRelPath",df);if("journal"in e){if(e.journal!==!0)return X("key.journal","must be true");if(!Array.isArray(e.agentRelPath))return X("key.agentRelPath","a run journal key carries its run directory");return e.agentId===void 0?void 0:X("key.agentId","a transcript key names an agent transcript or the run journal, never both")}return e.agentRelPath!==void 0&&e.agentId===void 0?X("key.agentRelPath","requires agentId or journal"):void 0}var dMe="cloud-snapshots",mW=new Set(["memory","tiny_memory","bagel",dMe,"bridge-pointer.json",".session-aliases"]),pMe=/^[0-9]{1,16}$/,fMe="must be the recording stamp: 1 to 16 decimal digits (epoch milliseconds)",N_=".cast",hW=`<stamp>${N_} inside a session's folder is that session's terminal recording stream: address it as keys.recording(projectKey, sessionId, stamp)`;function gW(e){return typeof e==="string"&&pMe.test(e)}function _W(e){return Array.isArray(e)&&typeof e[0]==="string"&&ni(e[0]).some((t)=>mMe(t)!==void 0)}function mMe(e){if(!e.endsWith(N_))return;let t=e.slice(0,-N_.length);return gW(t)?t:void 0}var yW=[".ccr-tip.json",".precompact.json",N_],hMe=`must not end with ${yW.join(", ")}: those name a session's project-level sibling files`;function gMe(e){return ni(e).some((t)=>yW.some((n)=>t.endsWith(n)))}var _Me=`${[...mW].join(", ")} are reserved: they name project-level entries, not sessions`;function yMe(e){return ni(e).some((t)=>mW.has(t))}function U_(e,t){if(typeof t!=="string")return;if(yMe(t))return X(e,_Me);if(gMe(t))return X(e,hMe);return DC(t)?X(e,df):void 0}var bMe=".meta.json",SMe=".meta is reserved for the list metadata key, under every spelling that opens its file";function EMe(e){return xMe(`${e}.json`)}function xMe(e){return ni(e).includes(bMe)}var df="names a .jsonl stream, which only a transcript key addresses";function F_(e){return Array.isArray(e)&&e.some((t)=>typeof t==="string"&&DC(t))}function vMe(e){return e==="user"||e==="project"||e==="local"}var bW="must be debug, telemetry or apiDump";function SW(e){return e==="debug"||e==="telemetry"||e==="apiDump"}function wMe(e){if("taskId"in e&&(("meta"in e)||("highWaterMark"in e)))return X("key.taskId","a task key names an item, the list metadata or the list high-water mark, never more than one");if("meta"in e&&"highWaterMark"in e)return X("key.highWaterMark","a task key names an item, the list metadata or the list high-water mark, never more than one");if("meta"in e&&e.meta!==!0)return X("key.meta","must be true");if("highWaterMark"in e&&e.highWaterMark!==!0)return X("key.highWaterMark","must be true");if(typeof e.listId!=="string")return X("key.listId","a task key carries its listId");if("meta"in e||"highWaterMark"in e)return;if(typeof e.taskId!=="string")return X("key.taskId","a task item key carries its taskId");if(EMe(e.taskId))return X("key.taskId",SMe);return}function AMe(e){if("file"in e&&"draftKey"in e)return X("key.draftKey","a jobs-root key names the pins file or one draft, never both");if("file"in e)return e.file==="pins"?void 0:X("key.file","must be pins");if(typeof e.draftKey!=="string")return X("key.draftKey","a jobs-root draft key carries its draftKey");return IMe.test(e.draftKey)?void 0:X("key.draftKey","must be 8 lowercase hex characters")}var EW="timeline.jsonl",xW=`${EW} is the job's timeline stream: address it as keys.jobTimeline(jobId)`;function vW(e){return Array.isArray(e)&&typeof e[0]==="string"&&ni(e[0]).includes(EW)}var TMe=/^\d{4}$/,rW=/^\d{2}$/,kMe=/^[A-Za-z0-9_-]{1,8}(?:-[a-z0-9]+)*$/,CMe=128,RMe=/^(?:con|prn|aux|nul|com\d|lpt\d)$/i;function OMe(e){return typeof e==="string"&&e.length<=CMe&&kMe.test(e)&&!RMe.test(e)}function wW(e,t){if(t.year!==void 0&&!LC(TMe,t.year))return X(`${e}.year`,"must be four digits (YYYY)");if(t.month!==void 0&&!LC(rW,t.month))return X(`${e}.month`,"must be two digits (MM)");if(t.day!==void 0&&!LC(rW,t.day))return X(`${e}.day`,"must be two digits (DD)");return}function LC(e,t){return typeof t==="string"&&e.test(t)}function PMe(e){if(e.year!==void 0&&e.projectKey===void 0)return X("scope.projectKey","required when year is given");if(e.month!==void 0&&e.year===void 0)return X("scope.year","required when month is given");if(e.day!==void 0&&e.month===void 0)return X("scope.month","required when day is given");return wW("scope",e)}var IMe=/^[0-9a-f]{8}$/;function DMe(e){switch(e.namespace){case"transcript":return[["projectKey",e.projectKey],["sessionId",e.sessionId],["agentId",e.agentId,"optional"],["agentRelPath",e.agentRelPath,"optional"]];case"history":case"identity":return[];case"globalConfig":return"kind"in e?[["stamp",e.stamp]]:[];case"settings":return e.layer==="user"?[]:e.layer==="project"?[["projectKey",e.projectKey]]:[["consentRootKey",e.consentRootKey]];case"task":return"taskId"in e?[["listId",e.listId],["taskId",e.taskId]]:[["listId",e.listId]];case"memory":return[["projectKey",e.projectKey],["relPath",e.relPath]];case"pluginRegistry":return[];case"marketplaceCache":return[["marketplace",e.marketplace]];case"pluginCache":return[["marketplace",e.marketplace],["plugin",e.plugin],["version",e.version],["relPath",e.relPath]];case"cache":return[["store",e.store],["id",e.id]];case"paste":return[["id",e.id]];case"pluginAssetCache":return[["digest",e.digest]];case"state":return[["id",e.id]];case"plan":return[["name",e.name]];case"feedbackDraft":return[["draftId",e.draftId]];case"agentMemory":return[...e.layer==="user"?[]:[["projectKey",e.projectKey]],["agentType",e.agentType],["relPath",e.relPath]];case"team":return[["team",e.team]];case"sidecar":return[["projectKey",e.projectKey],["sessionId",e.sessionId],["relPath",e.relPath]];case"scratch":return[["sessionId",e.sessionId],["relPath",e.relPath]];case"userConfigDir":return[["relPath",e.relPath]];case"fileHistory":return[["sessionId",e.sessionId],["backupFileName",e.backupFileName]];case"job":return[["jobId",e.jobId],["relPath",e.relPath]];case"daemon":return[["relPath",e.relPath]];case"jobsRoot":return"file"in e?[]:[["draftKey",e.draftKey]];case"session":return[["file",e.file]];case"bridgePointer":case"sessionAliases":return[["projectKey",e.projectKey]];case"mailbox":return[["team",e.team],["teammate",e.teammate]];case"log":return[["sessionId",e.sessionId],["agentId",e.agentId,"optional"],["runId",e.runId,"optional"]];case"jobTimeline":return[["jobId",e.jobId]];case"recording":return[["projectKey",e.projectKey],["sessionId",e.sessionId],["stamp",e.stamp]];case"sessionLog":return[["projectKey",e.projectKey],["year",e.year],["month",e.month],["day",e.day],["logName",e.logName]]}return}function MC(e){if(typeof e!=="object"||e===null)return X("scope","expected a scope object");let t=UMe(e);if(t===void 0)return X("scope",`${String(e.namespace)} is not a listable namespace`);return MMe(e)??oW("scope",t)}var LMe={transcript:[["agentId","names one agent transcript, a stream key, not a scope: narrow a scope with agentRelPath"],["journal","names a run journal, a stream key, not a scope: narrow a scope with agentRelPath"]],log:[["agentId","names one log stream, a stream key, not a scope"],["runId","names one log stream, a stream key, not a scope"]],sessionLog:[["logName","names one session's log, a stream key, not a scope: a day scope lists its logs"]],task:[["taskId","names one task value, a key, not a scope: a list scope narrows with listId only"],["meta","names one task value, a key, not a scope: a list scope narrows with listId only"],["highWaterMark","names one task value, a key, not a scope: a list scope narrows with listId only"]],mailbox:[["teammate","names one inbox, a key, not a scope"]],cache:[["id","names one cached value, a key, not a scope: a cache scope narrows with store only"]],pluginAssetCache:[["digest","names one cached asset, a key, not a scope"]],fileHistory:[["backupFileName","names one backup, a key, not a scope: a file-history scope narrows with sessionId only"]],state:[["id","names one value, a key, not a scope"]],feedbackDraft:[["draftId","names one draft, a key, not a scope"]],jobsRoot:[["file","names one value, a key, not a scope"],["draftKey","names one value, a key, not a scope"]],plan:[["name","names one plan, a key, not a scope"]],paste:[["id","names one paste, a key, not a scope"]],session:[["file","names one value, a key, not a scope"]],globalConfig:[["stamp","names one recovery copy, a key, not a scope: the scope narrows with kind only"]],memory:[],pluginCache:[],daemon:[],sidecar:[],agentMemory:[],scratch:[],userConfigDir:[],job:[]};function MMe(e){let t=e.namespace==="agentMemory"?NMe(e):void 0;if(t!==void 0)return t;if(e.namespace==="transcript"||e.namespace==="sidecar"){let r=U_("scope.sessionId",e.sessionId);if(r!==void 0)return r}for(let[r,o]of LMe[e.namespace])if(r in e&&e[r]!==void 0)return X(`scope.${r}`,o);if(e.namespace==="sidecar"&&F_(e.relPath))return X("scope.relPath",df);if(e.namespace==="sidecar"&&_W(e.relPath))return X("scope.relPath",hW);if(e.namespace==="log"&&e.channel!==void 0&&!SW(e.channel))return X("scope.channel",bW);if(e.namespace==="job"&&vW(e.relPath))return X("scope.relPath",xW);let n=e.namespace==="sessionLog"?PMe(e):void 0;if(n!==void 0)return n;if(e.namespace==="scratch"&&e.sessionId===void 0&&e.relPath!==void 0)return X("scope.relPath","requires scope.sessionId: a scratch relPath narrows one session directory, and no cross-session prefix filter exists");if(e.namespace==="userConfigDir"&&!iW.has(e.dir))return X("scope.dir",aW);if(e.namespace==="transcript"&&e.agentRelPath!==void 0&&(e.projectKey===void 0||e.sessionId===void 0))return X("scope.agentRelPath","requires scope.projectKey and scope.sessionId: an agentRelPath narrows the subagents/ tree of one session directory");if(e.namespace==="transcript"&&F_(e.agentRelPath))return X("scope.agentRelPath",df);if(e.namespace==="pluginCache"){if(e.marketplace===void 0&&e.plugin!==void 0)return X("scope.plugin","requires scope.marketplace: a plugin narrows one marketplace folder");if(e.plugin===void 0&&e.version!==void 0)return X("scope.version","requires scope.plugin: a version narrows one plugin folder");if(e.version===void 0&&e.relPath!==void 0)return X("scope.relPath","requires scope.version: a relPath narrows one version folder")}if(e.namespace==="job"&&e.jobId===void 0&&e.relPath!==void 0)return X("scope.relPath","requires scope.jobId: a job relPath narrows one job directory, and no cross-job prefix filter exists");if(e.namespace==="transcript"&&e.projectKey===void 0&&e.sessionId!==void 0)return X("scope.sessionId","requires scope.projectKey: a session narrows one project folder, and no cross-project session filter exists");if(e.namespace==="globalConfig"&&e.kind!==void 0&&!fW(e.kind))return X("scope.kind",pW);return}function NMe(e){if(!uW(e.layer))return X("scope.layer","must be user, project or local");if(e.layer==="user"&&"projectKey"in e)return X("scope.projectKey","the user layer is not keyed by project");if(e.layer!=="user"&&typeof e.projectKey!=="string")return X("scope.projectKey","required for the project and local layers");return e.agentType===void 0&&e.relPath!==void 0?X("scope.relPath","requires scope.agentType: an agent-memory relPath narrows one agent directory"):void 0}function UMe(e){switch(e.namespace){case"transcript":return[["projectKey",e.projectKey,"optional"],["sessionId",e.sessionId,"optional"],["agentRelPath",e.agentRelPath,"optional"]];case"task":return[["listId",e.listId,"optional"]];case"mailbox":return[["team",e.team,"optional"]];case"memory":return[["projectKey",e.projectKey],["relPath",e.relPath,"optional"]];case"pluginCache":return[["marketplace",e.marketplace,"optional"],["plugin",e.plugin,"optional"],["version",e.version,"optional"],["relPath",e.relPath,"optional"]];case"cache":return[["store",e.store]];case"state":case"plan":case"paste":case"pluginAssetCache":case"feedbackDraft":return[];case"sidecar":return[["projectKey",e.projectKey],["sessionId",e.sessionId],["relPath",e.relPath,"optional"]];case"agentMemory":return[["projectKey",e.layer==="user"?void 0:e.projectKey,"optional"],["agentType",e.agentType,"optional"],["relPath",e.relPath,"optional"]];case"scratch":return[["sessionId",e.sessionId,"optional"],["relPath",e.relPath,"optional"]];case"userConfigDir":return[["relPath",e.relPath,"optional"]];case"fileHistory":return[["sessionId",e.sessionId,"optional"]];case"job":return[["jobId",e.jobId,"optional"],["relPath",e.relPath,"optional"]];case"daemon":return[["relPath",e.relPath,"optional"]];case"jobsRoot":case"session":return[];case"globalConfig":return[["kind",e.kind,"optional"]];case"log":return[["sessionId",e.sessionId,"optional"]];case"sessionLog":return[["projectKey",e.projectKey,"optional"],["year",e.year,"optional"],["month",e.month,"optional"],["day",e.day,"optional"]]}return}function ri(e,t){if(!He()||t===void 0)return;if(!e.endsWith(".jsonl"))return;let n=TW(e);if(TW(n)!==It())return;let r=AW(n),o=AW(e,".jsonl");if(e!==FMe(It(),r,`${o}.jsonl`))return;let s=un.transcript(r,o);return Ea(s)===void 0?{backend:t,key:s}:void 0}function Vn(e){if(!He()||e===void 0)return;return{backend:e,transcriptKey:un.transcript,isKeySegment:Wn}}function Rn(e){return e===void 0?void 0:{source:e,hoverRestOn:He()}}async function $Me(e,t,n){try{let r=Rn(ri(e,n));if(t>YG&&!Cn.CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP)return(await XG(e,t,r)).postBoundaryBuf;if(r!==void 0&&r.hoverRestOn){let o=await r.source.backend.read([r.source.key]);if(!o.ok)return null;let s=o.value.items[0];if(!s.found)return null;return Buffer.from(s.value.buffer,s.value.byteOffset,s.value.byteLength)}return await zMe(e)}catch{return null}}var kW=524288,CW=8192;async function jMe(e){let a=[];try{const t=Dt(a,Yt`parseTranscriptEntries(${e.length} bytes)`,0);let n=[];let r=10;let o=e.length;let s=0;let i=kW;while(s<o){if(s>=i)await new Promise((h)=>setImmediate(h)),i=s+kW;let p=e.indexOf(r,s);if(p===-1)p=o;let f=s;while(f<p&&e[f]<=32)f++;if(s=p+1,f>=p)continue;let m=e.toString("utf-8",f,p);try{let h=mz(m),_=h.type;if((_==="user"||_==="assistant"||_==="progress"||_==="system"||_==="attachment")&&typeof h.uuid==="string")n.push(h)}catch{}}return n}catch(c){var l=c,u=1}finally{Lt(a,l,u)}}async function HMe(e){let t=new Map;for(let m of e)t.set(m.uuid,m);let n=0;for(let m of t.values()){if(m.type!=="system"||m.subtype!=="compact_boundary")continue;let h=m.compactMetadata?.preservedMessages,_=m.compactMetadata?.preservedSegment;if(h){if(h.uuids.length===0||h.uuids.some((x)=>!t.has(x)))continue;let y=h.anchorUuid;for(let x of h.uuids){let v=t.get(x);t.set(x,{...v,parentUuid:y}),y=x}let S=h.uuids[0],b=h.uuids.at(-1);for(let[x,v]of t){if(++n%CW===0)await new Promise((T)=>setImmediate(T));if(v.parentUuid===h.anchorUuid&&x!==S)t.set(x,{...v,parentUuid:b})}}else if(_){let y=t.get(_.headUuid);if(y)t.set(_.headUuid,{...y,parentUuid:_.anchorUuid});for(let[S,b]of t){if(++n%CW===0)await new Promise((x)=>setImmediate(x));if(b.parentUuid===_.anchorUuid&&S!==_.headUuid)t.set(S,{...b,parentUuid:_.tailUuid})}}}let r=new Map;for(let m=0;m<e.length;m++)r.set(e[m].uuid,m);let o=new Set;for(let m of t.values())if(m.parentUuid)o.add(m.parentUuid);let s=[...t.values()].filter((m)=>!o.has(m.uuid)),i=[];for(let m of s){let h=m,_=new Set;while(h){if(_.has(h.uuid))break;if(_.add(h.uuid),h.type==="user"||h.type==="assistant"){i.push(h);break}h=h.parentUuid?t.get(h.parentUuid):void 0}}if(i.length===0)return[];let a=i.filter((m)=>!m.isSidechain&&!m.teamName&&!m.isMeta),c=(m)=>m.reduce((h,_)=>(r.get(_.uuid)??-1)>(r.get(h.uuid)??-1)?_:h),l=a.length>0?c(a):c(i),u=[],p=new Set,f=t.get(l.uuid);while(f){if(p.has(f.uuid))break;p.add(f.uuid),u.push(f),f=f.parentUuid?t.get(f.parentUuid):void 0}return u.reverse(),await new Promise((m)=>setImmediate(m)),KMe(t,u,p)}function NC(e){if(e.type!=="assistant")return;let t=e.message;if(typeof t!=="object"||t===null)return;let n=t.id;return typeof n==="string"?n:void 0}function BMe(e){if(e.type!=="user"||!e.parentUuid)return!1;let t=e.message;if(typeof t!=="object"||t===null)return!1;let n=t.content;if(!Array.isArray(n))return!1;return n.some((r)=>typeof r==="object"&&r!==null&&r.type==="tool_result")}function KMe(e,t,n){let r=t.filter((p)=>p.type==="assistant");if(r.length===0)return t;let o=new Map;for(let p of r){let f=NC(p);if(f)o.set(f,p)}let s=new Map,i=new Map;for(let p of e.values()){let f=NC(p);if(f){let m=s.get(f);if(m)m.push(p);else s.set(f,[p])}else if(BMe(p)){let m=p.parentUuid,h=i.get(m);if(h)h.push(p);else i.set(m,[p])}}let a=new Set,c=new Map,l=0;for(let p of r){let f=NC(p);if(!f||a.has(f))continue;a.add(f);let m=s.get(f)??[p],h=m.filter((x)=>!n.has(x.uuid)),_=[];for(let x of m){let v=i.get(x.uuid);if(!v)continue;for(let T of v)if(!n.has(T.uuid))_.push(T)}if(h.length===0&&_.length===0)continue;let y=(x,v)=>(x.timestamp??"").localeCompare(v.timestamp??"");h.sort(y),_.sort(y);let S=o.get(f),b=[...h,..._];for(let x of b)n.add(x.uuid);l+=b.length,c.set(S.uuid,b)}if(l===0)return t;let u=[];for(let p of t){u.push(p);let f=c.get(p.uuid);if(f)u.push(...f)}return u}function GMe(e,t){if(e.type==="user"||e.type==="assistant");else if(e.type==="system"&&t);else return!1;if(e.isMeta)return!1;if(e.isSidechain)return!1;if(e.teamName)return!1;return!0}function UC(e,t,n){return{type:e.type,uuid:e.uuid,session_id:e.sessionId,message:e.message,parent_tool_use_id:t??null,parent_agent_id:n??null,timestamp:e.timestamp}}function FC(e,t){let n=t?.offset??0;if(t?.limit!==void 0&&t.limit>0)return e.slice(n,n+t.limit);if(n>0)return e.slice(n);return e}async function RW(e,t){let n=[];for(let r of e){if(typeof r!=="object"||r===null)continue;let o=r,s=o.type;if((s==="user"||s==="assistant"||s==="progress"||s==="system"||s==="attachment")&&typeof o.uuid==="string")n.push(o)}return OW(n,t)}async function OW(e,t){let n=await HMe(e),r=t?.includeSystemMessages??!1,s=n.filter((i)=>GMe(i,r)).map((i)=>UC(i));return FC(s,t)}async function PW(e,t,n){if(!nt(e))return[];let r=He(),o=r?n:void 0,s=await ti(e,t?.dir,Vn(o),r);if(!s)return[];let i=await $Me(s.filePath,s.fileSize,o);if(!i)return[];return OW(await jMe(i),t)}import{readdir as zC,stat as nNe}from"fs/promises";import{basename as WMe,dirname as qMe,join as VMe}from"path";function ZMe(){return VMe(jt(),"projects")}function IW(e){return qMe(e)===ZMe()?WMe(e):void 0}class DW{projectDirCache=new Map;agentTranscriptSubdirs=new Map;cacheProjectDir(e,t){this.projectDirCache.set(e,t)}clearProjectDirCache(){this.projectDirCache.clear()}setAgentTranscriptSubdir(e,t){this.agentTranscriptSubdirs.set(e,t)}clearAgentTranscriptSubdir(e){this.agentTranscriptSubdirs.delete(e)}}var dxt=new ft(()=>new DW);import{basename as rNe,join as ff}from"path";import{readFile as JMe}from"fs/promises";import{dirname as XMe,join as QMe}from"path";var LW=200;function YMe(e){return[...e.replace(/[\x00-\x1f\x7f-\x9f]/g,"")].slice(0,LW).join("")}function MW(e){return YMe(k_(e.trim())).trim()}var eNe=D(()=>A({customTitle:g()}));function tNe(e,t){return QMe(XMe(e),t,"custom-title.json")}async function Hl(e,t){let n;try{n=await JMe(tNe(e,t),"utf8")}catch{return}let r;try{r=JSON.parse(n)}catch{return}let o=eNe().safeParse(r);if(!o.success)return;return MW(o.data.customTitle)||void 0}function Bl(e,t,n,r){let{head:o,tail:s,mtime:i,size:a}=t,c=o.indexOf(`
`),l=c>=0?o.slice(0,c):o;if(l.includes('"isSidechain":true')||l.includes('"isSidechain": true'))return null;let u=nn(s,"customTitle")||r||nn(o,"customTitle")||nn(s,"aiTitle")||nn(o,"aiTitle")||void 0,p=I_(o)||void 0,f=Ul(o,"timestamp"),m;if(f){let x=Date.parse(f);if(!Number.isNaN(x))m=x}let h=u||nn(s,"lastPrompt")||nn(s,"summary")||p;if(!h)return null;let _=nn(s,"gitBranch")||Ul(o,"gitBranch")||void 0,y=P_(s,"relocated","relocatedCwd")||Ul(o,"cwd")||n||void 0,S=s.split(`
`).findLast((x)=>x.includes('"type":"tag"')&&x.includes('"tag":"')),b=S?nn(S,"tag")||void 0:void 0;return{sessionId:e,summary:h,lastModified:i,fileSize:a,customTitle:u,firstPrompt:p,gitBranch:_,cwd:y,tag:b,createdAt:m}}function oNe(e){let t=IW(e);return t!==void 0&&Wn(t)?t:void 0}function z_(e){return{pagesLeft:CG+e}}async function pf(e,t,n,r,o,s){let i=He()&&r!==void 0?oNe(e):void 0;if(r!==void 0&&i!==void 0){let l=new Map;try{await ao((u)=>r.listEntries({namespace:"transcript",projectKey:i},{skipScopeStats:!0,...t?{}:{skipKeyStats:!0},...u!==void 0&&{cursor:u}}),(u)=>{for(let p of u){if(p.kind!=="key"||p.key.namespace!=="transcript")continue;let f=nt(p.key.sessionId);if(!f)continue;if(t&&p.mtimeMs===void 0)continue;let m=t?Math.trunc(p.mtimeMs??0):0,h=l.get(f);if(h!==void 0){if(m>h.mtime)h.mtime=m;continue}l.set(f,{sessionId:f,filePath:ff(e,`${p.key.sessionId}.jsonl`),mtime:m,projectPath:n,ownWorktrees:s})}},o!==void 0?{budget:o}:void 0)}catch{}return[...l.values()]}let a;try{a=await zC(e)}catch{return[]}return(await Promise.all(a.map(async(l)=>{if(!l.endsWith(".jsonl"))return null;let u=nt(l.slice(0,-6));if(!u)return null;let p=ff(e,l);if(!t)return{sessionId:u,filePath:p,mtime:0,projectPath:n,ownWorktrees:s};try{let f=await nNe(p);return{sessionId:u,filePath:p,mtime:f.mtime.getTime(),projectPath:n,ownWorktrees:s}}catch{return null}}))).filter((l)=>l!==null)}async function NW(e,t,n){let r=await lf(e.filePath,Rn(ri(e.filePath,n)));if(!r)return null;if(!t&&HG(r.head,r.tail))return null;let o=nn(r.tail,"customTitle")===void 0?await Hl(e.filePath,e.sessionId):void 0,s=Bl(e.sessionId,r,e.projectPath,o);if(!s)return null;let i=P_(r.tail,"relocated","relocatedCwd")??CC(r.head,"cwd");if(i!==void 0&&e.projectPath!==void 0&&!VG(i,e.ownWorktrees,RC())&&await qG(i,e.projectPath,RC(),Ez))return null;if(e.mtime)s.lastModified=e.mtime;return s}var sNe=32;function iNe(e,t){if(t.mtime!==e.mtime)return t.mtime-e.mtime;return t.sessionId<e.sessionId?-1:t.sessionId>e.sessionId?1:0}async function aNe(e,t,n,r,o){e.sort(iNe);let s=[],i=t&&t>0?t:1/0,a=0,c=new Set;for(let l=0;l<e.length&&s.length<i;){let u=Math.min(l+sNe,e.length),p=e.slice(l,u),f=await Promise.all(p.map((m)=>NW(m,r,o)));for(let m=0;m<f.length&&s.length<i;m++){l++;let h=f[m];if(!h)continue;if(c.has(h.sessionId))continue;if(c.add(h.sessionId),a<n){a++;continue}s.push(h)}}return s}async function cNe(e,t,n){let r=await Promise.all(e.map((i)=>NW(i,t,n))),o=new Map;for(let i of r){if(!i)continue;let a=o.get(i.sessionId);if(!a||i.lastModified>a.lastModified)o.set(i.sessionId,i)}let s=[...o.values()];return s.sort((i,a)=>a.lastModified!==i.lastModified?a.lastModified-i.lastModified:a.sessionId<i.sessionId?-1:a.sessionId>i.sessionId?1:0),s}async function lNe(e,t,n,r){let o=await ls(e),s=Rn(Vn(r)),i;if(t)try{i=await is(o)}catch{i=[]}else i=[];if(i.length<=1){let S=[],b=await Gn(o,s),x=z_(b.length);for(let v of b)S.push(...await pf(v,n,o,r,x));return S}let a=It(),c=process.platform==="win32",l=i.map((S)=>{let b=cs(S),x=c?b.toLowerCase():b;return{path:S,exactName:x,truncatedPrefix:b.length>as?x.slice(0,as):void 0}});l.sort((S,b)=>b.exactName.length-S.exactName.length);let u=s!==void 0&&s.hoverRestOn?await jl(s.source):null,p=u;if(p===null){let S;try{S=await zC(a,{withFileTypes:!0})}catch{let b=[],x=await Gn(o),v=z_(x.length);for(let T of x)b.push(...await pf(T,n,o,r,v));return b}p=S.filter((b)=>b.isDirectory()).map((b)=>b.name)}let f=[],m=new Set,h=z_(p.length+1),_=s!==void 0&&s.hoverRestOn&&u!==null?await PC(o,u,c,s):await Gn(o),y=[o,...i];for(let S of _){let b=rNe(S),x=c?b.toLowerCase():b;m.add(x),f.push(...await pf(S,n,o,r,h,y))}for(let S of p){let b=c?S.toLowerCase():S;if(m.has(b))continue;for(let{path:x,exactName:v,truncatedPrefix:T}of l)if(b===v||T!==void 0&&b.startsWith(T+"-")&&await $l(ff(a,S),x,c,s)){m.add(b),f.push(...await pf(ff(a,S),n,x,r,h,y));break}}return f}async function uNe(e,t){let n=It(),r=Vn(t),o=r!==void 0?await jl(r):null;if(o===null){let a;try{a=await zC(n,{withFileTypes:!0})}catch{return[]}o=a.filter((c)=>c.isDirectory()).map((c)=>c.name)}let s=z_(o.length);return(await Promise.all(o.map((a)=>pf(ff(n,a),e,void 0,t,s)))).flat()}async function UW(e,t){let n=He()?t:void 0,{dir:r,limit:o,offset:s,includeWorktrees:i,includeProgrammatic:a}=e??{},c=s??0,l=a??!0,u=o!==void 0&&o>0||c>0,p=r?await lNe(r,i??!0,u,n):await uNe(u,n);if(!u)return cNe(p,l,n);return aNe(p,o,c,l,n)}async function FW(e,t={},n){let r=nt(e);if(!r)return;let o=He(),s=o?n:void 0,i=await ti(r,t.dir,Vn(s),o);if(!i)return;let a=await lf(i.filePath,Rn(ri(i.filePath,s)));if(!a)return;let c=nn(a.tail,"customTitle")===void 0?await Hl(i.filePath,r):void 0;return Bl(r,a,i.projectPath,c)??void 0}import{constants as zW}from"fs";import{open as dNe,readdir as HW,rm as $W,stat as pNe}from"fs/promises";import{join as us}from"path";var fNe=64;function jC(e){return He()?e:void 0}async function BW(e,t,n={},r){if(!nt(e))throw Error(`Invalid sessionId: ${e}`);if(!t.trim())throw Error("title must be non-empty");let o=fe({type:"custom-title",customTitle:t.trim(),sessionId:e})+`
`;await qW(e,o,n,jC(r))}async function KW(e,t,n={},r){if(!nt(e))throw Error(`Invalid sessionId: ${e}`);if(t!==null){let s=ya(t).trim();if(!s)throw Error("tag must be non-empty (use null to clear)");t=s}let o=fe({type:"tag",tag:t??"",sessionId:e})+`
`;await qW(e,o,n,jC(r))}async function GW(e,t={},n){if(!nt(e))throw Error(`Invalid sessionId: ${e}`);let r=jC(n);for(let o of await hNe(t,r)){if(He()&&r!==void 0){let a=Sa(o,r.isKeySegment);if(a!==void 0){if(await mNe(a,e,r))return;continue}}let s=us(o,`${e}.jsonl`),i;try{({size:i}=await pNe(s))}catch(a){let c=De(a);if(c==="ENOENT"||c==="ENOTDIR")continue;throw a}if(i===0)continue;await $W(s,{force:!0}),await $W(us(o,e),{recursive:!0,force:!0});return}throw Error(t.dir?`Session ${e} not found in project directory for ${t.dir}`:`Session ${e} not found in any project directory`)}async function mNe(e,t,n){let{backend:r,transcriptKey:o}=n,s=o(e,t),i=await r.statMeta(s);if(!i.ok){if(i.error.code==="NotFound")return!1;throw Error("Session delete: transcript unreadable via storage",{cause:i.error})}if((i.value.storedBytes??i.value.size)===0)return!1;for(let c of["transcript","sidecar"]){let l=await r.deleteScope({namespace:c,projectKey:e,sessionId:t});if(!l.ok)throw Error("Session delete: session directory not deletable via storage",{cause:l.error})}let a=await r.delete(s);if(!a.ok)throw Error("Session delete: transcript not deletable via storage",{cause:a.error});return!0}async function hNe(e,t){if(e.dir){let r=await ls(e.dir),o=await jW(r,t),s;try{s=await is(r)}catch{s=[]}for(let i of s){if(i===r)continue;o.push(...await jW(i,t))}return o}let n=It();if(He()&&t!==void 0){let r=await WW(t);if(r===void 0)return[];if(r.laterPageFailed)throw Error("Session delete: project listing incomplete via storage");return r.names.map((o)=>us(n,o))}try{return(await HW(n,{withFileTypes:!0})).filter((o)=>o.isDirectory()||o.isSymbolicLink()).map((o)=>us(n,o.name))}catch{return[]}}async function jW(e,t){let n=Rn(t);if(n===void 0||!n.hoverRestOn)return Gn(e);let r=await Gn(e,n),o=zl(e),s=process.platform==="win32",i=[];for(let a of r)if(a===o||await $l(a,e,s,n))i.push(a);return i}async function WW(e){let t=[],n,r=0;try{do{let o=await e.backend.listEntries({namespace:"transcript"},{skipScopeStats:!0,...n!==void 0&&{cursor:n}});if(!o.ok)return r===0?void 0:{names:t,laterPageFailed:!0};for(let s of o.value.items){let i=D_(s,e.isKeySegment);if(i!==void 0)t.push(i)}n=o.value.cursor}while(n&&++r<fNe);return{names:t,laterPageFailed:Boolean(n)}}catch{return r===0&&t.length===0?void 0:{names:t,laterPageFailed:!0}}}async function qW(e,t,n,r){let o=`${e}.jsonl`;if(n.dir){let a=await ls(n.dir);for(let l of await Gn(a,Rn(r)))if(await $_(us(l,o),t,$C(l,e,r)))return;let c;try{c=await is(a)}catch{c=[]}for(let l of c){if(l===a)continue;for(let u of await Gn(l,Rn(r)))if(await $_(us(u,o),t,$C(u,e,r)))return}throw Error(`Session ${e} not found in project directory for ${n.dir}`)}let s=It();if(He()&&r!==void 0){let a=await WW(r);if(a===void 0)throw new Ze(`Session ${e} not found (no projects directory)`,"Session not found (no projects directory)");let{names:c}=a;for(let l of c){let u=us(s,l);if(await $_(us(u,o),t,$C(u,e,r)))return}throw new Ze(`Session ${e} not found in any project directory`,"Session not found in any project directory")}let i;try{i=await HW(s)}catch{throw Error(`Session ${e} not found (no projects directory)`)}for(let a of i)if(await $_(us(s,a,o),t))return;throw Error(`Session ${e} not found in any project directory`)}async function $_(e,t,n){if(He()&&n!==void 0)return gNe(n,t);let r;try{r=await dNe(e,zW.O_WRONLY|zW.O_APPEND)}catch(o){let s=De(o);if(s==="ENOENT"||s==="ENOTDIR")return!1;throw o}try{let{size:o}=await r.stat();if(o===0)return!1;let s=process.platform==="win32"?o:void 0,i=Buffer.from(t,"utf8"),a=0;while(a<i.length){let{bytesWritten:c}=await r.write(i,a,i.length-a,s);if(c<=0)throw new Ze(`tryAppend: short write to ${e} stalled with ${i.length-a} bytes remaining`,"tryAppend: zero-progress short write");if(a+=c,s!==void 0)s+=c}return!0}finally{await r.close()}}async function gNe({backend:e,key:t},n){let r=await e.append(t,[{data:n}],{precondition:{type:"ifExists",nonEmpty:!0}});if(!r.ok){if(r.error.code==="NotFound")return!1;throw Error("Session append: transcript not writable via storage",{cause:r.error})}return!0}function $C(e,t,n){if(!He()||n===void 0)return;let r=Sa(e,n.isKeySegment);return r===void 0?void 0:{backend:n.backend,key:n.transcriptKey(r,t)}}import{randomUUID as j_}from"crypto";import{basename as _Ne,join as xa}from"path";async function yNe(e,t,n){let r=`${e}.jsonl`,o=Rn(Vn(n));async function s(c){let l=Rn(ri(xa(c,r),n));if(l!==void 0&&l.hoverRestOn)try{let u=await l.source.backend.read([l.source.key]);if(!u.ok)return null;let p=u.value.items[0];if(!p?.found)return null;if(p.value.byteLength===0){let f=await l.source.backend.statMeta(l.source.key);if(!f.ok||(f.value.storedBytes??f.value.size)===0)return null}return{buf:Buffer.from(p.value),projectDir:c}}catch{return null}try{let u=await Vc().readBytes(xa(c,r));if(u.length===0)return null;return{buf:u,projectDir:c}}catch{return null}}if(t){let c=await ls(t);for(let u of await Gn(c,o)){let p=await s(u);if(p)return p}let l;try{l=await is(c)}catch{l=[]}for(let u of l){if(u===c)continue;for(let p of await Gn(u,o)){let f=await s(p);if(f)return f}}return null}let i=It();if(o!==void 0&&o.hoverRestOn){let c=await jl(o.source);if(c!==null){for(let l of c){let u=await s(xa(i,l));if(u)return u}return null}}let a;try{a=await Vc().list(i)}catch{return null}for(let c of a){let l=await s(xa(i,c));if(l)return l}return null}var bNe=new Set(["user","assistant","attachment","system","progress"]);function SNe(e,t){let n=[],r=[],o,s={historySuppressed:!1},i=10,a=e.length,c=0;while(c<a){let l=e.indexOf(10,c);if(l===-1)l=a;let u=c;while(u<l&&e[u]<=32)u++;if(c=l+1,u>=l)continue;let p=e.toString("utf-8",u,l);try{o=VW(yt(p),t,n,r,s)??o}catch{}}return{transcript:n,contentReplacements:r,relocatedCwd:o,historySuppressed:s.historySuppressed,atisLatch:s.atisLatch}}function ENe(e,t){let n=[],r=[],o,s={historySuppressed:!1};for(let i of e){if(typeof i!=="object"||i===null)continue;o=VW(i,t,n,r,s)??o}return{transcript:n,contentReplacements:r,relocatedCwd:o,historySuppressed:s.historySuppressed,atisLatch:s.atisLatch}}function VW(e,t,n,r,o){if(bNe.has(e.type)&&typeof e.uuid==="string")n.push(e);else if(e.type==="history-suppression"){if(o)o.historySuppressed=!0}else if(e.type==="atis-latch"&&e.sessionId===t&&typeof e.atis==="string"&&/^[\x21-\x7e]*$/.test(e.atis)){if(o)o.atisLatch=e.atis}else if(e.type==="content-replacement"&&e.sessionId===t&&Array.isArray(e.replacements))r.push(...e.replacements);else if(e.type==="relocated"&&e.sessionId===t&&typeof e.relocatedCwd==="string"&&e.relocatedCwd!=="")return e.relocatedCwd;return}async function ZW(e,t={},n){let r=He()?n:void 0;if(!nt(e))throw new Ze(`Invalid sessionId: ${e}`,"forkSession: invalid sessionId (not a UUID)");if(t.upToMessageId&&!nt(t.upToMessageId))throw new Ze(`Invalid upToMessageId: ${t.upToMessageId}`,"forkSession: invalid upToMessageId (not a UUID)");let o=await yNe(e,t.dir,r);if(!o)throw Error(t.dir?`Session ${e} not found in project directory for ${t.dir}`:`Session ${e} not found`);let s=await Hl(xa(o.projectDir,`${e}.jsonl`),e),{entries:i,forkedSessionId:a}=vNe(o.buf,e,t,s);return await cf(xa(o.projectDir,`${a}.jsonl`),i,Rn(xNe(o.projectDir,a,Vn(r)))),{sessionId:a}}function xNe(e,t,n){if(n===void 0)return;let r=_Ne(e);if(xa(It(),r)!==e||!n.isKeySegment(r)||!n.isKeySegment(t))return;return{backend:n.backend,key:n.transcriptKey(r,t)}}function vNe(e,t,n,r){let o=SNe(e,t);return JW(o,t,n,()=>{let i=e.length,a=e.toString("utf-8",0,Math.min(i,br)),c=e.toString("utf-8",Math.max(0,i-br)),l=nn(c,"customTitle");return(l!==void 0?l:r??nn(a,"customTitle"))||nn(c,"aiTitle")||nn(a,"aiTitle")||I_(a)})}function YW(e,t,n){let r=ENe(e,t);return JW(r,t,n,()=>wNe(e))}function wNe(e){let t,n;for(let r of e){if(typeof r!=="object"||r===null)continue;let o=r;if(typeof o.customTitle==="string"&&o.customTitle)t=o.customTitle;if(typeof o.aiTitle==="string"&&o.aiTitle)n=o.aiTitle}return t||n||KG(e)||void 0}function JW(e,t,n,r){let o=e.transcript.filter((f)=>!f.isSidechain);if(o.length===0)throw Error(`Session ${t} has no messages to fork`);if(n.upToMessageId){let f=o.findIndex((m)=>m.uuid===n.upToMessageId);if(f===-1)throw Error(`Message ${n.upToMessageId} not found in session ${t}`);o=o.slice(0,f+1)}let s=new Map;for(let f of o)s.set(f.uuid,j_());let i=o.filter((f)=>f.type!=="progress");if(i.length===0)throw Error(`Session ${t} has no messages to fork`);let a=new Map;for(let f of o)a.set(f.uuid,f);let c=j_(),l=new Date().toISOString(),u=[];if(e.historySuppressed)u.push(eW(c,"fork_inherit"));for(let f=0;f<i.length;f++){let m=i[f],h=s.get(m.uuid),_=null,y=m.parentUuid;while(y){let T=a.get(y);if(!T)break;if(T.type!=="progress"){_=s.get(y)??null;break}y=T.parentUuid}let S=f===i.length-1?l:m.timestamp,b=m.logicalParentUuid==null?m.logicalParentUuid:s.get(m.logicalParentUuid)??null,x=m.type==="system"&&m.subtype==="model_refusal_fallback"?{neutralizedByFork:!0}:void 0,v={...m,...x,uuid:h,parentUuid:_,logicalParentUuid:b,sessionId:c,timestamp:S,isSidechain:!1,teamName:void 0,agentName:void 0,sessionKind:void 0,slug:void 0,sourceToolAssistantUUID:void 0,forkedFrom:{sessionId:t,messageUuid:m.uuid}};u.push(v)}if(e.contentReplacements.length>0)u.push({type:"content-replacement",sessionId:c,replacements:e.contentReplacements,uuid:j_(),timestamp:l});if(e.atisLatch!==void 0)u.push({type:"atis-latch",sessionId:c,atis:e.atisLatch});if(e.relocatedCwd)u.push({type:"relocated",sessionId:c,relocatedCwd:e.relocatedCwd});let p=n.title?.trim();if(!p)p=`${r()||"Forked session"} (fork)`;return u.push({type:"custom-title",sessionId:c,customTitle:p,uuid:j_(),timestamp:l}),{entries:u,forkedSessionId:c}}import{readdir as ANe,readFile as XW}from"fs/promises";import{isAbsolute as QW,join as H_,relative as eq,sep as B_}from"path";async function tq(e,t,n,r){let o=await ti(e,t,Vn(n),r);if(!o)return null;let s=o.filePath.replace(/\.jsonl$/,"");return H_(s,"subagents")}function nq(e){let t=eq(It(),e);if(t===""||t.startsWith(`..${B_}`)||t===".."||QW(t))return null;let n=t.split(B_);return n.length<4||n[2]!=="subagents"?null:n}function TNe(e){let t=nq(e),n=t?.at(-1);if(!t||!n?.startsWith("agent-")||!n.endsWith(".jsonl"))return null;let r=n.slice(6,-6),o=t.slice(3,-1);if(!qn([t[0],t[1],r])||o.length>0&&!qn(o))return null;let s=un.transcript(t[0],t[1],r,o.length>0?o:void 0);return Ea(s)===void 0?s:null}function kNe(e){let t=nq(e);if(!t)return null;let n=t.slice(2);if(!qn([t[0],t[1]])||!qn(n))return null;let r=un.sidecar(t[0],t[1],n);return Ea(r)===void 0?r:null}async function rq(e,t){let n=He()&&t!==void 0?CNe(e):null;if(t!==void 0&&n!==null)return ONe(t,n,e);let r=[];async function o(s){let i;try{i=await ANe(s,{withFileTypes:!0})}catch{return}for(let a of i)if(a.isFile()&&a.name.startsWith("agent-")&&a.name.endsWith(".jsonl")){let c=a.name.slice(6,-6);r.push({agentId:c,filePath:H_(s,a.name)})}else if(a.isDirectory())await o(H_(s,a.name))}return await o(e),r}function CNe(e){let t=eq(It(),e);if(t===""||t.startsWith(`..${B_}`)||QW(t))return null;let n=t.split(B_);if(n.length!==3||n[2]!=="subagents"||!qn([n[0],n[1]]))return null;let r={namespace:"transcript",projectKey:n[0],sessionId:n[1]};return MC(r)===void 0?r:null}var RNe=1e4;async function ONe(e,t,n,r=RNe){let o=[],s=[t],i=new Set([""]),a=0;try{while(s.length>0){if(++a>r)return[];let c=s.shift(),l=[];if((await ao((p)=>e.listEntries(c,{skipKeyStats:!0,skipScopeStats:!0,...p!==void 0&&{cursor:p}}),(p)=>{for(let f of p)if(f.kind==="key"&&f.key.namespace==="transcript"&&f.key.agentId!==void 0&&Wn(f.key.agentId)&&(f.key.agentRelPath===void 0||qn(f.key.agentRelPath)))o.push({agentId:f.key.agentId,filePath:H_(n,...f.key.agentRelPath??[],`agent-${f.key.agentId}.jsonl`)});else if(f.kind==="scope"&&f.scope.namespace==="transcript"&&f.scope.agentRelPath!==void 0&&qn(f.scope.agentRelPath)&&!i.has(f.scope.agentRelPath.join("/"))){let m={...t,agentRelPath:f.scope.agentRelPath};if(MC(m)===void 0)i.add(f.scope.agentRelPath.join("/")),l.push(m)}})).status!=="done")return[];s.unshift(...l)}}catch{return[]}return o}function PNe(e){let t=[],n=10,r=e.length,o=0;while(o<r){let s=e.indexOf(10,o);if(s===-1)s=r;let i=o;while(i<s&&e[i]<=32)i++;if(o=s+1,i>=s)continue;let a=e.toString("utf-8",i,s);try{let c=yt(a),l=c.type;if((l==="user"||l==="assistant")&&typeof c.uuid==="string")t.push(c)}catch{}}return t}function INe(e){if(e.length===0)return[];let t=new Map;for(let i of e)t.set(i.uuid,i);let n=e.findLast((i)=>i.type==="user"||i.type==="assistant");if(!n)return[];let r=[],o=new Set,s=n;while(s){if(o.has(s.uuid))break;o.add(s.uuid),r.push(s),s=s.parentUuid?t.get(s.parentUuid):void 0}return r.reverse(),r}async function oq(e,t,n){if(!nt(e))return[];let r=He(),o=r?n:void 0,s=await tq(e,t?.dir,o,r);if(!s)return[];return(await rq(s,o)).map((a)=>a.agentId)}async function sq(e,t,n,r){if(!nt(e))return[];if(!t)return[];let o=He(),s=o?r:void 0,i=await tq(e,n?.dir,s,o);if(!i)return[];let c=(await rq(i,s)).find((m)=>m.agentId===t);if(!c)return[];let l,u=s!==void 0?TNe(c.filePath):null;if(s!==void 0&&u!==null)try{let m=await s.read([u]),h=m.ok?m.value.items[0]:void 0;if(!h?.found)return[];l=Buffer.from(h.value)}catch{return[]}else try{l=await XW(c.filePath)}catch{return[]}let p,f;try{let m=c.filePath.replace(/\.jsonl$/,".meta.json"),h=s!==void 0?kNe(m):null,_;if(s!==void 0&&h!==null){let S=await s.read([h]);if(!S.ok||!S.value.items[0]?.found)throw Error("sidecar absent");_=Buffer.from(S.value.items[0].value).toString("utf-8")}else _=await XW(m,"utf-8");let y=yt(_);p=y.toolUseId,f=y.parentAgentId}catch{}return HC(l,n,p,f)}function HC(e,t,n,r){if(e.length===0)return[];let o=PNe(e),i=INe(o).filter((a)=>a.type==="user"||a.type==="assistant").map((a)=>UC(a,n,r));return FC(i,t)}function K_(e){return["subagents",...e.agentRelPath??[],e.kind==="agent"?`agent-${e.agentId}`:"journal"].join("/")}async function BC(e,t,n,r,o,s=LNe){let i=[],a=0,c,l=!1;for(let u=0;u<s;u++){let p=await e.readRecords(t,{order:"forward",maxBytes:DNe,...c!==void 0&&{fromSeq:c}});if(!p.ok)throw new Ze(`importSessionToStore: transcript read failed (${p.error.code})`,"importSessionToStore: transcript read failed");for(let f of p.value.items){let m=Buffer.from(f.data.buffer,f.data.byteOffset,f.data.byteLength).toString("utf8").replace(/\r?\n$/,"");if(!m)continue;try{i.push(yt(m))}catch(h){de(`importSessionToStore: skipping unparseable record ${f.seq}: ${h}`);continue}if(a+=m.length,i.length>=o||a>=Ol)await r.append(n,i),i=[],a=0}if(c=p.value.nextSeq,c===void 0){l=!0;break}}if(!l)throw new Ze("importSessionToStore: transcript read did not end (page cap reached)","importSessionToStore: transcript read did not end");if(i.length>0)await r.append(n,i)}var DNe=67108864,LNe=1e5,MNe=1e4;async function cq(e,t,n,r=MNe){let o=[],s=[{namespace:"transcript",projectKey:t,sessionId:n}],i=new Set([""]),a=new Set,c=0;while(s.length>0){if(++c>r)throw Error("importSessionToStore: subagent listing did not end (scope cap reached)");let l=s.shift(),u=[];if((await ao((f)=>e.listEntries(l,{skipKeyStats:!0,skipScopeStats:!0,...f!==void 0&&{cursor:f}}),(f)=>{for(let m of f)if(m.kind==="key"&&m.key.namespace==="transcript"){let h=m.key.agentRelPath;if(h!==void 0&&!qn(h))continue;let _=m.key.agentId!==void 0?Wn(m.key.agentId)?{kind:"agent",agentId:m.key.agentId,...h&&{agentRelPath:h}}:void 0:m.key.journal===!0&&h!==void 0?{kind:"journal",agentRelPath:h}:void 0,y=_&&K_(_);if(_&&y!==void 0&&!a.has(y))a.add(y),o.push(_)}else if(m.kind==="scope"&&m.scope.namespace==="transcript"&&m.scope.agentRelPath!==void 0&&qn(m.scope.agentRelPath)&&!i.has(m.scope.agentRelPath.join("/")))i.add(m.scope.agentRelPath.join("/")),u.push({namespace:"transcript",projectKey:t,sessionId:n,agentRelPath:m.scope.agentRelPath})})).status!=="done")throw Error("importSessionToStore: subagent listing failed");s.unshift(...u)}return o}function NNe(e,t,n){return un.sidecar(e,t,["subagents",...n.agentRelPath??[],n.kind==="agent"?`agent-${n.agentId}.meta.json`:"journal.meta.json"])}async function lq(e,t,n,r){let o=r.map((a)=>({subpath:K_(a),key:NNe(t,n,a)})).filter(({key:a})=>Ea(a)===void 0),s=new Map;if(o.length===0)return s;let i=await e.readText(o.map(({key:a})=>a));if(i.ok)return i.value.items.forEach((a,c)=>{if(a.found)s.set(o[c].subpath,a.value)}),s;if(!iq(i.error))throw aq(i.error.code);for(let{subpath:a,key:c}of o){let l=await e.readText([c]);if(l.ok){if(l.value.items[0].found)s.set(a,l.value.items[0].value)}else if(!iq(l.error))throw aq(l.error.code)}return s}function iq(e){return e.code==="Failed"&&(e.telemetryCode==="ELOOP"||e.telemetryCode==="ENXIO")}function aq(e){return new Ze(`importSessionToStore: sidecar read failed (${e})`,"importSessionToStore: sidecar read failed")}import{copyFile as UNe,readFile as FNe,rm as dq,writeFile as pq}from"fs/promises";import{homedir as uq}from"os";import{join as KC}from"path";function fq(e){return{globalConfig:KC(e||uq(),".claude.json"),userSettings:KC(e||KC(uq(),".claude"),"settings.json")}}function GC(e,t,n,r){return e!==void 0&&t===n?{backend:e,key:r}:void 0}async function G_(e,t,n,r){if(r)return zNe(r,e,t,n);try{if(n)await pq(t,n(await FNe(e)),{mode:384});else await UNe(e,t)}catch(o){if(De(o)===void 0)throw o;if(!pr(o))await dq(t,{force:!0}).catch(()=>{}),de(`sessionStore resume: skipping ${e} (${De(o)})`)}}async function zNe({backend:e,key:t},n,r,o){let s=await e.read([t]);if(!s.ok){if(s.error.code==="InvalidArgument")throw new Ze(`sessionStore resume: invalid v5 key for ${n}: ${s.error.argument}${s.error.reason?` (${s.error.reason})`:""}`,"sessionStore resume: invalid v5 key (InvalidArgument from backend read)");de(`sessionStore resume: skipping ${n} (${s.error.code})`);return}let i=s.value.items[0];if(!i?.found)return;let a=Buffer.from(i.value);try{await pq(r,o?o(a):a,{mode:384})}catch(c){if(De(c)===void 0)throw c;if(!pr(c))await dq(r,{force:!0}).catch(()=>{}),de(`sessionStore resume: skipping ${n} (${De(c)})`)}}import{createHash as $Ne}from"crypto";import{homedir as Mvt,userInfo as jNe}from"os";var mq="-credentials";function hq(e=""){let t=process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR,n=t!==void 0?!t:!process.env.CLAUDE_CONFIG_DIR,r=t!==void 0?t.normalize("NFC"):jt(),o=n?"":`-${$Ne("sha256").update(r).digest("hex").substring(0,8)}`;return`Claude Code${BF().OAUTH_FILE_SUFFIX}${e}${o}`}var HNe=/^[a-zA-Z0-9._-]+$/;function gq(){if(process.platform==="win32")return"claude-code-user";let e;try{e=process.env.USER||jNe().username}catch{e="claude-code-user"}if(!HNe.test(e))return"claude-code-user";return e}class _q{cache={data:null,cachedAt:0};generation=0;readInFlight=null;lastReadFailure=null;lastKnown=null;legacyApiKeyPrefetch=null}var $vt=new ft(()=>new _q);function BNe(e,t){if(e==="bypassPermissions")return"canUseTool will not be invoked: permissionMode 'bypassPermissions' auto-approves every tool call (except explicit deny rules) before the callback is consulted. To gate every tool call, use a PreToolUse hook instead.";let n=t.filter((r)=>r.length>0&&!r.includes("("));if(n.length===0)return;return`canUseTool will not be invoked for: ${n.join(", ")}. Bare allowedTools entries auto-approve the whole tool before the callback is consulted. To gate every tool call, use a PreToolUse hook; or remove the bare names from allowedTools so they fall through to canUseTool. Allow rules from settings files can also shadow the callback but are not visible here.`}function yq(e,t,n){if(!e)return;let r=BNe(t,n);if(r===void 0)return;process.emitWarning(r,{code:"CLAUDE_SDK_CAN_USE_TOOL_SHADOWED"})}var GNe=P("ZodMiniType",(e,t)=>{if(!e._zod)throw Error("Uninitialized schema in ZodMiniType.");We.init(e,t),e.def=t,e.parse=(n,r)=>vS(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>Ti(e,n,r),e.parseAsync=async(n,r)=>AS(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>ki(e,n,r),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),e.clone=(n,r)=>Mn(e,n,r),e.brand=()=>e,e.register=(n,r)=>(n.add(e,r),e)});var WNe=P("ZodMiniObject",(e,t)=>{Fm.init(e,t),GNe.init(e,t),ke.defineLazy(e,"shape",()=>t.shape)});function WC(e,t){let n={type:"object",get shape(){return ke.assignProp(this,"shape",{...e}),this.shape},...ke.normalizeParams(t)};return new WNe(n)}function Dr(e){return!!e._zod}function va(e){let t=Object.values(e);if(t.length===0)return WC({});let n=t.every(Dr),r=t.every((o)=>!Dr(o));if(n)return WC(e);if(r)return NA(e);throw Error("Mixed Zod versions detected in object shape.")}function oi(e,t){if(Dr(e))return Ti(e,t);return e.safeParse(t)}async function W_(e,t){if(Dr(e))return await ki(e,t);return await e.safeParseAsync(t)}function si(e){if(!e)return;let t;if(Dr(e))t=e._zod?.def?.shape;else t=e.shape;if(!t)return;if(typeof t==="function")try{return t()}catch{return}return t}function Kl(e){if(!e)return;if(typeof e==="object"){let t=e,n=e;if(!t._def&&!n._zod){let r=Object.values(e);if(r.length>0&&r.every((o)=>typeof o==="object"&&o!==null&&(o._def!==void 0||o._zod!==void 0||typeof o.parse==="function")))return va(e)}}if(Dr(e)){let n=e._zod?.def;if(n&&(n.type==="object"||n.shape!==void 0))return e}else if(e.shape!==void 0)return e;return}function q_(e){if(e&&typeof e==="object"){if("message"in e&&typeof e.message==="string")return e.message;if("issues"in e&&Array.isArray(e.issues)&&e.issues.length>0){let t=e.issues[0];if(t&&typeof t==="object"&&"message"in t)return String(t.message)}try{return JSON.stringify(e)}catch{return String(e)}}return String(e)}function bq(e){return e.description}function Sq(e){if(Dr(e))return e._zod?.def?.type==="optional";let t=e;if(typeof e.isOptional==="function")return e.isOptional();return t._def?.typeName==="ZodOptional"}function V_(e){if(Dr(e)){let s=e._zod?.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}let n=e._def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}let r=e.value;if(r!==void 0)return r;return}var qC="2025-11-25";var Eq=[qC,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ii="io.modelcontextprotocol/related-task",Y_="2.0",Jt=Q0((e)=>e!==null&&(typeof e==="object"||typeof e==="function")),xq=ie([g(),K().int()]),vq=g(),ewt=wn({ttl:K().optional(),pollInterval:K().optional()}),VNe=A({ttl:K().optional()}),ZNe=A({taskId:g()}),VC=wn({progressToken:xq.optional(),[ii]:ZNe.optional()}),Sr=A({_meta:VC.optional()}),mf=Sr.extend({task:VNe.optional()}),wq=(e)=>mf.safeParse(e).success,dn=A({method:g(),params:Sr.loose().optional()}),Lr=A({_meta:VC.optional()}),Mr=A({method:g(),params:Lr.loose().optional()}),pn=wn({_meta:VC.optional()}),J_=ie([g(),K().int()]),Aq=A({jsonrpc:z(Y_),id:J_,...dn.shape}).strict(),ZC=(e)=>Aq.safeParse(e).success,Tq=A({jsonrpc:z(Y_),...Mr.shape}).strict(),kq=(e)=>Tq.safeParse(e).success,YC=A({jsonrpc:z(Y_),id:J_,result:pn}).strict(),hf=(e)=>YC.safeParse(e).success;var pe;(function(e){e[e.ConnectionClosed=-32000]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(pe||(pe={}));var JC=A({jsonrpc:z(Y_),id:J_.optional(),error:A({code:K().int(),message:g(),data:xe().optional()})}).strict();var Cq=(e)=>JC.safeParse(e).success;var twt=ie([Aq,Tq,YC,JC]),nwt=ie([YC,JC]),X_=pn.strict(),YNe=Lr.extend({requestId:J_.optional(),reason:g().optional()}),Q_=Mr.extend({method:z("notifications/cancelled"),params:YNe}),JNe=A({src:g(),mimeType:g().optional(),sizes:I(g()).optional(),theme:Z(["light","dark"]).optional()}),gf=A({icons:I(JNe).optional()}),Gl=A({name:g(),title:g().optional()}),Rq=Gl.extend({...Gl.shape,...gf.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),XNe=qm(A({applyDefaults:R().optional()}),V(g(),xe())),QNe=ot((e)=>{if(e&&typeof e==="object"&&!Array.isArray(e)){if(Object.keys(e).length===0)return{form:{}}}return e},qm(A({form:XNe.optional(),url:Jt.optional()}),V(g(),xe()).optional())),eUe=wn({list:Jt.optional(),cancel:Jt.optional(),requests:wn({sampling:wn({createMessage:Jt.optional()}).optional(),elicitation:wn({create:Jt.optional()}).optional()}).optional()}),tUe=wn({list:Jt.optional(),cancel:Jt.optional(),requests:wn({tools:wn({call:Jt.optional()}).optional()}).optional()}),nUe=A({experimental:V(g(),Jt).optional(),sampling:A({context:Jt.optional(),tools:Jt.optional()}).optional(),elicitation:QNe.optional(),roots:A({listChanged:R().optional()}).optional(),tasks:eUe.optional(),extensions:V(g(),Jt).optional()}),rUe=Sr.extend({protocolVersion:g(),capabilities:nUe,clientInfo:Rq}),XC=dn.extend({method:z("initialize"),params:rUe});var oUe=A({experimental:V(g(),Jt).optional(),logging:Jt.optional(),completions:Jt.optional(),prompts:A({listChanged:R().optional()}).optional(),resources:A({subscribe:R().optional(),listChanged:R().optional()}).optional(),tools:A({listChanged:R().optional()}).optional(),tasks:tUe.optional(),extensions:V(g(),Jt).optional()}),sUe=pn.extend({protocolVersion:g(),capabilities:oUe,serverInfo:Rq,instructions:g().optional()}),QC=Mr.extend({method:z("notifications/initialized"),params:Lr.optional()});var ey=dn.extend({method:z("ping"),params:Sr.optional()}),iUe=A({progress:K(),total:_t(K()),message:_t(g())}),aUe=A({...Lr.shape,...iUe.shape,progressToken:xq}),ty=Mr.extend({method:z("notifications/progress"),params:aUe}),cUe=Sr.extend({cursor:vq.optional()}),_f=dn.extend({params:cUe.optional()}),yf=pn.extend({nextCursor:vq.optional()}),lUe=Z(["working","input_required","completed","failed","cancelled"]),bf=A({taskId:g(),status:lUe,ttl:ie([K(),K0()]),createdAt:g(),lastUpdatedAt:g(),pollInterval:_t(K()),statusMessage:_t(g())}),Wl=pn.extend({task:bf}),uUe=Lr.merge(bf),Sf=Mr.extend({method:z("notifications/tasks/status"),params:uUe}),ny=dn.extend({method:z("tasks/get"),params:Sr.extend({taskId:g()})}),ry=pn.merge(bf),oy=dn.extend({method:z("tasks/result"),params:Sr.extend({taskId:g()})}),rwt=pn.loose(),sy=_f.extend({method:z("tasks/list")}),iy=yf.extend({tasks:I(bf)}),ay=dn.extend({method:z("tasks/cancel"),params:Sr.extend({taskId:g()})}),Oq=pn.merge(bf),Pq=A({uri:g(),mimeType:_t(g()),_meta:V(g(),xe()).optional()}),Iq=Pq.extend({text:g()}),eR=g().refine((e)=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Dq=Pq.extend({blob:eR}),Ef=Z(["user","assistant"]),ql=A({audience:I(Ef).optional(),priority:K().min(0).max(1).optional(),lastModified:Gu.datetime({offset:!0}).optional()}),Lq=A({...Gl.shape,...gf.shape,uri:g(),description:_t(g()),mimeType:_t(g()),size:_t(K()),annotations:ql.optional(),_meta:_t(wn({}))}),dUe=A({...Gl.shape,...gf.shape,uriTemplate:g(),description:_t(g()),mimeType:_t(g()),annotations:ql.optional(),_meta:_t(wn({}))}),cy=_f.extend({method:z("resources/list")}),pUe=yf.extend({resources:I(Lq)}),ly=_f.extend({method:z("resources/templates/list")}),fUe=yf.extend({resourceTemplates:I(dUe)}),tR=Sr.extend({uri:g()}),mUe=tR,uy=dn.extend({method:z("resources/read"),params:mUe}),hUe=pn.extend({contents:I(ie([Iq,Dq]))}),gUe=Mr.extend({method:z("notifications/resources/list_changed"),params:Lr.optional()}),_Ue=tR,yUe=dn.extend({method:z("resources/subscribe"),params:_Ue}),bUe=tR,SUe=dn.extend({method:z("resources/unsubscribe"),params:bUe}),EUe=Lr.extend({uri:g()}),xUe=Mr.extend({method:z("notifications/resources/updated"),params:EUe}),vUe=A({name:g(),description:_t(g()),required:_t(R())}),wUe=A({...Gl.shape,...gf.shape,description:_t(g()),arguments:_t(I(vUe)),_meta:_t(wn({}))}),dy=_f.extend({method:z("prompts/list")}),AUe=yf.extend({prompts:I(wUe)}),TUe=Sr.extend({name:g(),arguments:V(g(),g()).optional()}),py=dn.extend({method:z("prompts/get"),params:TUe}),nR=A({type:z("text"),text:g(),annotations:ql.optional(),_meta:V(g(),xe()).optional()}),rR=A({type:z("image"),data:eR,mimeType:g(),annotations:ql.optional(),_meta:V(g(),xe()).optional()}),oR=A({type:z("audio"),data:eR,mimeType:g(),annotations:ql.optional(),_meta:V(g(),xe()).optional()}),kUe=A({type:z("tool_use"),name:g(),id:g(),input:V(g(),xe()),_meta:V(g(),xe()).optional()}),CUe=A({type:z("resource"),resource:ie([Iq,Dq]),annotations:ql.optional(),_meta:V(g(),xe()).optional()}),RUe=Lq.extend({type:z("resource_link")}),sR=ie([nR,rR,oR,RUe,CUe]),OUe=A({role:Ef,content:sR}),PUe=pn.extend({description:g().optional(),messages:I(OUe)}),IUe=Mr.extend({method:z("notifications/prompts/list_changed"),params:Lr.optional()}),DUe=A({title:g().optional(),readOnlyHint:R().optional(),destructiveHint:R().optional(),idempotentHint:R().optional(),openWorldHint:R().optional()}),LUe=A({taskSupport:Z(["required","optional","forbidden"]).optional()}),Mq=A({...Gl.shape,...gf.shape,description:g().optional(),inputSchema:A({type:z("object"),properties:V(g(),Jt).optional(),required:I(g()).optional()}).catchall(xe()),outputSchema:A({type:z("object"),properties:V(g(),Jt).optional(),required:I(g()).optional()}).catchall(xe()).optional(),annotations:DUe.optional(),execution:LUe.optional(),_meta:V(g(),xe()).optional()}),fy=_f.extend({method:z("tools/list")}),MUe=yf.extend({tools:I(Mq)}),my=pn.extend({content:I(sR).default([]),structuredContent:V(g(),xe()).optional(),isError:R().optional()}),owt=my.or(pn.extend({toolResult:xe()})),NUe=mf.extend({name:g(),arguments:V(g(),xe()).optional()}),Vl=dn.extend({method:z("tools/call"),params:NUe}),UUe=Mr.extend({method:z("notifications/tools/list_changed"),params:Lr.optional()}),swt=A({autoRefresh:R().default(!0),debounceMs:K().int().nonnegative().default(300)}),xf=Z(["debug","info","notice","warning","error","critical","alert","emergency"]),FUe=Sr.extend({level:xf}),iR=dn.extend({method:z("logging/setLevel"),params:FUe}),zUe=Lr.extend({level:xf,logger:g().optional(),data:xe()}),$Ue=Mr.extend({method:z("notifications/message"),params:zUe}),jUe=A({name:g().optional()}),HUe=A({hints:I(jUe).optional(),costPriority:K().min(0).max(1).optional(),speedPriority:K().min(0).max(1).optional(),intelligencePriority:K().min(0).max(1).optional()}),BUe=A({mode:Z(["auto","required","none"]).optional()}),KUe=A({type:z("tool_result"),toolUseId:g().describe("The unique identifier for the corresponding tool call."),content:I(sR).default([]),structuredContent:A({}).loose().optional(),isError:R().optional(),_meta:V(g(),xe()).optional()}),GUe=Ri("type",[nR,rR,oR]),Z_=Ri("type",[nR,rR,oR,kUe,KUe]),WUe=A({role:Ef,content:ie([Z_,I(Z_)]),_meta:V(g(),xe()).optional()}),qUe=mf.extend({messages:I(WUe),modelPreferences:HUe.optional(),systemPrompt:g().optional(),includeContext:Z(["none","thisServer","allServers"]).optional(),temperature:K().optional(),maxTokens:K().int(),stopSequences:I(g()).optional(),metadata:Jt.optional(),tools:I(Mq).optional(),toolChoice:BUe.optional()}),VUe=dn.extend({method:z("sampling/createMessage"),params:qUe}),vf=pn.extend({model:g(),stopReason:_t(Z(["endTurn","stopSequence","maxTokens"]).or(g())),role:Ef,content:GUe}),aR=pn.extend({model:g(),stopReason:_t(Z(["endTurn","stopSequence","maxTokens","toolUse"]).or(g())),role:Ef,content:ie([Z_,I(Z_)])}),ZUe=A({type:z("boolean"),title:g().optional(),description:g().optional(),default:R().optional()}),YUe=A({type:z("string"),title:g().optional(),description:g().optional(),minLength:K().optional(),maxLength:K().optional(),format:Z(["email","uri","date","date-time"]).optional(),default:g().optional()}),JUe=A({type:Z(["number","integer"]),title:g().optional(),description:g().optional(),minimum:K().optional(),maximum:K().optional(),default:K().optional()}),XUe=A({type:z("string"),title:g().optional(),description:g().optional(),enum:I(g()),default:g().optional()}),QUe=A({type:z("string"),title:g().optional(),description:g().optional(),oneOf:I(A({const:g(),title:g()})),default:g().optional()}),eFe=A({type:z("string"),title:g().optional(),description:g().optional(),enum:I(g()),enumNames:I(g()).optional(),default:g().optional()}),tFe=ie([XUe,QUe]),nFe=A({type:z("array"),title:g().optional(),description:g().optional(),minItems:K().optional(),maxItems:K().optional(),items:A({type:z("string"),enum:I(g())}),default:I(g()).optional()}),rFe=A({type:z("array"),title:g().optional(),description:g().optional(),minItems:K().optional(),maxItems:K().optional(),items:A({anyOf:I(A({const:g(),title:g()}))}),default:I(g()).optional()}),oFe=ie([nFe,rFe]),sFe=ie([eFe,tFe,oFe]),iFe=ie([sFe,ZUe,YUe,JUe]),aFe=mf.extend({mode:z("form").optional(),message:g(),requestedSchema:A({type:z("object"),properties:V(g(),iFe),required:I(g()).optional()})}),cFe=mf.extend({mode:z("url"),message:g(),elicitationId:g(),url:g().url()}),lFe=ie([aFe,cFe]),uFe=dn.extend({method:z("elicitation/create"),params:lFe}),dFe=Lr.extend({elicitationId:g()}),pFe=Mr.extend({method:z("notifications/elicitation/complete"),params:dFe}),Zl=pn.extend({action:Z(["accept","decline","cancel"]),content:ot((e)=>e===null?void 0:e,V(g(),ie([g(),K(),R(),I(g())])).optional())}),fFe=A({type:z("ref/resource"),uri:g()});var mFe=A({type:z("ref/prompt"),name:g()}),hFe=Sr.extend({ref:ie([mFe,fFe]),argument:A({name:g(),value:g()}),context:A({arguments:V(g(),g()).optional()}).optional()}),hy=dn.extend({method:z("completion/complete"),params:hFe});function Nq(e){if(e.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function Uq(e){if(e.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var gFe=pn.extend({completion:wn({values:I(g()).max(100),total:_t(K().int()),hasMore:_t(R())})}),_Fe=A({uri:g().startsWith("file://"),name:g().optional(),_meta:V(g(),xe()).optional()}),yFe=dn.extend({method:z("roots/list"),params:Sr.optional()}),cR=pn.extend({roots:I(_Fe)}),bFe=Mr.extend({method:z("notifications/roots/list_changed"),params:Lr.optional()}),iwt=ie([ey,XC,hy,iR,py,dy,cy,ly,uy,yUe,SUe,Vl,fy,ny,oy,sy,ay]),awt=ie([Q_,ty,QC,bFe,Sf]),cwt=ie([X_,vf,aR,Zl,cR,ry,iy,Wl]),lwt=ie([ey,VUe,uFe,yFe,ny,oy,sy,ay]),uwt=ie([Q_,ty,$Ue,xUe,gUe,UUe,IUe,Sf,pFe]),dwt=ie([X_,sUe,gFe,PUe,AUe,pUe,fUe,hUe,my,MUe,ry,iy,Wl]);class ae extends Error{constructor(e,t,n){super(`MCP error ${e}: ${t}`);this.code=e,this.data=n,this.name="McpError"}static fromError(e,t,n){if(e===pe.UrlElicitationRequired&&n){let r=n;if(r.elicitations)return new Fq(r.elicitations,t)}return new ae(e,t,n)}}class Fq extends ae{constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(pe.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}}function ai(e){return e==="completed"||e==="failed"||e==="cancelled"}var $q=Symbol("Let zodToJsonSchema decide on which parser to use");var zq={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},jq=(e)=>typeof e==="string"?{...zq,name:e}:{...zq,...e};var Hq=(e)=>{let t=jq(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([r,o])=>[o._def,{def:o._def,path:[...t.basePath,t.definitionPath,r],jsonSchema:void 0}]))}};function lR(e,t,n,r){if(!r?.errorMessages)return;if(n)e.errorMessage={...e.errorMessage,[t]:n}}function ze(e,t,n,r,o){e[t]=n,lR(e,t,r,o)}var gy=(e,t)=>{let n=0;for(;n<e.length&&n<t.length;n++)if(e[n]!==t[n])break;return[(e.length-n).toString(),...t.slice(n)].join("/")};function bt(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?gy(t,e.currentPath):t.join("/")}}function Bq(e,t){let n={type:"array"};if(e.type?._def&&e.type?._def?.typeName!==B.ZodAny)n.items=he(e.type._def,{...t,currentPath:[...t.currentPath,"items"]});if(e.minLength)ze(n,"minItems",e.minLength.value,e.minLength.message,t);if(e.maxLength)ze(n,"maxItems",e.maxLength.value,e.maxLength.message,t);if(e.exactLength)ze(n,"minItems",e.exactLength.value,e.exactLength.message,t),ze(n,"maxItems",e.exactLength.value,e.exactLength.message,t);return n}function Kq(e,t){let n={type:"integer",format:"int64"};if(!e.checks)return n;for(let r of e.checks)switch(r.kind){case"min":if(t.target==="jsonSchema7")if(r.inclusive)ze(n,"minimum",r.value,r.message,t);else ze(n,"exclusiveMinimum",r.value,r.message,t);else{if(!r.inclusive)n.exclusiveMinimum=!0;ze(n,"minimum",r.value,r.message,t)}break;case"max":if(t.target==="jsonSchema7")if(r.inclusive)ze(n,"maximum",r.value,r.message,t);else ze(n,"exclusiveMaximum",r.value,r.message,t);else{if(!r.inclusive)n.exclusiveMaximum=!0;ze(n,"maximum",r.value,r.message,t)}break;case"multipleOf":ze(n,"multipleOf",r.value,r.message,t);break}return n}function Gq(){return{type:"boolean"}}function _y(e,t){return he(e.type._def,t)}var Wq=(e,t)=>he(e.innerType._def,t);function uR(e,t,n){let r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((o,s)=>uR(e,t,o))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return SFe(e,t)}}var SFe=(e,t)=>{let n={type:"integer",format:"unix-time"};if(t.target==="openApi3")return n;for(let r of e.checks)switch(r.kind){case"min":ze(n,"minimum",r.value,r.message,t);break;case"max":ze(n,"maximum",r.value,r.message,t);break}return n};function qq(e,t){return{...he(e.innerType._def,t),default:e.defaultValue()}}function Vq(e,t){return t.effectStrategy==="input"?he(e.schema._def,t):bt(t)}function Zq(e){return{type:"string",enum:Array.from(e.values)}}var EFe=(e)=>{if("type"in e&&e.type==="string")return!1;return"allOf"in e};function Yq(e,t){let n=[he(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),he(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter((s)=>!!s),r=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,o=[];return n.forEach((s)=>{if(EFe(s)){if(o.push(...s.allOf),s.unevaluatedProperties===void 0)r=void 0}else{let i=s;if("additionalProperties"in s&&s.additionalProperties===!1){let{additionalProperties:a,...c}=s;i=c}else r=void 0;o.push(i)}}),o.length?{allOf:o,...r}:void 0}function Jq(e,t){let n=typeof e.value;if(n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string")return{type:Array.isArray(e.value)?"array":"object"};if(t.target==="openApi3")return{type:n==="bigint"?"integer":n,enum:[e.value]};return{type:n==="bigint"?"integer":n,const:e.value}}var dR=void 0,lo={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>{if(dR===void 0)dR=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return dR},uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function yy(e,t){let n={type:"string"};if(e.checks)for(let r of e.checks)switch(r.kind){case"min":ze(n,"minLength",typeof n.minLength==="number"?Math.max(n.minLength,r.value):r.value,r.message,t);break;case"max":ze(n,"maxLength",typeof n.maxLength==="number"?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case"email":switch(t.emailStrategy){case"format:email":uo(n,"email",r.message,t);break;case"format:idn-email":uo(n,"idn-email",r.message,t);break;case"pattern:zod":On(n,lo.email,r.message,t);break}break;case"url":uo(n,"uri",r.message,t);break;case"uuid":uo(n,"uuid",r.message,t);break;case"regex":On(n,r.regex,r.message,t);break;case"cuid":On(n,lo.cuid,r.message,t);break;case"cuid2":On(n,lo.cuid2,r.message,t);break;case"startsWith":On(n,RegExp(`^${pR(r.value,t)}`),r.message,t);break;case"endsWith":On(n,RegExp(`${pR(r.value,t)}$`),r.message,t);break;case"datetime":uo(n,"date-time",r.message,t);break;case"date":uo(n,"date",r.message,t);break;case"time":uo(n,"time",r.message,t);break;case"duration":uo(n,"duration",r.message,t);break;case"length":ze(n,"minLength",typeof n.minLength==="number"?Math.max(n.minLength,r.value):r.value,r.message,t),ze(n,"maxLength",typeof n.maxLength==="number"?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case"includes":{On(n,RegExp(pR(r.value,t)),r.message,t);break}case"ip":{if(r.version!=="v6")uo(n,"ipv4",r.message,t);if(r.version!=="v4")uo(n,"ipv6",r.message,t);break}case"base64url":On(n,lo.base64url,r.message,t);break;case"jwt":On(n,lo.jwt,r.message,t);break;case"cidr":{if(r.version!=="v6")On(n,lo.ipv4Cidr,r.message,t);if(r.version!=="v4")On(n,lo.ipv6Cidr,r.message,t);break}case"emoji":On(n,lo.emoji(),r.message,t);break;case"ulid":{On(n,lo.ulid,r.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{uo(n,"binary",r.message,t);break}case"contentEncoding:base64":{ze(n,"contentEncoding","base64",r.message,t);break}case"pattern:zod":{On(n,lo.base64,r.message,t);break}}break}case"nanoid":On(n,lo.nanoid,r.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:((o)=>{})(r)}return n}function pR(e,t){return t.patternStrategy==="escape"?vFe(e):e}var xFe=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function vFe(e){let t="";for(let n=0;n<e.length;n++){if(!xFe.has(e[n]))t+="\\";t+=e[n]}return t}function uo(e,t,n,r){if(e.format||e.anyOf?.some((o)=>o.format)){if(!e.anyOf)e.anyOf=[];if(e.format){if(e.anyOf.push({format:e.format,...e.errorMessage&&r.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage){if(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0)delete e.errorMessage}}e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})}else ze(e,"format",t,n,r)}function On(e,t,n,r){if(e.pattern||e.allOf?.some((o)=>o.pattern)){if(!e.allOf)e.allOf=[];if(e.pattern){if(e.allOf.push({pattern:e.pattern,...e.errorMessage&&r.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage){if(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0)delete e.errorMessage}}e.allOf.push({pattern:Xq(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})}else ze(e,"pattern",Xq(t,r),n,r)}function Xq(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},r=n.i?e.source.toLowerCase():e.source,o="",s=!1,i=!1,a=!1;for(let c=0;c<r.length;c++){if(s){o+=r[c],s=!1;continue}if(n.i){if(i){if(r[c].match(/[a-z]/)){if(a)o+=r[c],o+=`${r[c-2]}-${r[c]}`.toUpperCase(),a=!1;else if(r[c+1]==="-"&&r[c+2]?.match(/[a-z]/))o+=r[c],a=!0;else o+=`${r[c]}${r[c].toUpperCase()}`;continue}}else if(r[c].match(/[a-z]/)){o+=`[${r[c]}${r[c].toUpperCase()}]`;continue}}if(n.m){if(r[c]==="^"){o+=`(^|(?<=[\r
]))`;continue}else if(r[c]==="$"){o+=`($|(?=[\r
]))`;continue}}if(n.s&&r[c]==="."){o+=i?`${r[c]}\r
`:`[${r[c]}\r
]`;continue}if(o+=r[c],r[c]==="\\")s=!0;else if(i&&r[c]==="]")i=!1;else if(!i&&r[c]==="[")i=!0}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}function by(e,t){if(t.target==="openAi")console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");if(t.target==="openApi3"&&e.keyType?._def.typeName===B.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((r,o)=>({...r,[o]:he(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",o]})??bt(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let n={type:"object",additionalProperties:he(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return n;if(e.keyType?._def.typeName===B.ZodString&&e.keyType._def.checks?.length){let{type:r,...o}=yy(e.keyType._def,t);return{...n,propertyNames:o}}else if(e.keyType?._def.typeName===B.ZodEnum)return{...n,propertyNames:{enum:e.keyType._def.values}};else if(e.keyType?._def.typeName===B.ZodBranded&&e.keyType._def.type._def.typeName===B.ZodString&&e.keyType._def.type._def.checks?.length){let{type:r,...o}=_y(e.keyType._def,t);return{...n,propertyNames:o}}return n}function Qq(e,t){if(t.mapStrategy==="record")return by(e,t);let n=he(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||bt(t),r=he(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||bt(t);return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function eV(e){let t=e.values,r=Object.keys(e.values).filter((s)=>typeof t[t[s]]!=="number").map((s)=>t[s]),o=Array.from(new Set(r.map((s)=>typeof s)));return{type:o.length===1?o[0]==="string"?"string":"number":["string","number"],enum:r}}function tV(e){return e.target==="openAi"?void 0:{not:bt({...e,currentPath:[...e.currentPath,"not"]})}}function nV(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var wf={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function oV(e,t){if(t.target==="openApi3")return rV(e,t);let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every((r)=>(r._def.typeName in wf)&&(!r._def.checks||!r._def.checks.length))){let r=n.reduce((o,s)=>{let i=wf[s._def.typeName];return i&&!o.includes(i)?[...o,i]:o},[]);return{type:r.length>1?r:r[0]}}else if(n.every((r)=>r._def.typeName==="ZodLiteral"&&!r.description)){let r=n.reduce((o,s)=>{let i=typeof s._def.value;switch(i){case"string":case"number":case"boolean":return[...o,i];case"bigint":return[...o,"integer"];case"object":if(s._def.value===null)return[...o,"null"];case"symbol":case"undefined":case"function":default:return o}},[]);if(r.length===n.length){let o=r.filter((s,i,a)=>a.indexOf(s)===i);return{type:o.length>1?o:o[0],enum:n.reduce((s,i)=>s.includes(i._def.value)?s:[...s,i._def.value],[])}}}else if(n.every((r)=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,o)=>[...r,...o._def.values.filter((s)=>!r.includes(s))],[])};return rV(e,t)}var rV=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,o)=>he(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${o}`]})).filter((r)=>!!r&&(!t.strictUnions||typeof r==="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function sV(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length)){if(t.target==="openApi3")return{type:wf[e.innerType._def.typeName],nullable:!0};return{type:[wf[e.innerType._def.typeName],"null"]}}if(t.target==="openApi3"){let r=he(e.innerType._def,{...t,currentPath:[...t.currentPath]});if(r&&"$ref"in r)return{allOf:[r],nullable:!0};return r&&{...r,nullable:!0}}let n=he(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function iV(e,t){let n={type:"number"};if(!e.checks)return n;for(let r of e.checks)switch(r.kind){case"int":n.type="integer",lR(n,"type",r.message,t);break;case"min":if(t.target==="jsonSchema7")if(r.inclusive)ze(n,"minimum",r.value,r.message,t);else ze(n,"exclusiveMinimum",r.value,r.message,t);else{if(!r.inclusive)n.exclusiveMinimum=!0;ze(n,"minimum",r.value,r.message,t)}break;case"max":if(t.target==="jsonSchema7")if(r.inclusive)ze(n,"maximum",r.value,r.message,t);else ze(n,"exclusiveMaximum",r.value,r.message,t);else{if(!r.inclusive)n.exclusiveMaximum=!0;ze(n,"maximum",r.value,r.message,t)}break;case"multipleOf":ze(n,"multipleOf",r.value,r.message,t);break}return n}function aV(e,t){let n=t.target==="openAi",r={type:"object",properties:{}},o=[],s=e.shape();for(let a in s){let c=s[a];if(c===void 0||c._def===void 0)continue;let l=AFe(c);if(l&&n){if(c._def.typeName==="ZodOptional")c=c._def.innerType;if(!c.isNullable())c=c.nullable();l=!1}let u=he(c._def,{...t,currentPath:[...t.currentPath,"properties",a],propertyPath:[...t.currentPath,"properties",a]});if(u===void 0)continue;if(r.properties[a]=u,!l)o.push(a)}if(o.length)r.required=o;let i=wFe(e,t);if(i!==void 0)r.additionalProperties=i;return r}function wFe(e,t){if(e.catchall._def.typeName!=="ZodNever")return he(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function AFe(e){try{return e.isOptional()}catch{return!0}}var cV=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return he(e.innerType._def,t);let n=he(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:bt(t)},n]}:bt(t)};var lV=(e,t)=>{if(t.pipeStrategy==="input")return he(e.in._def,t);else if(t.pipeStrategy==="output")return he(e.out._def,t);let n=he(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=he(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter((o)=>o!==void 0)}};function uV(e,t){return he(e.type._def,t)}function dV(e,t){let r={type:"array",uniqueItems:!0,items:he(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};if(e.minSize)ze(r,"minItems",e.minSize.value,e.minSize.message,t);if(e.maxSize)ze(r,"maxItems",e.maxSize.value,e.maxSize.message,t);return r}function pV(e,t){if(e.rest)return{type:"array",minItems:e.items.length,items:e.items.map((n,r)=>he(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:he(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})};else return{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,r)=>he(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function fV(e){return{not:bt(e)}}function mV(e){return bt(e)}var hV=(e,t)=>he(e.innerType._def,t);var gV=(e,t,n)=>{switch(t){case B.ZodString:return yy(e,n);case B.ZodNumber:return iV(e,n);case B.ZodObject:return aV(e,n);case B.ZodBigInt:return Kq(e,n);case B.ZodBoolean:return Gq();case B.ZodDate:return uR(e,n);case B.ZodUndefined:return fV(n);case B.ZodNull:return nV(n);case B.ZodArray:return Bq(e,n);case B.ZodUnion:case B.ZodDiscriminatedUnion:return oV(e,n);case B.ZodIntersection:return Yq(e,n);case B.ZodTuple:return pV(e,n);case B.ZodRecord:return by(e,n);case B.ZodLiteral:return Jq(e,n);case B.ZodEnum:return Zq(e);case B.ZodNativeEnum:return eV(e);case B.ZodNullable:return sV(e,n);case B.ZodOptional:return cV(e,n);case B.ZodMap:return Qq(e,n);case B.ZodSet:return dV(e,n);case B.ZodLazy:return()=>e.getter()._def;case B.ZodPromise:return uV(e,n);case B.ZodNaN:case B.ZodNever:return tV(n);case B.ZodEffects:return Vq(e,n);case B.ZodAny:return bt(n);case B.ZodUnknown:return mV(n);case B.ZodDefault:return qq(e,n);case B.ZodBranded:return _y(e,n);case B.ZodReadonly:return hV(e,n);case B.ZodCatch:return Wq(e,n);case B.ZodPipeline:return lV(e,n);case B.ZodFunction:case B.ZodVoid:case B.ZodSymbol:return;default:return((r)=>{return})(t)}};function he(e,t,n=!1){let r=t.seen.get(e);if(t.override){let a=t.override?.(e,t,r,n);if(a!==$q)return a}if(r&&!n){let a=TFe(r,t);if(a!==void 0)return a}let o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);let s=gV(e,e.typeName,t),i=typeof s==="function"?he(s(),t):s;if(i)kFe(e,t,i);if(t.postProcess){let a=t.postProcess(i,e,t);return o.jsonSchema=i,a}return o.jsonSchema=i,i}var TFe=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:gy(t.currentPath,e.path)};case"none":case"seen":{if(e.path.length<t.currentPath.length&&e.path.every((n,r)=>t.currentPath[r]===n))return console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),bt(t);return t.$refStrategy==="seen"?bt(t):void 0}}},kFe=(e,t,n)=>{if(e.description){if(n.description=e.description,t.markdownDescription)n.markdownDescription=e.description}return n};var fR=(e,t)=>{let n=Hq(t),r=typeof t==="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[l,u])=>({...c,[l]:he(u._def,{...n,currentPath:[...n.basePath,n.definitionPath,l]},!0)??bt(n)}),{}):void 0,o=typeof t==="string"?t:t?.nameStrategy==="title"?void 0:t?.name,s=he(e._def,o===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,o]},!1)??bt(n),i=typeof t==="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;if(i!==void 0)s.title=i;if(n.flags.hasReferencedOpenAiAnyType){if(!r)r={};if(!r[n.openAiAnyTypeName])r[n.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:n.$refStrategy==="relative"?"1":[...n.basePath,n.definitionPath,n.openAiAnyTypeName].join("/")}}}let a=o===void 0?r?{...s,[n.definitionPath]:r}:s:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,o].join("/"),[n.definitionPath]:{...r,[o]:s}};if(n.target==="jsonSchema7")a.$schema="http://json-schema.org/draft-07/schema#";else if(n.target==="jsonSchema2019-09"||n.target==="openAi")a.$schema="https://json-schema.org/draft/2019-09/schema#";if(n.target==="openAi"&&(("anyOf"in a)||("oneOf"in a)||("allOf"in a)||("type"in a)&&Array.isArray(a.type)))console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");return a};function CFe(e){if(!e)return"draft-7";if(e==="jsonSchema7"||e==="draft-7")return"draft-7";if(e==="jsonSchema2019-09"||e==="draft-2020-12")return"draft-2020-12";return"draft-7"}function mR(e,t){if(Dr(e))return Km(e,{target:CFe(t?.target),io:t?.pipeStrategy??"input"});return fR(e,{strictUnions:t?.strictUnions??!0,pipeStrategy:t?.pipeStrategy??"input"})}function hR(e){let n=si(e)?.method;if(!n)throw Error("Schema is missing a method literal");let r=V_(n);if(typeof r!=="string")throw Error("Schema method literal must be a string");return r}function gR(e,t){let n=oi(e,t);if(!n.success)throw n.error;return n.data}var RFe=60000;class _R{constructor(e){if(this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Q_,(t)=>{this._oncancel(t)}),this.setNotificationHandler(ty,(t)=>{this._onprogress(t)}),this.setRequestHandler(ey,(t)=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore)this.setRequestHandler(ny,async(t,n)=>{let r=await this._taskStore.getTask(t.params.taskId,n.sessionId);if(!r)throw new ae(pe.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(oy,async(t,n)=>{let r=async()=>{let o=t.params.taskId;if(this._taskMessageQueue){let i;while(i=await this._taskMessageQueue.dequeue(o,n.sessionId)){if(i.type==="response"||i.type==="error"){let a=i.message,c=a.id,l=this._requestResolvers.get(c);if(l)if(this._requestResolvers.delete(c),i.type==="response")l(a);else{let u=a,p=new ae(u.error.code,u.error.message,u.error.data);l(p)}else{let u=i.type==="response"?"Response":"Error";this._onerror(Error(`${u} handler missing for request ${c}`))}continue}await this._transport?.send(i.message,{relatedRequestId:n.requestId})}}let s=await this._taskStore.getTask(o,n.sessionId);if(!s)throw new ae(pe.InvalidParams,`Task not found: ${o}`);if(!ai(s.status))return await this._waitForTaskUpdate(o,n.signal),await r();if(ai(s.status)){let i=await this._taskStore.getTaskResult(o,n.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[ii]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(sy,async(t,n)=>{try{let{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,n.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new ae(pe.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(ay,async(t,n)=>{try{let r=await this._taskStore.getTask(t.params.taskId,n.sessionId);if(!r)throw new ae(pe.InvalidParams,`Task not found: ${t.params.taskId}`);if(ai(r.status))throw new ae(pe.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(t.params.taskId);let o=await this._taskStore.getTask(t.params.taskId,n.sessionId);if(!o)throw new ae(pe.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){if(r instanceof ae)throw r;throw new ae(pe.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}})}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),ae.fromError(pe.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);if(t)clearTimeout(t.timeoutId),this._timeoutInfo.delete(e)}async connect(e){if(this._transport)throw Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=(o)=>{n?.(o),this._onerror(o)};let r=this._transport?.onmessage;this._transport.onmessage=(o,s)=>{if(r?.(o,s),hf(o)||Cq(o))this._onresponse(o);else if(ZC(o))this._onrequest(o,s);else if(kq(o))this._onnotification(o);else this._onerror(Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let t=ae.fromError(pe.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;if(t===void 0)return;Promise.resolve().then(()=>t(e)).catch((n)=>this._onerror(Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,t){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[ii]?.taskId;if(n===void 0){let l={jsonrpc:"2.0",id:e.id,error:{code:pe.MethodNotFound,message:"Method not found"}};if(o&&this._taskMessageQueue)this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch((u)=>this._onerror(Error(`Failed to enqueue error response: ${u}`)));else r?.send(l).catch((u)=>this._onerror(Error(`Failed to send an error response: ${u}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(e.id,s);let i=wq(e.params)?e.params.task:void 0,a=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,c={signal:s.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async(l)=>{if(s.signal.aborted)return;let u={relatedRequestId:e.id};if(o)u.relatedTask={taskId:o};await this.notification(l,u)},sendRequest:async(l,u,p)=>{if(s.signal.aborted)throw new ae(pe.ConnectionClosed,"Request was cancelled");let f={...p,relatedRequestId:e.id};if(o&&!f.relatedTask)f.relatedTask={taskId:o};let m=f.relatedTask?.taskId??o;if(m&&a)await a.updateTaskStatus(m,"input_required");return await this.request(l,u,f)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:a,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{if(i)this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,c)).then(async(l)=>{if(s.signal.aborted)return;let u={result:l,jsonrpc:"2.0",id:e.id};if(o&&this._taskMessageQueue)await this._enqueueTaskMessage(o,{type:"response",message:u,timestamp:Date.now()},r?.sessionId);else await r?.send(u)},async(l)=>{if(s.signal.aborted)return;let u={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:pe.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};if(o&&this._taskMessageQueue)await this._enqueueTaskMessage(o,{type:"error",message:u,timestamp:Date.now()},r?.sessionId);else await r?.send(u)}).catch((l)=>this._onerror(Error(`Failed to send response: ${l}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(e.id)===s)this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&s&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(a){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),s(a);return}o(n)}_onresponse(e){let t=Number(e.id),n=this._requestResolvers.get(t);if(n){if(this._requestResolvers.delete(t),hf(e))n(e);else{let s=new ae(e.error.code,e.error.message,e.error.data);n(s)}return}let r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(hf(e)&&e.result&&typeof e.result==="object"){let s=e.result;if(s.task&&typeof s.task==="object"){let i=s.task;if(typeof i.taskId==="string")o=!0,this._taskProgressTokens.set(i.taskId,t)}}if(!o)this._progressHandlers.delete(t);if(hf(e))r(e);else{let s=ae.fromError(e.error.code,e.error.message,e.error.data);r(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,n){let{task:r}=n??{};if(!r){try{yield{type:"result",result:await this.request(e,t,n)}}catch(s){yield{type:"error",error:s instanceof ae?s:new ae(pe.InternalError,String(s))}}return}let o;try{let s=await this.request(e,Wl,n);if(s.task)o=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new ae(pe.InternalError,"Task creation did not return a task");while(!0){let i=await this.getTask({taskId:o},n);if(yield{type:"taskStatus",task:i},ai(i.status)){if(i.status==="completed")yield{type:"result",result:await this.getTaskResult({taskId:o},t,n)};else if(i.status==="failed")yield{type:"error",error:new ae(pe.InternalError,`Task ${o} failed`)};else if(i.status==="cancelled")yield{type:"error",error:new ae(pe.InternalError,`Task ${o} was cancelled`)};return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,n)};return}let a=i.pollInterval??this._options?.defaultTaskPollInterval??1000;await new Promise((c)=>setTimeout(c,a)),n?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof ae?s:new ae(pe.InternalError,String(s))}}}request(e,t,n){let{relatedRequestId:r,resumptionToken:o,onresumptiontoken:s,task:i,relatedTask:a}=n??{};return new Promise((c,l)=>{let u=(S)=>{l(S)};if(!this._transport){u(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{if(this.assertCapabilityForMethod(e.method),i)this.assertTaskCapability(e.method)}catch(S){u(S);return}n?.signal?.throwIfAborted();let p=this._requestMessageId++,f={...e,jsonrpc:"2.0",id:p};if(n?.onprogress)this._progressHandlers.set(p,n.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:p}};if(i)f.params={...f.params,task:i};if(a)f.params={...f.params,_meta:{...f.params?._meta||{},[ii]:a}};let m=(S)=>{this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,reason:String(S)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:s}).catch((x)=>this._onerror(Error(`Failed to send cancellation: ${x}`)));let b=S instanceof ae?S:new ae(pe.RequestTimeout,String(S));l(b)};this._responseHandlers.set(p,(S)=>{if(n?.signal?.aborted)return;if(S instanceof Error)return l(S);try{let b=oi(t,S.result);if(!b.success)l(b.error);else c(b.data)}catch(b){l(b)}}),n?.signal?.addEventListener("abort",()=>{m(n?.signal?.reason)});let h=n?.timeout??RFe,_=()=>m(ae.fromError(pe.RequestTimeout,"Request timed out",{timeout:h}));this._setupTimeout(p,h,n?.maxTotalTimeout,_,n?.resetTimeoutOnProgress??!1);let y=a?.taskId;if(y){let S=(b)=>{let x=this._responseHandlers.get(p);if(x)x(b);else this._onerror(Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,S),this._enqueueTaskMessage(y,{type:"request",message:f,timestamp:Date.now()}).catch((b)=>{this._cleanupTimeout(p),l(b)})}else this._transport.send(f,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:s}).catch((S)=>{this._cleanupTimeout(p),l(S)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},ry,t)}async getTaskResult(e,t,n){return this.request({method:"tasks/result",params:e},t,n)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},iy,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},Oq,t)}async notification(e,t){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability(e.method);let n=t?.relatedTask?.taskId;if(n){let i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[ii]:t.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};if(t?.relatedTask)i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[ii]:t.relatedTask}}};this._transport?.send(i,t).catch((a)=>this._onerror(a))});return}let s={...e,jsonrpc:"2.0"};if(t?.relatedTask)s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[ii]:t.relatedTask}}};await this._transport.send(s,t)}setRequestHandler(e,t){let n=hR(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(r,o)=>{let s=gR(e,r);return Promise.resolve(t(s,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){let n=hR(e);this._notificationHandlers.set(n,(r)=>{let o=gR(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);if(t!==void 0)this._progressHandlers.delete(t),this._taskProgressTokens.delete(e)}async _enqueueTaskMessage(e,t,n){if(!this._taskStore||!this._taskMessageQueue)throw Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,n,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,t);for(let r of n)if(r.type==="request"&&ZC(r.message)){let o=r.message.id,s=this._requestResolvers.get(o);if(s)s(new ae(pe.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o);else this._onerror(Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let n=this._options?.defaultTaskPollInterval??1000;try{let r=await this._taskStore?.getTask(e);if(r?.pollInterval)n=r.pollInterval}catch{}return new Promise((r,o)=>{if(t.aborted){o(new ae(pe.InvalidRequest,"Request cancelled"));return}let s=setTimeout(r,n);t.addEventListener("abort",()=>{clearTimeout(s),o(new ae(pe.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){let n=this._taskStore;if(!n)throw Error("No task store configured");return{createTask:async(r)=>{if(!e)throw Error("No request provided");return await n.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async(r)=>{let o=await n.getTask(r,t);if(!o)throw new ae(pe.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,s)=>{await n.storeTaskResult(r,o,s,t);let i=await n.getTask(r,t);if(i){let a=Sf.parse({method:"notifications/tasks/status",params:i});if(await this.notification(a),ai(i.status))this._cleanupTaskProgressHandler(r)}},getTaskResult:(r)=>n.getTaskResult(r,t),updateTaskStatus:async(r,o,s)=>{let i=await n.getTask(r,t);if(!i)throw new ae(pe.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(ai(i.status))throw new ae(pe.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(r,o,s,t);let a=await n.getTask(r,t);if(a){let c=Sf.parse({method:"notifications/tasks/status",params:a});if(await this.notification(c),ai(a.status))this._cleanupTaskProgressHandler(r)}},listTasks:(r)=>n.listTasks(r,t)}}}function _V(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function yV(e,t){let n={...e};for(let r in t){let o=r,s=t[o];if(s===void 0)continue;let i=n[o];if(_V(i)&&_V(s))n[o]={...i,...s};else n[o]=s}return n}var eZ=$a(pO(),1),tZ=$a(Q9(),1);function JKe(){let e=new eZ.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return tZ.default(e),e}class xO{constructor(e){this._ajv=e??JKe()}getValidator(e){let t="$id"in e&&typeof e.$id==="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return(n)=>{if(t(n))return{valid:!0,data:n,errorMessage:void 0};else return{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}}class vO{constructor(e){this._server=e}requestStream(e,t,n){return this._server.requestStream(e,t,n)}createMessageStream(e,t){let n=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!n?.sampling?.tools)throw Error("Client does not support sampling tools capability.");if(e.messages.length>0){let r=e.messages[e.messages.length-1],o=Array.isArray(r.content)?r.content:[r.content],s=o.some((l)=>l.type==="tool_result"),i=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=i?Array.isArray(i.content)?i.content:[i.content]:[],c=a.some((l)=>l.type==="tool_use");if(s){if(o.some((l)=>l.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!c)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let l=new Set(a.filter((p)=>p.type==="tool_use").map((p)=>p.id)),u=new Set(o.filter((p)=>p.type==="tool_result").map((p)=>p.toolUseId));if(l.size!==u.size||![...l].every((p)=>u.has(p)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},vf,t)}elicitInputStream(e,t){let n=this._server.getClientCapabilities(),r=e.mode??"form";switch(r){case"url":{if(!n?.elicitation?.url)throw Error("Client does not support url elicitation.");break}case"form":{if(!n?.elicitation?.form)throw Error("Client does not support form elicitation.");break}}let o=r==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:o},Zl,t)}async getTask(e,t){return this._server.getTask({taskId:e},t)}async getTaskResult(e,t,n){return this._server.getTaskResult({taskId:e},t,n)}async listTasks(e,t){return this._server.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._server.cancelTask({taskId:e},t)}}function nZ(e,t,n){if(!e)throw Error(`${n} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!e.tools?.call)throw Error(`${n} does not support task creation for tools/call (required for ${t})`);break;default:break}}function rZ(e,t,n){if(!e)throw Error(`${n} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!e.sampling?.createMessage)throw Error(`${n} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!e.elicitation?.create)throw Error(`${n} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}class wO extends _R{constructor(e,t){super(t);if(this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(xf.options.map((n,r)=>[n,r])),this.isMessageIgnored=(n,r)=>{let o=this._loggingLevels.get(r);return o?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(o):!1},this._capabilities=t?.capabilities??{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new xO,this.setRequestHandler(XC,(n)=>this._oninitialize(n)),this.setNotificationHandler(QC,()=>this.oninitialized?.()),this._capabilities.logging)this.setRequestHandler(iR,async(n,r)=>{let o=r.sessionId||r.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=n.params,i=xf.safeParse(s);if(i.success)this._loggingLevels.set(o,i.data);return{}})}get experimental(){if(!this._experimental)this._experimental={tasks:new vO(this)};return this._experimental}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=yV(this._capabilities,e)}setRequestHandler(e,t){let r=si(e)?.method;if(!r)throw Error("Schema is missing a method literal");let o;if(Dr(r)){let i=r;o=i._zod?.def?.value??i.value}else{let i=r;o=i._def?.value??i.value}if(typeof o!=="string")throw Error("Schema method literal must be a string");if(o==="tools/call"){let i=async(a,c)=>{let l=oi(Vl,a);if(!l.success){let m=l.error instanceof Error?l.error.message:String(l.error);throw new ae(pe.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:u}=l.data,p=await Promise.resolve(t(a,c));if(u.task){let m=oi(Wl,p);if(!m.success){let h=m.error instanceof Error?m.error.message:String(m.error);throw new ae(pe.InvalidParams,`Invalid task creation result: ${h}`)}return m.data}let f=oi(my,p);if(!f.success){let m=f.error instanceof Error?f.error.message:String(f.error);throw new ae(pe.InvalidParams,`Invalid tools/call result: ${m}`)}return f.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(!this._capabilities)return;switch(e){case"completion/complete":if(!this._capabilities.completions)throw Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){rZ(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){if(!this._capabilities)return;nZ(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let t=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:Eq.includes(t)?t:qC,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},X_)}async createMessage(e,t){if(e.tools||e.toolChoice){if(!this._clientCapabilities?.sampling?.tools)throw Error("Client does not support sampling tools capability.")}if(e.messages.length>0){let n=e.messages[e.messages.length-1],r=Array.isArray(n.content)?n.content:[n.content],o=r.some((c)=>c.type==="tool_result"),s=e.messages.length>1?e.messages[e.messages.length-2]:void 0,i=s?Array.isArray(s.content)?s.content:[s.content]:[],a=i.some((c)=>c.type==="tool_use");if(o){if(r.some((c)=>c.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!a)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(a){let c=new Set(i.filter((u)=>u.type==="tool_use").map((u)=>u.id)),l=new Set(r.filter((u)=>u.type==="tool_result").map((u)=>u.toolUseId));if(c.size!==l.size||![...c].every((u)=>l.has(u)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}if(e.tools)return this.request({method:"sampling/createMessage",params:e},aR,t);return this.request({method:"sampling/createMessage",params:e},vf,t)}async elicitInput(e,t){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support url elicitation.");let r=e;return this.request({method:"elicitation/create",params:r},Zl,t)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw Error("Client does not support form elicitation.");let r=e.mode==="form"?e:{...e,mode:"form"},o=await this.request({method:"elicitation/create",params:r},Zl,t);if(o.action==="accept"&&o.content&&r.requestedSchema)try{let i=this._jsonSchemaValidator.getValidator(r.requestedSchema)(o.content);if(!i.valid)throw new ae(pe.InvalidParams,`Elicitation response content does not match requested schema: ${i.errorMessage}`)}catch(s){if(s instanceof ae)throw s;throw new ae(pe.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return o}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this.request({method:"roots/list",params:e},cR,t)}async sendLoggingMessage(e,t){if(this._capabilities.logging){if(!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}var sZ=Symbol.for("mcp.completable");function AO(e){return!!e&&typeof e==="object"&&sZ in e}function iZ(e){return e[sZ]?.complete}var oZ;(function(e){e.Completable="McpCompletable"})(oZ||(oZ={}));var XKe=/^[A-Za-z0-9._-]{1,128}$/;function QKe(e){let t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" "))t.push("Tool name contains spaces, which may cause parsing issues");if(e.includes(","))t.push("Tool name contains commas, which may cause parsing issues");if(e.startsWith("-")||e.endsWith("-"))t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if(e.startsWith(".")||e.endsWith("."))t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!XKe.test(e)){let n=e.split("").filter((r)=>!/[A-Za-z0-9._-]/.test(r)).filter((r,o,s)=>s.indexOf(r)===o);return t.push(`Tool name contains invalid characters: ${n.map((r)=>`"${r}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}function eGe(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(let n of t)console.warn(` - ${n}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function TO(e){let t=QKe(e);return eGe(e,t.warnings),t.isValid}class kO{constructor(e){this._mcpServer=e}registerToolTask(e,t,n){let r={taskSupport:"required",...t.execution};if(r.taskSupport==="forbidden")throw Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,t.title,t.description,t.inputSchema,t.outputSchema,t.annotations,r,t._meta,n)}}class RO{constructor(e,t){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new wO(e,t)}get experimental(){if(!this._experimental)this._experimental={tasks:new kO(this)};return this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler(hi(fy)),this.server.assertCanSetRequestHandler(hi(Vl)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(fy,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:(()=>{let r=Kl(t.inputSchema);return r?mR(r,{strictUnions:!0,pipeStrategy:"input"}):tGe})(),annotations:t.annotations,execution:t.execution,_meta:t._meta};if(t.outputSchema){let r=Kl(t.outputSchema);if(r)n.outputSchema=mR(r,{strictUnions:!0,pipeStrategy:"output"})}return n})})),this.server.setRequestHandler(Vl,async(e,t)=>{try{let n=this._registeredTools[e.params.name];if(!n)throw new ae(pe.InvalidParams,`Tool ${e.params.name} not found`);if(!n.enabled)throw new ae(pe.InvalidParams,`Tool ${e.params.name} disabled`);let r=!!e.params.task,o=n.execution?.taskSupport,s="createTask"in n.handler;if((o==="required"||o==="optional")&&!s)throw new ae(pe.InternalError,`Tool ${e.params.name} has taskSupport '${o}' but was not registered with registerToolTask`);if(o==="required"&&!r)throw new ae(pe.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(o==="optional"&&!r&&s)return await this.handleAutomaticTaskPolling(n,e,t);let i=await this.validateToolInput(n,e.params.arguments,e.params.name),a=await this.executeToolHandler(n,i,t);if(r)return a;return await this.validateToolOutput(n,a,e.params.name),a}catch(n){if(n instanceof ae){if(n.code===pe.UrlElicitationRequired)throw n}return this.createToolError(n instanceof Error?n.message:String(n))}}),this._toolHandlersInitialized=!0}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,t,n){if(!e.inputSchema)return;let o=Kl(e.inputSchema)??e.inputSchema,s=await W_(o,t);if(!s.success){let i="error"in s?s.error:"Unknown error",a=q_(i);throw new ae(pe.InvalidParams,`Input validation error: Invalid arguments for tool ${n}: ${a}`)}return s.data}async validateToolOutput(e,t,n){if(!e.outputSchema)return;if(!("content"in t))return;if(t.isError)return;if(!t.structuredContent)throw new ae(pe.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let r=Kl(e.outputSchema),o=await W_(r,t.structuredContent);if(!o.success){let s="error"in o?o.error:"Unknown error",i=q_(s);throw new ae(pe.InvalidParams,`Output validation error: Invalid structured content for tool ${n}: ${i}`)}}async executeToolHandler(e,t,n){let r=e.handler;if("createTask"in r){if(!n.taskStore)throw Error("No task store provided.");let s={...n,taskStore:n.taskStore};if(e.inputSchema)return await Promise.resolve(r.createTask(t,s));else return await Promise.resolve(r.createTask(s))}if(e.inputSchema)return await Promise.resolve(r(t,n));else return await Promise.resolve(r(n))}async handleAutomaticTaskPolling(e,t,n){if(!n.taskStore)throw Error("No task store provided for task-capable tool.");let r=await this.validateToolInput(e,t.params.arguments,t.params.name),o=e.handler,s={...n,taskStore:n.taskStore},i=r?await Promise.resolve(o.createTask(r,s)):await Promise.resolve(o.createTask(s)),a=i.task.taskId,c=i.task,l=c.pollInterval??5000;while(c.status!=="completed"&&c.status!=="failed"&&c.status!=="cancelled"){await new Promise((p)=>setTimeout(p,l));let u=await n.taskStore.getTask(a);if(!u)throw new ae(pe.InternalError,`Task ${a} not found during polling`);c=u}return await n.taskStore.getTaskResult(a)}setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler(hi(hy)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(hy,async(e)=>{switch(e.params.ref.type){case"ref/prompt":return Nq(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return Uq(e),this.handleResourceCompletion(e,e.params.ref);default:throw new ae(pe.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion(e,t){let n=this._registeredPrompts[t.name];if(!n)throw new ae(pe.InvalidParams,`Prompt ${t.name} not found`);if(!n.enabled)throw new ae(pe.InvalidParams,`Prompt ${t.name} disabled`);if(!n.argsSchema)return Vf;let o=si(n.argsSchema)?.[e.params.argument.name];if(!AO(o))return Vf;let s=iZ(o);if(!s)return Vf;let i=await s(e.params.argument.value,e.params.context);return cZ(i)}async handleResourceCompletion(e,t){let n=Object.values(this._registeredResourceTemplates).find((s)=>s.resourceTemplate.uriTemplate.toString()===t.uri);if(!n){if(this._registeredResources[t.uri])return Vf;throw new ae(pe.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let r=n.resourceTemplate.completeCallback(e.params.argument.name);if(!r)return Vf;let o=await r(e.params.argument.value,e.params.context);return cZ(o)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler(hi(cy)),this.server.assertCanSetRequestHandler(hi(ly)),this.server.assertCanSetRequestHandler(hi(uy)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(cy,async(e,t)=>{let n=Object.entries(this._registeredResources).filter(([o,s])=>s.enabled).map(([o,s])=>({uri:o,name:s.name,...s.metadata})),r=[];for(let o of Object.values(this._registeredResourceTemplates)){if(!o.resourceTemplate.listCallback)continue;let s=await o.resourceTemplate.listCallback(t);for(let i of s.resources)r.push({...o.metadata,...i})}return{resources:[...n,...r]}}),this.server.setRequestHandler(ly,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([t,n])=>({name:t,uriTemplate:n.resourceTemplate.uriTemplate.toString(),...n.metadata}))})),this.server.setRequestHandler(uy,async(e,t)=>{let n=new URL(e.params.uri),r=this._registeredResources[n.toString()];if(r){if(!r.enabled)throw new ae(pe.InvalidParams,`Resource ${n} disabled`);return r.readCallback(n,t)}for(let o of Object.values(this._registeredResourceTemplates)){let s=o.resourceTemplate.uriTemplate.match(n.toString());if(s)return o.readCallback(n,s,t)}throw new ae(pe.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0}setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler(hi(dy)),this.server.assertCanSetRequestHandler(hi(py)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(dy,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>({name:e,title:t.title,description:t.description,arguments:t.argsSchema?nGe(t.argsSchema):void 0}))})),this.server.setRequestHandler(py,async(e,t)=>{let n=this._registeredPrompts[e.params.name];if(!n)throw new ae(pe.InvalidParams,`Prompt ${e.params.name} not found`);if(!n.enabled)throw new ae(pe.InvalidParams,`Prompt ${e.params.name} disabled`);if(n.argsSchema){let r=Kl(n.argsSchema),o=await W_(r,e.params.arguments);if(!o.success){let a="error"in o?o.error:"Unknown error",c=q_(a);throw new ae(pe.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${c}`)}let s=o.data,i=n.callback;return await Promise.resolve(i(s,t))}else{let r=n.callback;return await Promise.resolve(r(t))}}),this._promptHandlersInitialized=!0}resource(e,t,...n){let r;if(typeof n[0]==="object")r=n.shift();let o=n[0];if(typeof t==="string"){if(this._registeredResources[t])throw Error(`Resource ${t} is already registered`);let s=this._createRegisteredResource(e,void 0,t,r,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let s=this._createRegisteredResourceTemplate(e,void 0,t,r,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}registerResource(e,t,n,r){if(typeof t==="string"){if(this._registeredResources[t])throw Error(`Resource ${t} is already registered`);let o=this._createRegisteredResource(e,n.title,t,n,r);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let o=this._createRegisteredResourceTemplate(e,n.title,t,n,r);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}}_createRegisteredResource(e,t,n,r,o){let s={name:e,title:t,metadata:r,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({uri:null}),update:(i)=>{if(typeof i.uri<"u"&&i.uri!==n){if(delete this._registeredResources[n],i.uri)this._registeredResources[i.uri]=s}if(typeof i.name<"u")s.name=i.name;if(typeof i.title<"u")s.title=i.title;if(typeof i.metadata<"u")s.metadata=i.metadata;if(typeof i.callback<"u")s.readCallback=i.callback;if(typeof i.enabled<"u")s.enabled=i.enabled;this.sendResourceListChanged()}};return this._registeredResources[n]=s,s}_createRegisteredResourceTemplate(e,t,n,r,o){let s={resourceTemplate:n,title:t,metadata:r,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:(c)=>{if(typeof c.name<"u"&&c.name!==e){if(delete this._registeredResourceTemplates[e],c.name)this._registeredResourceTemplates[c.name]=s}if(typeof c.title<"u")s.title=c.title;if(typeof c.template<"u")s.resourceTemplate=c.template;if(typeof c.metadata<"u")s.metadata=c.metadata;if(typeof c.callback<"u")s.readCallback=c.callback;if(typeof c.enabled<"u")s.enabled=c.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=s;let i=n.uriTemplate.variableNames;if(Array.isArray(i)&&i.some((c)=>!!n.completeCallback(c)))this.setCompletionRequestHandler();return s}_createRegisteredPrompt(e,t,n,r,o){let s={title:t,description:n,argsSchema:r===void 0?void 0:va(r),callback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:(i)=>{if(typeof i.name<"u"&&i.name!==e){if(delete this._registeredPrompts[e],i.name)this._registeredPrompts[i.name]=s}if(typeof i.title<"u")s.title=i.title;if(typeof i.description<"u")s.description=i.description;if(typeof i.argsSchema<"u")s.argsSchema=va(i.argsSchema);if(typeof i.callback<"u")s.callback=i.callback;if(typeof i.enabled<"u")s.enabled=i.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[e]=s,r){if(Object.values(r).some((a)=>{let c=a instanceof fr?a._def?.innerType:a;return AO(c)}))this.setCompletionRequestHandler()}return s}_createRegisteredTool(e,t,n,r,o,s,i,a,c){TO(e);let l={title:t,description:n,inputSchema:aZ(r),outputSchema:aZ(o),annotations:s,execution:i,_meta:a,handler:c,enabled:!0,disable:()=>l.update({enabled:!1}),enable:()=>l.update({enabled:!0}),remove:()=>l.update({name:null}),update:(u)=>{if(typeof u.name<"u"&&u.name!==e){if(typeof u.name==="string")TO(u.name);if(delete this._registeredTools[e],u.name)this._registeredTools[u.name]=l}if(typeof u.title<"u")l.title=u.title;if(typeof u.description<"u")l.description=u.description;if(typeof u.paramsSchema<"u")l.inputSchema=va(u.paramsSchema);if(typeof u.outputSchema<"u")l.outputSchema=va(u.outputSchema);if(typeof u.callback<"u")l.handler=u.callback;if(typeof u.annotations<"u")l.annotations=u.annotations;if(typeof u._meta<"u")l._meta=u._meta;if(typeof u.enabled<"u")l.enabled=u.enabled;this.sendToolListChanged()}};return this._registeredTools[e]=l,this.setToolRequestHandlers(),this.sendToolListChanged(),l}tool(e,...t){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let n,r,o,s;if(typeof t[0]==="string")n=t.shift();if(t.length>1){let a=t[0];if(CO(a)){if(r=t.shift(),t.length>1&&typeof t[0]==="object"&&t[0]!==null&&!CO(t[0]))s=t.shift()}else if(typeof a==="object"&&a!==null){if(Object.values(a).some((c)=>typeof c==="object"&&c!==null))throw Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);s=t.shift()}}let i=t[0];return this._createRegisteredTool(e,void 0,n,r,o,s,{taskSupport:"forbidden"},void 0,i)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let{title:r,description:o,inputSchema:s,outputSchema:i,annotations:a,_meta:c}=t;return this._createRegisteredTool(e,r,o,s,i,a,{taskSupport:"forbidden"},c,n)}prompt(e,...t){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let n;if(typeof t[0]==="string")n=t.shift();let r;if(t.length>1)r=t.shift();let o=t[0],s=this._createRegisteredPrompt(e,void 0,n,r,o);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}registerPrompt(e,t,n){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let{title:r,description:o,argsSchema:s}=t,i=this._createRegisteredPrompt(e,r,o,s,n);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),i}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}}var tGe={type:"object",properties:{}};function lZ(e){return e!==null&&typeof e==="object"&&"parse"in e&&typeof e.parse==="function"&&"safeParse"in e&&typeof e.safeParse==="function"}function uZ(e){return"_def"in e||"_zod"in e||lZ(e)}function CO(e){if(typeof e!=="object"||e===null)return!1;if(uZ(e))return!1;if(Object.keys(e).length===0)return!0;return Object.values(e).some(lZ)}function aZ(e){if(!e)return;if(CO(e))return va(e);if(!uZ(e))throw Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return e}function nGe(e){let t=si(e);if(!t)return[];return Object.entries(t).map(([n,r])=>{let o=bq(r),s=Sq(r);return{name:n,description:o,required:!s}})}function hi(e){let n=si(e)?.method;if(!n)throw Error("Schema is missing a method literal");let r=V_(n);if(typeof r==="string")return r;throw Error("Schema method literal must be a string")}function cZ(e){return{completion:{values:e.slice(0,100),total:e.length,hasMore:e.length>100}}}var Vf={completion:{values:[],hasMore:!1}};function rGe(e,t,n,r,o){let s={};if(o?.searchHint)s["anthropic/searchHint"]=o.searchHint;if(o?.alwaysLoad)s["anthropic/alwaysLoad"]=!0;return{name:e,description:t,inputSchema:n,handler:r,annotations:o?.annotations,_meta:Object.keys(s).length>0?s:void 0}}function oGe(e){let t=new RO({name:e.name,version:e.version??"1.0.0"},{capabilities:{tools:e.tools?{}:void 0},instructions:e.instructions});if(e.tools)e.tools.forEach((n)=>{for(let r of Object.values(n.inputSchema)){if(!sGe(r))continue;let o=r.description;if(o&&!xr.has(r))xr.add(r,{description:o})}t.registerTool(n.name,{description:n.description,inputSchema:n.inputSchema,annotations:n.annotations,_meta:e.alwaysLoad?{"anthropic/alwaysLoad":!0,...n._meta}:n._meta},n.handler)});return{type:"sdk",name:e.name,instance:t}}function sGe(e){return typeof e==="object"&&e!==null&&"_zod"in e}var dZ=15000,iGe=D(()=>A({session_id:g(),ws_url:g(),work_dir:g().optional(),session_key:g().optional()}));class yo extends Error{code;constructor(e,t){super(e);this.name="DirectConnectError",this.code=t}}class fZ{options;ws;sessionId;workDir;abortController;readyState=!1;closed=!1;exitError;messages=new Jp;readyPromise;readyResolve;readyReject;abortHandler;partialChunks=[];telemetryEmitted=!1;constructor(e){this.options=e;this.abortController=e.abortController??new AbortController,this.readyPromise=new Promise((t,n)=>{this.readyResolve=t,this.readyReject=n}),this.readyPromise.catch(()=>{}),this.initialize()}get ready(){return this.readyPromise}getSessionId(){return this.sessionId}getWorkDir(){return this.workDir}async initialize(){if(this.abortController.signal.aborted){this.failInit(new or("Connection aborted"));return}this.abortHandler=()=>{this.close(),this.exitError=new or("Connection aborted by user")},this.abortController.signal.addEventListener("abort",this.abortHandler);let e;try{let o=await cGe(this.options);this.sessionId=o.sessionId,this.workDir=o.workDir,e=o.wsUrl}catch(o){let s=Or(o);if(!(s instanceof or)){let i=s instanceof yo&&s.code?s.code:"session_create_failed";this.emitTelemetry("bad",i)}this.failInit(s);return}if(this.closed){if(this.options.deleteSessionOnClose&&this.sessionId)pZ(this.options.serverUrl,this.sessionId,this.options.authToken);return}let t={};if(this.options.authToken)t.authorization=`Bearer ${this.options.authToken}`;let n=new WebSocket(e,{headers:t});this.ws=n;let r=setTimeout((o,s)=>{if(!o.readyState){s.close();let i=new yo(`WebSocket connection timeout after ${dZ}ms`);o.exitError=i,o.readyReject?.(i),o.emitTelemetry("bad","connect_timeout")}},dZ,this,n);n.addEventListener("open",()=>{clearTimeout(r),this.readyState=!0,ln(`[DirectConnectTransport] Connected to ${this.options.serverUrl}, session=${this.sessionId}`),this.readyResolve?.(),this.emitTelemetry("ok")}),n.addEventListener("message",(o)=>{let s=typeof o.data==="string"?o.data:"";if(s.indexOf(`
`)===-1){if(s)this.partialChunks.push(s);return}let i=this.partialChunks.join("")+s;this.partialChunks.length=0;let a=i.split(`
`),c=a.pop()??"";if(c)this.partialChunks.push(c);for(let l of a){if(!l)continue;let u;try{u=yt(l)}catch(p){ln(`DirectConnect: dropped malformed JSON line (${l.length} bytes): ${p}`);continue}this.messages.enqueue(u)}}),n.addEventListener("error",()=>{clearTimeout(r);let o=new yo("WebSocket connection error");if(this.exitError=o,this.readyReject?.(o),this.messages.done(),!this.readyState)this.emitTelemetry("bad","ws_error")}),n.addEventListener("close",(o)=>{let s=this.readyState;this.readyState=!1,this.closed=!0;let i=o.code!==1000&&o.code!==1001;if(i&&!this.exitError)this.exitError=new yo(`WebSocket closed abnormally: ${o.code} ${o.reason}`);if(this.messages.done(),s&&i&&!this.abortController.signal.aborted)this.emitTelemetry("sad","ws_closed_abnormally")})}emitTelemetry(e,t){if(this.telemetryEmitted)return;if(this.telemetryEmitted=!0,e==="ok")Pk("transport_direct_connect");else if(e==="bad")Ik("transport_direct_connect",t??"unknown");else OB("transport_direct_connect",t??"unknown")}failInit(e){this.exitError=e,this.closed=!0,this.readyReject?.(e),this.messages.done()}async write(e){if(this.abortController.signal.aborted)throw new or("Operation aborted");if(!this.readyState)await this.readyPromise;if(!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new yo("Transport is not ready for writing");this.ws.send(e)}isReady(){return this.readyState&&this.ws?.readyState===WebSocket.OPEN}endInput(){}[Symbol.dispose](){this.close()}close(){if(this.closed)return;if(this.closed=!0,this.readyState=!1,this.abortHandler)this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0;if(!this.abortController.signal.aborted)this.abortController.abort();if(this.ws&&this.ws.readyState===WebSocket.OPEN)this.ws.close(1000,"Normal closure");if(this.messages.done(),this.options.deleteSessionOnClose&&this.sessionId)pZ(this.options.serverUrl,this.sessionId,this.options.authToken)}async*readMessages(){if(yield*this.messages,this.exitError)throw this.exitError}}function aGe(e){if(e.startsWith("cc://")){let r=e.slice(5),o=new URL(`http://${r}`),s=o.pathname.slice(1)||void 0;return{serverUrl:`http://${o.host}`,authToken:s}}if(e.startsWith("cc+unix://"))throw new yo("Unix socket connect (cc+unix://) is not supported by the SDK transport");let t=/^https?:\/\//i.test(e)?e:`http://${e}`,n=new URL(t);return{serverUrl:`${n.protocol}//${n.host}`,authToken:void 0}}async function cGe(e){let t={"content-type":"application/json"};if(e.authToken)t.authorization=`Bearer ${e.authToken}`;let n={};if(e.cwd)n.cwd=e.cwd;if(e.sessionKey)n.session_key=e.sessionKey;if(e.permissionMode)n.permission_mode=e.permissionMode;let r;try{r=await fetch(`${e.serverUrl}/sessions`,{method:"POST",headers:t,body:fe(n)})}catch(s){throw new yo(`Failed to connect to server at ${e.serverUrl}: ${s instanceof Error?s.message:String(s)}`,"session_create_failed")}if(!r.ok){let s=await r.text().catch(()=>"");throw new yo(`Failed to create session: ${r.status} ${r.statusText}${s?` — ${s}`:""}`,"session_create_failed")}let o=iGe().safeParse(await r.json());if(!o.success)throw new yo(`Invalid session response: ${o.error.message}`,"session_create_invalid_response");return{sessionId:o.data.session_id,wsUrl:o.data.ws_url,workDir:o.data.work_dir}}async function pZ(e,t,n){let r={};if(n)r.authorization=`Bearer ${n}`;try{await fetch(`${e}/sessions/${t}`,{method:"DELETE",headers:r})}catch{}}import{resolve as a6e}from"path";import{join as wu}from"path";import{dirname as lGe}from"path";function hZ(){}async function uGe(e,t){let n=Xe();try{await n.appendFile(e,t)}catch{await n.mkdir(lGe(e)).catch(hZ),await n.appendFile(e,t)}}class gZ{pendingWrite=Promise.resolve();cleanupRegistered=!1;append(e,t){if(this.pendingWrite=this.pendingWrite.then(uGe.bind(null,e,t)).catch(hZ),!this.cleanupRegistered)this.cleanupRegistered=!0,Og(()=>this.flush())}flush(){return this.pendingWrite}}var dGe=new ft(()=>new gZ);function pGe(){return dGe.of(Nt().host)}function Zf(e,t,n){let r=mGe();if(!r)return;let o;try{o=mZ(e,t,fGe(n))}catch{o=mZ(e,t,{diagnostics_payload_failed:!0})}pGe().append(r,o)}function fGe(e){try{return(typeof e==="function"?e():e)??{}}catch{return{diagnostics_payload_failed:!0}}}function mZ(e,t,n){let r={timestamp:new Date().toISOString(),level:e,event:t,data:n};return fe(r)+`
`}function mGe(){return Cn.CLAUDE_CODE_DIAGNOSTICS_FILE}function _Z(e,t,n){let r=e.statSync(t);if(r.isDirectory())throw Object.assign(Error("EISDIR: illegal operation on a directory, read"),{code:"EISDIR",errno:-21,syscall:"read",path:t});if(!r.isFile())throw Object.assign(Error("Not a regular file (device, FIFO, or socket)"),{code:"ERR_NOT_REGULAR_FILE",path:t});if(n!==void 0&&r.size>n)throw Object.assign(Error("File exceeds maxBytes limit"),{code:"ERR_FILE_TOO_LARGE",path:t,size:r.size,maxBytes:n})}function hGe(e){if(e.byteLength===0)return"utf8";if(e.byteLength>=2){if(e[0]===255&&e[1]===254)return"utf16le"}if(e.byteLength>=3&&e[0]===239&&e[1]===187&&e[2]===191)return"utf8";return"utf8"}function yZ(e){let{buffer:t,bytesRead:n}=Xe().readSync(e,{length:4096});return hGe(t.subarray(0,n))}function bZ(e){let t=0,n=0;for(let r=0;r<e.length;r++)if(e[r]===`
`)if(r>0&&e[r-1]==="\r")t++;else n++;return t>n?"CRLF":"LF"}function gGe(e,t){let n=Xe(),{resolvedPath:r,isSymlink:o}=Tp(n,e);if(o)de(`Reading through symlink: ${e} -> ${r}`);_Z(n,r,t);let s=yZ(r),i=n.readFileSync(r,{encoding:s}),a=bZ(i.slice(0,4096));return{content:i.replaceAll(`\r
`,`
`),encoding:s,lineEndings:a}}function Pa(e,t){return gGe(e,t).content}async function SZ(e,t){let n=Xe(),{resolvedPath:r,isSymlink:o}=Tp(n,e);if(o)de(`Reading through symlink: ${e} -> ${r}`);_Z(n,r,t);let s=yZ(r),i=await n.readFile(r,{encoding:s}),a=bZ(i.slice(0,4096));return{content:i.replaceAll(`\r
`,`
`),encoding:s,lineEndings:a}}var EZ;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(EZ||(EZ={}));var yGe=Array(20).fill(0).map((e,t)=>" ".repeat(t));var bGe={" ":{"\n":Array(200).fill(0).map((e,t)=>`
`+" ".repeat(t)),"\r":Array(200).fill(0).map((e,t)=>"\r"+" ".repeat(t)),"\r\n":Array(200).fill(0).map((e,t)=>`\r
`+" ".repeat(t))},"\t":{"\n":Array(200).fill(0).map((e,t)=>`
`+"\t".repeat(t)),"\r":Array(200).fill(0).map((e,t)=>"\r"+"\t".repeat(t)),"\r\n":Array(200).fill(0).map((e,t)=>`\r
`+"\t".repeat(t))}};var vZ;(function(e){e.DEFAULT={allowTrailingComma:!1}})(vZ||(vZ={}));var wZ;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(wZ||(wZ={}));var AZ;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(AZ||(AZ={}));var TZ;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(TZ||(TZ={}));var lu=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date,CZ=new Set,OO=typeof process==="object"&&!!process?process:{},RZ=(e,t,n,r)=>{typeof OO.emitWarning==="function"?OO.emitWarning(e,t,n,r):console.error(`[${n}] ${t}: ${e}`)},nb=globalThis.AbortController,kZ=globalThis.AbortSignal;if(typeof nb>"u"){kZ=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(r,o){this._onabort.push(o)}},nb=class{constructor(){t()}signal=new kZ;abort(r){if(this.signal.aborted)return;this.signal.reason=r,this.signal.aborted=!0;for(let o of this.signal._onabort)o(r);this.signal.onabort?.(r)}};let e=OO.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{if(!e)return;e=!1,RZ("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t)}}var TGe=(e)=>!CZ.has(e),pOt=Symbol("type"),gi=(e)=>e&&e===Math.floor(e)&&e>0&&isFinite(e),OZ=(e)=>!gi(e)?null:e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?Yf:null;class Yf extends Array{constructor(e){super(e);this.fill(0)}}class uu{heap;length;static#e=!1;static create(e){let t=OZ(e);if(!t)return[];uu.#e=!0;let n=new uu(e,t);return uu.#e=!1,n}constructor(e,t){if(!uu.#e)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class rb{#e;#t;#n;#r;#i;#a;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#o;#l;#u;#c;#s;#d;#p;#f;#m;#S;#h;#b;#_;#y;#x;#A;#E;static unsafeExposeInternals(e){return{starts:e.#_,ttls:e.#y,sizes:e.#b,keyMap:e.#u,keyList:e.#c,valList:e.#s,next:e.#d,prev:e.#p,get head(){return e.#f},get tail(){return e.#m},free:e.#S,isBackgroundFetch:(t)=>e.#g(t),backgroundFetch:(t,n,r,o)=>e.#N(t,n,r,o),moveToTail:(t)=>e.#D(t),indexes:(t)=>e.#k(t),rindexes:(t)=>e.#C(t),isStale:(t)=>e.#w(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#l}get size(){return this.#o}get fetchMethod(){return this.#i}get memoMethod(){return this.#a}get dispose(){return this.#n}get disposeAfter(){return this.#r}constructor(e){let{max:t=0,ttl:n,ttlResolution:r=1,ttlAutopurge:o,updateAgeOnGet:s,updateAgeOnHas:i,allowStale:a,dispose:c,disposeAfter:l,noDisposeOnSet:u,noUpdateTTL:p,maxSize:f=0,maxEntrySize:m=0,sizeCalculation:h,fetchMethod:_,memoMethod:y,noDeleteOnFetchRejection:S,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:v,ignoreFetchAbort:T}=e;if(t!==0&&!gi(t))throw TypeError("max option must be a nonnegative integer");let U=t?OZ(t):Array;if(!U)throw Error("invalid max value: "+t);if(this.#e=t,this.#t=f,this.maxEntrySize=m||this.#t,this.sizeCalculation=h,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!=="function")throw TypeError("sizeCalculation set to non-function")}if(y!==void 0&&typeof y!=="function")throw TypeError("memoMethod must be a function if defined");if(this.#a=y,_!==void 0&&typeof _!=="function")throw TypeError("fetchMethod must be a function if specified");if(this.#i=_,this.#A=!!_,this.#u=new Map,this.#c=Array(t).fill(void 0),this.#s=Array(t).fill(void 0),this.#d=new U(t),this.#p=new U(t),this.#f=0,this.#m=0,this.#S=uu.create(t),this.#o=0,this.#l=0,typeof c==="function")this.#n=c;if(typeof l==="function")this.#r=l,this.#h=[];else this.#r=void 0,this.#h=void 0;if(this.#x=!!this.#n,this.#E=!!this.#r,this.noDisposeOnSet=!!u,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!S,this.allowStaleOnFetchRejection=!!x,this.allowStaleOnFetchAbort=!!v,this.ignoreFetchAbort=!!T,this.maxEntrySize!==0){if(this.#t!==0){if(!gi(this.#t))throw TypeError("maxSize must be a positive integer if specified")}if(!gi(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#j()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!i,this.ttlResolution=gi(r)||r===0?r:1,this.ttlAutopurge=!!o,this.ttl=n||0,this.ttl){if(!gi(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#O()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){if(TGe("LRU_CACHE_UNBOUNDED"))CZ.add("LRU_CACHE_UNBOUNDED"),RZ("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",rb)}}getRemainingTTL(e){return this.#u.has(e)?1/0:0}#O(){let e=new Yf(this.#e),t=new Yf(this.#e);this.#y=e,this.#_=t,this.#P=(o,s,i=lu.now())=>{if(t[o]=s!==0?i:0,e[o]=s,s!==0&&this.ttlAutopurge){let a=setTimeout(()=>{if(this.#w(o))this.#R(this.#c[o],"expire")},s+1);if(a.unref)a.unref()}},this.#T=(o)=>{t[o]=e[o]!==0?lu.now():0},this.#v=(o,s)=>{if(e[s]){let i=e[s],a=t[s];if(!i||!a)return;o.ttl=i,o.start=a,o.now=n||r();let c=o.now-a;o.remainingTTL=i-c}};let n=0,r=()=>{let o=lu.now();if(this.ttlResolution>0){n=o;let s=setTimeout(()=>n=0,this.ttlResolution);if(s.unref)s.unref()}return o};this.getRemainingTTL=(o)=>{let s=this.#u.get(o);if(s===void 0)return 0;let i=e[s],a=t[s];if(!i||!a)return 1/0;let c=(n||r())-a;return i-c},this.#w=(o)=>{let s=t[o],i=e[o];return!!i&&!!s&&(n||r())-s>i}}#T=()=>{};#v=()=>{};#P=()=>{};#w=()=>!1;#j(){let e=new Yf(this.#e);this.#l=0,this.#b=e,this.#I=(t)=>{this.#l-=e[t],e[t]=0},this.#U=(t,n,r,o)=>{if(this.#g(n))return 0;if(!gi(r))if(o){if(typeof o!=="function")throw TypeError("sizeCalculation must be a function");if(r=o(n,t),!gi(r))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.#L=(t,n,r)=>{if(e[t]=n,this.#t){let o=this.#t-e[t];while(this.#l>o)this.#M(!0)}if(this.#l+=e[t],r)r.entrySize=n,r.totalCalculatedSize=this.#l}}#I=(e)=>{};#L=(e,t,n)=>{};#U=(e,t,n,r)=>{if(n||r)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#k({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#m;;){if(!this.#F(t))break;if(e||!this.#w(t))yield t;if(t===this.#f)break;else t=this.#p[t]}}*#C({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#f;;){if(!this.#F(t))break;if(e||!this.#w(t))yield t;if(t===this.#m)break;else t=this.#d[t]}}#F(e){return e!==void 0&&this.#u.get(this.#c[e])===e}*entries(){for(let e of this.#k())if(this.#s[e]!==void 0&&this.#c[e]!==void 0&&!this.#g(this.#s[e]))yield[this.#c[e],this.#s[e]]}*rentries(){for(let e of this.#C())if(this.#s[e]!==void 0&&this.#c[e]!==void 0&&!this.#g(this.#s[e]))yield[this.#c[e],this.#s[e]]}*keys(){for(let e of this.#k()){let t=this.#c[e];if(t!==void 0&&!this.#g(this.#s[e]))yield t}}*rkeys(){for(let e of this.#C()){let t=this.#c[e];if(t!==void 0&&!this.#g(this.#s[e]))yield t}}*values(){for(let e of this.#k())if(this.#s[e]!==void 0&&!this.#g(this.#s[e]))yield this.#s[e]}*rvalues(){for(let e of this.#C())if(this.#s[e]!==void 0&&!this.#g(this.#s[e]))yield this.#s[e]}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let n of this.#k()){let r=this.#s[n],o=this.#g(r)?r.__staleWhileFetching:r;if(o===void 0)continue;if(e(o,this.#c[n],this))return this.get(this.#c[n],t)}}forEach(e,t=this){for(let n of this.#k()){let r=this.#s[n],o=this.#g(r)?r.__staleWhileFetching:r;if(o===void 0)continue;e.call(t,o,this.#c[n],this)}}rforEach(e,t=this){for(let n of this.#C()){let r=this.#s[n],o=this.#g(r)?r.__staleWhileFetching:r;if(o===void 0)continue;e.call(t,o,this.#c[n],this)}}purgeStale(){let e=!1;for(let t of this.#C({allowStale:!0}))if(this.#w(t))this.#R(this.#c[t],"expire"),e=!0;return e}info(e){let t=this.#u.get(e);if(t===void 0)return;let n=this.#s[t],r=this.#g(n)?n.__staleWhileFetching:n;if(r===void 0)return;let o={value:r};if(this.#y&&this.#_){let s=this.#y[t],i=this.#_[t];if(s&&i){let a=s-(lu.now()-i);o.ttl=a,o.start=Date.now()}}if(this.#b)o.size=this.#b[t];return o}dump(){let e=[];for(let t of this.#k({allowStale:!0})){let n=this.#c[t],r=this.#s[t],o=this.#g(r)?r.__staleWhileFetching:r;if(o===void 0||n===void 0)continue;let s={value:o};if(this.#y&&this.#_){s.ttl=this.#y[t];let i=lu.now()-this.#_[t];s.start=Math.floor(Date.now()-i)}if(this.#b)s.size=this.#b[t];e.unshift([n,s])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let r=Date.now()-n.start;n.start=lu.now()-r}this.set(t,n.value,n)}}set(e,t,n={}){if(t===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:o,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:i=this.sizeCalculation,status:a}=n,{noUpdateTTL:c=this.noUpdateTTL}=n,l=this.#U(e,t,n.size||0,i);if(this.maxEntrySize&&l>this.maxEntrySize){if(a)a.set="miss",a.maxEntrySizeExceeded=!0;return this.#R(e,"set"),this}let u=this.#o===0?void 0:this.#u.get(e);if(u===void 0){if(u=this.#o===0?this.#m:this.#S.length!==0?this.#S.pop():this.#o===this.#e?this.#M(!1):this.#o,this.#c[u]=e,this.#s[u]=t,this.#u.set(e,u),this.#d[this.#m]=u,this.#p[u]=this.#m,this.#m=u,this.#o++,this.#L(u,l,a),a)a.set="add";c=!1}else{this.#D(u);let p=this.#s[u];if(t!==p){if(this.#A&&this.#g(p)){p.__abortController.abort(Error("replaced"));let{__staleWhileFetching:f}=p;if(f!==void 0&&!s){if(this.#x)this.#n?.(f,e,"set");if(this.#E)this.#h?.push([f,e,"set"])}}else if(!s){if(this.#x)this.#n?.(p,e,"set");if(this.#E)this.#h?.push([p,e,"set"])}if(this.#I(u),this.#L(u,l,a),this.#s[u]=t,a){a.set="replace";let f=p&&this.#g(p)?p.__staleWhileFetching:p;if(f!==void 0)a.oldValue=f}}else if(a)a.set="update"}if(r!==0&&!this.#y)this.#O();if(this.#y){if(!c)this.#P(u,r,o);if(a)this.#v(a,u)}if(!s&&this.#E&&this.#h){let p=this.#h,f;while(f=p?.shift())this.#r?.(...f)}return this}pop(){try{while(this.#o){let e=this.#s[this.#f];if(this.#M(!0),this.#g(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#E&&this.#h){let e=this.#h,t;while(t=e?.shift())this.#r?.(...t)}}}#M(e){let t=this.#f,n=this.#c[t],r=this.#s[t];if(this.#A&&this.#g(r))r.__abortController.abort(Error("evicted"));else if(this.#x||this.#E){if(this.#x)this.#n?.(r,n,"evict");if(this.#E)this.#h?.push([r,n,"evict"])}if(this.#I(t),e)this.#c[t]=void 0,this.#s[t]=void 0,this.#S.push(t);if(this.#o===1)this.#f=this.#m=0,this.#S.length=0;else this.#f=this.#d[t];return this.#u.delete(n),this.#o--,t}has(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=t,o=this.#u.get(e);if(o!==void 0){let s=this.#s[o];if(this.#g(s)&&s.__staleWhileFetching===void 0)return!1;if(!this.#w(o)){if(n)this.#T(o);if(r)r.has="hit",this.#v(r,o);return!0}else if(r)r.has="stale",this.#v(r,o)}else if(r)r.has="miss";return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,r=this.#u.get(e);if(r===void 0||!n&&this.#w(r))return;let o=this.#s[r];return this.#g(o)?o.__staleWhileFetching:o}#N(e,t,n,r){let o=t===void 0?void 0:this.#s[t];if(this.#g(o))return o;let s=new nb,{signal:i}=n;i?.addEventListener("abort",()=>s.abort(i.reason),{signal:s.signal});let a={signal:s.signal,options:n,context:r},c=(h,_=!1)=>{let{aborted:y}=s.signal,S=n.ignoreFetchAbort&&h!==void 0;if(n.status)if(y&&!_){if(n.status.fetchAborted=!0,n.status.fetchError=s.signal.reason,S)n.status.fetchAbortIgnored=!0}else n.status.fetchResolved=!0;if(y&&!S&&!_)return u(s.signal.reason);let b=f;if(this.#s[t]===f)if(h===void 0)if(b.__staleWhileFetching)this.#s[t]=b.__staleWhileFetching;else this.#R(e,"fetch");else{if(n.status)n.status.fetchUpdated=!0;this.set(e,h,a.options)}return h},l=(h)=>{if(n.status)n.status.fetchRejected=!0,n.status.fetchError=h;return u(h)},u=(h)=>{let{aborted:_}=s.signal,y=_&&n.allowStaleOnFetchAbort,S=y||n.allowStaleOnFetchRejection,b=S||n.noDeleteOnFetchRejection,x=f;if(this.#s[t]===f){if(!b||x.__staleWhileFetching===void 0)this.#R(e,"fetch");else if(!y)this.#s[t]=x.__staleWhileFetching}if(S){if(n.status&&x.__staleWhileFetching!==void 0)n.status.returnedStale=!0;return x.__staleWhileFetching}else if(x.__returned===x)throw h},p=(h,_)=>{let y=this.#i?.(e,o,a);if(y&&y instanceof Promise)y.then((S)=>h(S===void 0?void 0:S),_);s.signal.addEventListener("abort",()=>{if(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort){if(h(void 0),n.allowStaleOnFetchAbort)h=(S)=>c(S,!0)}})};if(n.status)n.status.fetchDispatched=!0;let f=new Promise(p).then(c,l),m=Object.assign(f,{__abortController:s,__staleWhileFetching:o,__returned:void 0});if(t===void 0)this.set(e,m,{...a.options,status:void 0}),t=this.#u.get(e);else this.#s[t]=m;return m}#g(e){if(!this.#A)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof nb}async fetch(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:i=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:h,forceRefresh:_=!1,status:y,signal:S}=t;if(!this.#A){if(y)y.fetch="get";return this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:o,status:y})}let b={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:o,ttl:s,noDisposeOnSet:i,size:a,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:m,ignoreFetchAbort:f,status:y,signal:S},x=this.#u.get(e);if(x===void 0){if(y)y.fetch="miss";let v=this.#N(e,x,b,h);return v.__returned=v}else{let v=this.#s[x];if(this.#g(v)){let W=n&&v.__staleWhileFetching!==void 0;if(y){if(y.fetch="inflight",W)y.returnedStale=!0}return W?v.__staleWhileFetching:v.__returned=v}let T=this.#w(x);if(!_&&!T){if(y)y.fetch="hit";if(this.#D(x),r)this.#T(x);if(y)this.#v(y,x);return v}let U=this.#N(e,x,b,h),F=U.__staleWhileFetching!==void 0&&n;if(y){if(y.fetch=T?"stale":"refresh",F&&T)y.returnedStale=!0}return F?U.__staleWhileFetching:U.__returned=U}}async forceFetch(e,t={}){let n=await this.fetch(e,t);if(n===void 0)throw Error("fetch() returned undefined");return n}memo(e,t={}){let n=this.#a;if(!n)throw Error("no memoMethod provided to constructor");let{context:r,forceRefresh:o,...s}=t,i=this.get(e,s);if(!o&&i!==void 0)return i;let a=n(e,i,{options:s,context:r});return this.set(e,a,s),a}get(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:s}=t,i=this.#u.get(e);if(i!==void 0){let a=this.#s[i],c=this.#g(a);if(s)this.#v(s,i);if(this.#w(i)){if(s)s.get="stale";if(!c){if(!o)this.#R(e,"expire");if(s&&n)s.returnedStale=!0;return n?a:void 0}else{if(s&&n&&a.__staleWhileFetching!==void 0)s.returnedStale=!0;return n?a.__staleWhileFetching:void 0}}else{if(s)s.get="hit";if(c)return a.__staleWhileFetching;if(this.#D(i),r)this.#T(i);return a}}else if(s)s.get="miss"}#z(e,t){this.#p[t]=e,this.#d[e]=t}#D(e){if(e!==this.#m){if(e===this.#f)this.#f=this.#d[e];else this.#z(this.#p[e],this.#d[e]);this.#z(this.#m,e),this.#m=e}}delete(e){return this.#R(e,"delete")}#R(e,t){let n=!1;if(this.#o!==0){let r=this.#u.get(e);if(r!==void 0)if(n=!0,this.#o===1)this.#$(t);else{this.#I(r);let o=this.#s[r];if(this.#g(o))o.__abortController.abort(Error("deleted"));else if(this.#x||this.#E){if(this.#x)this.#n?.(o,e,t);if(this.#E)this.#h?.push([o,e,t])}if(this.#u.delete(e),this.#c[r]=void 0,this.#s[r]=void 0,r===this.#m)this.#m=this.#p[r];else if(r===this.#f)this.#f=this.#d[r];else{let s=this.#p[r];this.#d[s]=this.#d[r];let i=this.#d[r];this.#p[i]=this.#p[r]}this.#o--,this.#S.push(r)}}if(this.#E&&this.#h?.length){let r=this.#h,o;while(o=r?.shift())this.#r?.(...o)}return n}clear(){return this.#$("delete")}#$(e){for(let t of this.#C({allowStale:!0})){let n=this.#s[t];if(this.#g(n))n.__abortController.abort(Error("deleted"));else{let r=this.#c[t];if(this.#x)this.#n?.(n,r,e);if(this.#E)this.#h?.push([n,r,e])}}if(this.#u.clear(),this.#s.fill(void 0),this.#c.fill(void 0),this.#y&&this.#_)this.#y.fill(0),this.#_.fill(0);if(this.#b)this.#b.fill(0);if(this.#f=0,this.#m=0,this.#S.length=0,this.#l=0,this.#o=0,this.#E&&this.#h){let t=this.#h,n;while(n=t?.shift())this.#r?.(...n)}}}function PZ(e,t,n=100){let r=new rb({max:n}),o=(...s)=>{let i=t(...s),a=r.get(i);if(a!==void 0)return a;let c=e(...s);return r.set(i,c),c};return o.cache={clear:()=>r.clear(),size:()=>r.size,delete:(s)=>r.delete(s),get:(s)=>r.peek(s),has:(s)=>r.has(s),set:(s,i)=>void r.set(s,i)},o}var kGe=8192;function DZ(e,t){try{return{ok:!0,value:JSON.parse(Nl(e))}}catch(n){if(t)Pg(qN(n,`safeParseJSON: invalid JSON (${n instanceof Error?n.constructor.name:typeof n}, ${e.length} bytes)`));return{ok:!1}}}class LZ{cached=PZ(DZ,(e)=>e,50);cache=this.cached.cache;parse(e,t){return this.cached(e,t)}}var IZ=new LZ;var Ia=Object.assign(function(t,n=!0){if(!t)return null;let r=t.length>kGe?DZ(t,n):IZ.parse(t,n);return r.ok?r.value:null},{cache:IZ.cache});import{join as CGe}from"path";class MZ{managedFilePath=void 0;dropInDir=void 0;getManagedFilePath(){return this.managedFilePath??=OGe(),this.managedFilePath}getDropInDir(){return this.dropInDir??=CGe(Da(),"managed-settings.d"),this.dropInDir}clearDropInDir(){this.dropInDir=void 0}reset(){this.managedFilePath=void 0,this.dropInDir=void 0}}var RGe=new MZ;function Da(){return RGe.getManagedFilePath()}function OGe(){switch(rs()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}var PGe=function(){try{var e=Dn(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),du=PGe;function IGe(e,t,n){if(t=="__proto__"&&du)du(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0});else e[t]=n}var pu=IGe;function DGe(e,t,n){if(n!==void 0&&!xo(e[t],n)||n===void 0&&!(t in e))pu(e,t,n)}var Jf=DGe;function LGe(e){return function(t,n,r){var o=-1,s=Object(t),i=r(t),a=i.length;while(a--){var c=i[e?a:++o];if(n(s[c],c,s)===!1)break}return t}}var NZ=LGe;var MGe=NZ(),UZ=MGe;var sb={};Xt(sb,{default:()=>PO});var jZ=typeof sb=="object"&&sb&&!sb.nodeType&&sb,FZ=jZ&&typeof ob=="object"&&ob&&!ob.nodeType&&ob,NGe=FZ&&FZ.exports===jZ,zZ=NGe?$t.Buffer:void 0,$Z=zZ?zZ.allocUnsafe:void 0;function UGe(e,t){if(t)return e.slice();var n=e.length,r=$Z?$Z(n):new e.constructor(n);return e.copy(r),r}var PO=UGe;function FGe(e){var t=new e.constructor(e.byteLength);return new Nc(t).set(new Nc(e)),t}var HZ=FGe;function zGe(e,t){var n=t?HZ(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var BZ=zGe;function $Ge(e,t){var n=-1,r=e.length;t||(t=Array(r));while(++n<r)t[n]=e[n];return t}var KZ=$Ge;var GZ=Object.create,jGe=function(){function e(){}return function(t){if(!Kt(t))return{};if(GZ)return GZ(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),WZ=jGe;var HGe=dg(Object.getPrototypeOf,Object),fu=HGe;function BGe(e){return typeof e.constructor=="function"&&!$c(e)?WZ(fu(e)):{}}var qZ=BGe;function KGe(e){return kn(e)&&Hs(e)}var VZ=KGe;var GGe="[object Object]",WGe=Function.prototype,qGe=Object.prototype,ZZ=WGe.toString,VGe=qGe.hasOwnProperty,ZGe=ZZ.call(Object);function YGe(e){if(!kn(e)||sr(e)!=GGe)return!1;var t=fu(e);if(t===null)return!0;var n=VGe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&ZZ.call(n)==ZGe}var YZ=YGe;function JGe(e,t){if(t==="constructor"&&typeof e[t]==="function")return;if(t=="__proto__")return;return e[t]}var Xf=JGe;var XGe=Object.prototype,QGe=XGe.hasOwnProperty;function eWe(e,t,n){var r=e[t];if(!(QGe.call(e,t)&&xo(r,n))||n===void 0&&!(t in e))pu(e,t,n)}var ib=eWe;function tWe(e,t,n,r){var o=!n;n||(n={});var s=-1,i=t.length;while(++s<i){var a=t[s],c=r?r(n[a],e[a],a,n,e):void 0;if(c===void 0)c=e[a];if(o)pu(n,a,c);else ib(n,a,c)}return n}var JZ=tWe;function nWe(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var XZ=nWe;var rWe=Object.prototype,oWe=rWe.hasOwnProperty;function sWe(e){if(!Kt(e))return XZ(e);var t=$c(e),n=[];for(var r in e)if(!(r=="constructor"&&(t||!oWe.call(e,r))))n.push(r);return n}var QZ=sWe;function iWe(e){return Hs(e)?ug(e,!0):QZ(e)}var mu=iWe;function aWe(e){return JZ(e,mu(e))}var e5=aWe;function cWe(e,t,n,r,o,s,i){var a=Xf(e,n),c=Xf(t,n),l=i.get(c);if(l){Jf(e,n,l);return}var u=s?s(a,c,n+"",e,t,i):void 0,p=u===void 0;if(p){var f=Ot(c),m=!f&&$s(c),h=!f&&!m&&zc(c);if(u=c,f||m||h)if(Ot(a))u=a;else if(VZ(a))u=KZ(a);else if(m)p=!1,u=PO(c,!0);else if(h)p=!1,u=BZ(c,!0);else u=[];else if(YZ(c)||Xo(c)){if(u=a,Xo(a))u=e5(a);else if(!Kt(a)||Wa(a))u=qZ(c)}else p=!1}if(p)i.set(c,u),o(u,c,r,s,i),i.delete(c);Jf(e,n,u)}var t5=cWe;function n5(e,t,n,r,o){if(e===t)return;UZ(t,function(s,i){if(o||(o=new zs),Kt(s))t5(e,t,i,n,n5,r,o);else{var a=r?r(Xf(e,i),s,i+"",e,t,o):void 0;if(a===void 0)a=s;Jf(e,i,a)}},mu)}var r5=n5;function lWe(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var o5=lWe;var s5=Math.max;function uWe(e,t,n){return t=s5(t===void 0?e.length-1:t,0),function(){var r=arguments,o=-1,s=s5(r.length-t,0),i=Array(s);while(++o<s)i[o]=r[t+o];o=-1;var a=Array(t+1);while(++o<t)a[o]=r[o];return a[t]=n(i),o5(e,this,a)}}var ab=uWe;function dWe(e){return function(){return e}}var i5=dWe;var pWe=!du?Gc:function(e,t){return du(e,"toString",{configurable:!0,enumerable:!1,value:i5(t),writable:!0})},a5=pWe;var fWe=800,mWe=16,hWe=Date.now;function gWe(e){var t=0,n=0;return function(){var r=hWe(),o=mWe-(r-n);if(n=r,o>0){if(++t>=fWe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var c5=gWe;var _We=c5(a5),cb=_We;function yWe(e,t){return cb(ab(e,t,Gc),e+"")}var l5=yWe;function bWe(e,t,n){if(!Kt(n))return!1;var r=typeof t;if(r=="number"?Hs(n)&&js(t,n.length):r=="string"&&(t in n))return xo(n[t],e);return!1}var u5=bWe;function SWe(e){return l5(function(t,n){var r=-1,o=n.length,s=o>1?n[o-1]:void 0,i=o>2?n[2]:void 0;if(s=e.length>3&&typeof s=="function"?(o--,s):void 0,i&&u5(n[0],n[1],i))s=o<3?void 0:s,o=1;t=Object(t);while(++r<o){var a=n[r];if(a)e(t,a,r,s)}return t})}var d5=SWe;var EWe=d5(function(e,t,n,r){r5(e,t,n,r)}),bo=EWe;function xWe(e,t,n,r){if(!Kt(e))return e;t=Bs(t,e);var o=-1,s=t.length,i=s-1,a=e;while(a!=null&&++o<s){var c=Po(t[o]),l=n;if(c==="__proto__"||c==="constructor"||c==="prototype")return e;if(o!=i){var u=a[c];if(l=r?r(u,c,a):void 0,l===void 0)l=Kt(u)?u:js(t[o+1])?[]:{}}ib(a,c,l),a=a[c]}return e}var p5=xWe;function vWe(e,t,n){var r=-1,o=t.length,s={};while(++r<o){var i=t[r],a=Kc(e,i);if(n(a,i))p5(s,Bs(i,e),a)}return s}var lb=vWe;function wWe(e,t){return lb(e,t,function(n,r){return xg(e,r)})}var f5=wWe;var m5=vn?vn.isConcatSpreadable:void 0;function AWe(e){return Ot(e)||Xo(e)||!!(m5&&e&&e[m5])}var h5=AWe;function g5(e,t,n,r,o){var s=-1,i=e.length;n||(n=h5),o||(o=[]);while(++s<i){var a=e[s];if(t>0&&n(a))if(t>1)g5(a,t-1,n,r,o);else Uc(o,a);else if(!r)o[o.length]=a}return o}var _5=g5;function TWe(e){var t=e==null?0:e.length;return t?_5(e,1):[]}var y5=TWe;function kWe(e){return cb(ab(e,void 0,y5),e+"")}var b5=kWe;var CWe=b5(function(e,t){return e==null?{}:f5(e,t)}),ub=CWe;import{homedir as w4e}from"os";import{dirname as A4e,join as So,resolve as Fr}from"path";var RWe="Expected a function";function OWe(e){if(typeof e!="function")throw TypeError(RWe);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}var S5=OWe;var PWe=Object.getOwnPropertySymbols,IWe=!PWe?rg:function(e){var t=[];while(e)Uc(t,og(e)),e=fu(e);return t},E5=IWe;function DWe(e){return ng(e,mu,E5)}var x5=DWe;function LWe(e,t){if(e==null)return{};var n=Eg(x5(e),function(r){return[r]});return t=Wc(t),lb(e,n,function(r,o){return t(r,o[0])})}var v5=LWe;function MWe(e,t){return v5(e,S5(Wc(t)))}var Qf=MWe;function Qn(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var em=[{alias:"additionalMarketplaces",canonical:"extraKnownMarketplaces"},{alias:"allowedMarketplaces",canonical:"strictKnownMarketplaces"}];function w5(e,t){if(!Qn(e))return[];let n=[];for(let{alias:r,canonical:o}of em){if(!(r in e))continue;if(o in e&&e[o]!==null)n.push({file:t,path:r,message:`"${r}" is an alias for "${o}" and this file sets both; the "${r}" value was ignored. Use only "${o}".`,severity:"warning",alias:r,canonical:o});else e[o]=e[r];delete e[r]}return n}import{join as VY}from"path";var IO=["CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_VERTEX","CLAUDE_CODE_USE_FOUNDRY","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD","CLAUDE_CODE_USE_MANTLE","CLAUDE_CODE_USE_GATEWAY","ANTHROPIC_FOUNDRY_RESOURCE","ANTHROPIC_VERTEX_PROJECT_ID","ANTHROPIC_AWS_WORKSPACE_ID","ANTHROPIC_GOOGLE_CLOUD_PROJECT","ANTHROPIC_GOOGLE_CLOUD_LOCATION","ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID","CLOUD_ML_REGION"],A5=["CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_MANTLE"];var T5="OTEL_EXPORTER_OTLP_",k5=["OTEL_LOG_RAW_API_BODIES","OTEL_LOG_USER_PROMPTS","OTEL_LOG_ASSISTANT_RESPONSES","OTEL_LOG_TOOL_CONTENT","OTEL_LOG_TOOL_DETAILS","OTEL_LOGS_EXPORTER","ENABLE_BETA_TRACING_DETAILED","BETA_TRACING_ENDPOINT","ANT_OTEL_LOGS_EXPORTER"],C5=[T5,`ANT_${T5}`],R5={apiKeyHelper:["ANTHROPIC_BASE_URL","_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL"],awsAuthRefresh:[...A5,"ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_AWS_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL"],awsCredentialExport:[...A5,"ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_AWS_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL"],gcpAuthRefresh:["CLAUDE_CODE_USE_VERTEX","CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD","ANTHROPIC_VERTEX_BASE_URL","ANTHROPIC_GOOGLE_CLOUD_BASE_URL"]},NWe=["CLAUDE_CODE_MEMORY_API_BASE_URL","CLAUDE_CODE_MEMORY_API_TOKEN"];var DO=["ANTHROPIC_BASE_URL","_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL","ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_VERTEX_BASE_URL","ANTHROPIC_FOUNDRY_BASE_URL","ANTHROPIC_AWS_BASE_URL","ANTHROPIC_GOOGLE_CLOUD_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL","CLAUDE_CODE_ARTIFACTS_API_BASE_URL","CLAUDE_CODE_ARTIFACTS_API_TOKEN","CLAUDE_CODE_ARTIFACT_ASSET_BASE_URL","CLAUDE_CODE_ARTIFACT_LIVE_BASE_URL","CLAUDE_CODE_ARTIFACT_SYNC_BASE_URL","CLAUDE_CODE_ARTIFACT_VIEWER_BASE_URL",...NWe];var LO=["ANTHROPIC_API_KEY","ANTHROPIC_AUTH_TOKEN","CLAUDE_CODE_OAUTH_TOKEN","AWS_BEARER_TOKEN_BEDROCK","ANTHROPIC_FOUNDRY_API_KEY","ANTHROPIC_FOUNDRY_AUTH_TOKEN","ANTHROPIC_AWS_API_KEY"],UWe=["CLAUDE_CODE_SKIP_BEDROCK_AUTH","CLAUDE_CODE_SKIP_VERTEX_AUTH","CLAUDE_CODE_SKIP_FOUNDRY_AUTH","CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH","CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH","CLAUDE_CODE_SKIP_MANTLE_AUTH"],MO=["ANTHROPIC_MODEL","ANTHROPIC_DEFAULT_MODEL","ANTHROPIC_DEFAULT_FABLE_MODEL","ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_FABLE_MODEL_NAME","ANTHROPIC_DEFAULT_FABLE_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_HAIKU_MODEL","ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME","ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_OPUS_MODEL","ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_OPUS_MODEL_NAME","ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_SONNET_MODEL","ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_SONNET_MODEL_NAME","ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_SMALL_FAST_MODEL","ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION","CLAUDE_CODE_SUBAGENT_MODEL","CLAUDE_CODE_3P_PROBE_WROTE_SONNET_DEFAULT","CLAUDE_CODE_3P_PROBE_WROTE_OPUS_DEFAULT"],NO=["ANTHROPIC_CUSTOM_MODEL_OPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_NAME","ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES"],FWe=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"],UO=[...FWe,"AWS_PROFILE","AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE","GOOGLE_APPLICATION_CREDENTIALS","GOOGLE_CLOUD_PROJECT"];var FO=["AWS_CONTAINER_CREDENTIALS_FULL_URI","AWS_CONTAINER_CREDENTIALS_RELATIVE_URI","AWS_CONTAINER_AUTHORIZATION_TOKEN","AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE","AWS_EC2_METADATA_SERVICE_ENDPOINT","AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE","AWS_WEB_IDENTITY_TOKEN_FILE","AWS_ROLE_ARN"],zO=["GCE_METADATA_HOST","GCE_METADATA_IP","METADATA_SERVER_DETECTION"],kDt=new Set(["CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST",...IO,...DO,...LO,...UWe,"CLAUDE_CODE_HOST_AUTH_ENV_VAR","CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH","CLAUDE_CODE_HOST_AUTH_REFRESH_TIMEOUT_MS","CLAUDE_CODE_HOST_CREDS_FILE",...UO,"GCLOUD_PROJECT","GOOGLE_CLOUD_QUOTA_PROJECT",...zO,...FO,"AWS_REGION","AWS_DEFAULT_REGION",...MO,"ANTHROPIC_BEDROCK_SERVICE_TIER","ANTHROPIC_BEDROCK_REGION_PREFIX","CLAUDE_CODE_CERT_STORE","DISABLE_GROWTHBOOK","CLAUDE_CODE_AUTO_MODE_MODEL","CLAUDE_CODE_BG_CLASSIFIER_MODEL","CLAUDE_CONTEXT_COLLAPSE_MODEL",...NO]);var O5=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","fileSuggestion","gcpAuthRefresh","otelHeadersHelper","processWrapper","policyHelpers","proxyAuthHelper","statusLine","subagentStatusLine"],P5=["bwrapPath","ripgrep","socatPath"],zWe=new Set(["ANTHROPIC_BEDROCK_REGION_PREFIX","ANTHROPIC_BEDROCK_SERVICE_TIER","ANTHROPIC_CUSTOM_HEADERS","ANTHROPIC_CUSTOM_MODEL_OPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION","ANTHROPIC_CUSTOM_MODEL_OPTION_NAME","ANTHROPIC_CUSTOM_MODEL_OPTION_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_FABLE_MODEL","ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_FABLE_MODEL_NAME","ANTHROPIC_DEFAULT_FABLE_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_MODEL","ANTHROPIC_DEFAULT_HAIKU_MODEL","ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME","ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_OPUS_MODEL","ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_OPUS_MODEL_NAME","ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_SONNET_MODEL","ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_SONNET_MODEL_NAME","ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_FOUNDRY_API_KEY","ANTHROPIC_MODEL","ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION","ANTHROPIC_SMALL_FAST_MODEL","AWS_DEFAULT_REGION","AWS_PROFILE","AWS_REGION","BASH_DEFAULT_TIMEOUT_MS","BASH_MAX_OUTPUT_LENGTH","BASH_MAX_TIMEOUT_MS","CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR","CLAUDE_CODE_API_KEY_HELPER_TTL_MS","CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS","CLAUDE_CODE_DISABLE_TERMINAL_TITLE","CLAUDE_CODE_ENABLE_AUTO_MODE","CLAUDE_CODE_ENABLE_DESIGN_SYNC","CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL","CLAUDE_CODE_ENABLE_TELEMETRY","CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS","CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL","CLAUDE_CODE_MAX_OUTPUT_TOKENS","CLAUDE_CODE_SKIP_BEDROCK_AUTH","CLAUDE_CODE_SKIP_FOUNDRY_AUTH","CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH","CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH","CLAUDE_CODE_SKIP_MANTLE_AUTH","CLAUDE_CODE_SKIP_VERTEX_AUTH","CLAUDE_CODE_SUBAGENT_MODEL","CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_FOUNDRY","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD","CLAUDE_CODE_USE_GATEWAY","CLAUDE_CODE_USE_MANTLE","CLAUDE_CODE_USE_POWERSHELL_TOOL","CLAUDE_CODE_USE_VERTEX","DISABLE_AUTOUPDATER","DISABLE_BUG_COMMAND","DISABLE_COST_WARNINGS","DISABLE_FEEDBACK_COMMAND","DISABLE_GROWTHBOOK","DISABLE_INSTALLATION_CHECKS","DISABLE_UPDATES","ENABLE_TOOL_SEARCH","MAX_MCP_OUTPUT_TOKENS","MAX_THINKING_TOKENS","MCP_CONNECT_TIMEOUT_MS","MCP_TIMEOUT","MCP_TOOL_TIMEOUT","OTEL_EXPORTER_OTLP_COMPRESSION","OTEL_EXPORTER_OTLP_HEADERS","OTEL_EXPORTER_OTLP_LOGS_COMPRESSION","OTEL_EXPORTER_OTLP_LOGS_HEADERS","OTEL_EXPORTER_OTLP_LOGS_PROTOCOL","OTEL_EXPORTER_OTLP_METRICS_COMPRESSION","OTEL_EXPORTER_OTLP_METRICS_HEADERS","OTEL_EXPORTER_OTLP_METRICS_PROTOCOL","OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE","OTEL_EXPORTER_OTLP_PROTOCOL","OTEL_EXPORTER_OTLP_TRACES_COMPRESSION","OTEL_EXPORTER_OTLP_TRACES_HEADERS","OTEL_EXPORTER_OTLP_TRACES_PROTOCOL","OTEL_LOG_ASSISTANT_RESPONSES","OTEL_LOG_TOOL_CONTENT","OTEL_LOG_TOOL_DETAILS","OTEL_LOG_USER_PROMPTS","OTEL_LOGS_EXPORT_INTERVAL","OTEL_LOGS_EXPORTER","OTEL_METRIC_EXPORT_INTERVAL","OTEL_METRICS_EXPORTER","OTEL_METRICS_INCLUDE_ACCOUNT_UUID","OTEL_METRICS_INCLUDE_ENTRYPOINT","OTEL_METRICS_INCLUDE_RESOURCE_ATTRIBUTES","OTEL_METRICS_INCLUDE_SESSION_ID","OTEL_METRICS_INCLUDE_VERSION","OTEL_RESOURCE_ATTRIBUTES","OTEL_SERVICE_NAME","OTEL_TRACES_EXPORT_INTERVAL","OTEL_TRACES_EXPORTER","USE_BUILTIN_RIPGREP","VERTEX_REGION_CLAUDE_3_5_HAIKU","VERTEX_REGION_CLAUDE_3_5_SONNET","VERTEX_REGION_CLAUDE_3_7_SONNET","VERTEX_REGION_CLAUDE_4_0_OPUS","VERTEX_REGION_CLAUDE_4_0_SONNET","VERTEX_REGION_CLAUDE_4_1_OPUS","VERTEX_REGION_CLAUDE_4_5_OPUS","VERTEX_REGION_CLAUDE_4_6_OPUS","VERTEX_REGION_CLAUDE_4_7_OPUS","VERTEX_REGION_CLAUDE_4_8_OPUS","VERTEX_REGION_CLAUDE_5_OPUS","VERTEX_REGION_CLAUDE_FABLE_5","VERTEX_REGION_CLAUDE_4_5_SONNET","VERTEX_REGION_CLAUDE_4_6_SONNET","VERTEX_REGION_CLAUDE_5_SONNET","VERTEX_REGION_CLAUDE_HAIKU_4_5","CLAUDE_AUTOCOMPACT_PCT_OVERRIDE","CLAUDE_CODE_AUTO_COMPACT_WINDOW","CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT","CLAUDE_CODE_MAX_CONTEXT_TOKENS","DISABLE_AUTO_COMPACT","DISABLE_COMPACT","CLAUDE_CODE_ALWAYS_ENABLE_EFFORT","CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING","CLAUDE_CODE_DISABLE_FAST_MODE","CLAUDE_CODE_DISABLE_LEGACY_MODEL_REMAP","CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK","CLAUDE_CODE_DISABLE_THINKING","CLAUDE_CODE_EFFORT_LEVEL","DISABLE_INTERLEAVED_THINKING","DISABLE_PROMPT_CACHING","DISABLE_PROMPT_CACHING_FABLE","DISABLE_PROMPT_CACHING_HAIKU","DISABLE_PROMPT_CACHING_OPUS","DISABLE_PROMPT_CACHING_SONNET","ENABLE_PROMPT_CACHING_1H","ENABLE_PROMPT_CACHING_1H_BEDROCK","FALLBACK_FOR_ALL_PRIMARY_MODELS","FORCE_PROMPT_CACHING_5M","CLAUDE_AUTO_BACKGROUND_TASKS","CLAUDE_CODE_DISABLE_ADVISOR_TOOL","CLAUDE_CODE_DISABLE_AGENT_VIEW","CLAUDE_CODE_DISABLE_ARTIFACT","CLAUDE_CODE_DISABLE_BACKGROUND_TASKS","CLAUDE_CODE_DISABLE_BUNDLED_SKILLS","CLAUDE_CODE_DISABLE_CRON","CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS","CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY","CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING","CLAUDE_CODE_DISABLE_WORKFLOWS","CLAUDE_CODE_ENABLE_AWAY_SUMMARY","CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING","CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION","CLAUDE_CODE_ENABLE_TASKS","CLAUDE_CODE_FORK_SUBAGENT","CLAUDE_CODE_PLAN_MODE_REQUIRED","DISABLE_DOCTOR_COMMAND","DISABLE_EXTRA_USAGE_COMMAND","DISABLE_INSTALL_GITHUB_APP_COMMAND","DISABLE_LOGIN_COMMAND","DISABLE_LOGOUT_COMMAND","DISABLE_UPGRADE_COMMAND","CLAUDE_AX_SCREEN_READER","CLAUDE_CODE_ACCESSIBILITY","CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN","CLAUDE_CODE_DISABLE_MOUSE","CLAUDE_CODE_DISABLE_MOUSE_CLICKS","CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL","CLAUDE_CODE_FORCE_STRIKETHROUGH","CLAUDE_CODE_HIDE_CWD","CLAUDE_CODE_NATIVE_CURSOR","CLAUDE_CODE_NO_FLICKER","CLAUDE_CODE_SCROLL_SPEED","CLAUDE_CODE_SYNTAX_HIGHLIGHT","API_TIMEOUT_MS","CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS","CLAUDE_CODE_GLOB_TIMEOUT_SECONDS","CLAUDE_CODE_MAX_RETRIES","CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION","CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY","CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION","CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS","CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT","CLAUDE_STREAM_IDLE_TIMEOUT_MS","MAX_STRUCTURED_OUTPUT_RETRIES","MCP_REMOTE_SERVER_CONNECTION_BATCH_SIZE","MCP_SERVER_CONNECTION_BATCH_SIZE","SLASH_COMMAND_TOOL_CHAR_BUDGET","TASK_MAX_OUTPUT_LENGTH"]),$We=new Set(["CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC","DISABLE_ERROR_REPORTING","DISABLE_TELEMETRY","DO_NOT_TRACK"]);function I5(e,t){let n=e.toUpperCase();return zWe.has(n)||$We.has(n)&&Re(t)}import{createHash as WVe}from"crypto";import{posix as FY,win32 as zY}from"path";import{isAbsolute as D5}from"path";var HWe=D(()=>A({allowedDomains:I(g()).optional(),deniedDomains:I(g()).optional().describe("Domains that are always blocked, even if matched by allowedDomains. Supports the same wildcard syntax as allowedDomains. Merged from all settings sources regardless of allowManagedDomainsOnly."),strictAllowlist:R().optional().describe("When true, the sandbox runtime deterministically denies hosts not in allowedDomains instead of prompting. "+"Enforced for sandboxed commands only — in-process tools such as WebFetch are not gated by this setting. "+"Only honored from user, managed/policy, or CLI (--settings) settings — "+"project settings (.claude/settings.json and .claude/settings.local.json) are ignored."),allowManagedDomainsOnly:R().optional().describe("When true (and set in managed settings), only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources."),allowUnixSockets:I(g()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path)."),allowAllUnixSockets:R().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms)."),allowLocalBinding:R().optional(),allowMachLookup:I(g().refine((e)=>!(e.endsWith("*")?e.slice(0,-1):e).includes("*"),{message:'Wildcards are only allowed as a single trailing "*" (e.g., "com.example.*" or "*" for all services).'})).optional().describe('macOS only: Additional XPC/Mach service names to allow looking up. Supports trailing-wildcard prefix matching (e.g., "com.apple.coresimulator.*"). Needed for tools that communicate via XPC such as the iOS Simulator or Playwright.'),httpProxyPort:K().optional(),socksProxyPort:K().optional(),tlsTerminate:A({caCertPath:g().min(1).optional(),caKeyPath:g().min(1).optional()}).optional().describe("[EXPERIMENTAL] Enable in-process TLS termination so the per-request filter can see HTTPS request bodies. Provide a CA cert+key, or omit both to have sandbox-runtime generate an ephemeral one for the session. On native Windows an ephemeral CA cannot pass the sandbox trust check, so omitting the paths uses a persistent CA managed by the sandbox runtime (set up and trusted via /sandbox install); configured paths are passed to the sandbox runtime verbatim, which rejects a bad or incomplete pair at sandbox initialization. "+"Only honored from user, managed/policy, or CLI (`--settings`) settings — project settings "+"(.claude/settings.json and .claude/settings.local.json) are ignored.")}).optional()),BWe=D(()=>A({allowWrite:I(g()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules."),denyWrite:I(g()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:I(g()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:I(g()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths."),allowManagedReadPathsOnly:R().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used."),disabled:R().optional().describe("macOS and Linux/WSL only: skip filesystem isolation entirely while keeping network and seccomp isolation. Ignored on native Windows, where the sandboxed process runs as a separate user with no inherent rights, so skipping the filesystem rules would "+"withhold every access grant rather than loosen them — filesystem isolation stays on there. "+"Sandboxed commands get unrestricted read/write access to the host filesystem; network egress is still confined to network.allowedDomains. Intended for deployments whose goal is egress control rather than filesystem containment. Does not change Bash prompting: sandbox.autoAllowBashIfSandboxed is independent and still defaults to true, so set it to false to keep prompting for sandboxed commands. Drops the read protection from filesystem.denyRead and credentials.files deny entries for sandboxed commands, since both are enforced by the filesystem layer this turns off; credentials.files mask entries (sentinel binds) and credentials.envVars deny/mask are unaffected. "+"Only honored from user, managed/policy, or CLI (`--settings`) settings — "+"project settings (.claude/settings.json and .claude/settings.local.json) are ignored. If managed settings configure sandbox.filesystem at all, or list any sandbox.credentials.files deny entry, only managed settings can set this: an admin who deployed filesystem restrictions must not have them switched off by a user-writable file. (sandbox.credentials.envVars and credentials.files mask entries "+"do not pin it — env scrubbing and sentinel binds are independent of the filesystem "+"layer and survive this setting.) When unset, filesystem isolation stays on.")}).optional());function L5(e,t,n){if(e.length===0||e.some((r)=>r.length===0))n.addIssue({code:vr.custom,path:["maskClaims"],message:"maskClaims must name at least one non-empty claim — omit maskClaims for whole-token masking."});if(t===void 0)n.addIssue({code:vr.custom,path:["maskClaims"],message:"maskClaims requires decode — without a decode format there is no token to read claims from. Set decode, or omit maskClaims."})}function M5(e,t){let n;try{n=new RegExp(e)}catch(o){t.addIssue({code:vr.custom,path:["extract"],message:`extract is not a valid regular expression: ${Oo(o)}`});return}if(new RegExp(n.source+"|").exec("").length-1<1)t.addIssue({code:vr.custom,path:["extract"],message:"extract must contain at least one capturing group — "+'group 1 is the credential value to mask (e.g. "token:\\s*(\\S+)").'})}function N5(e){if(typeof e!=="object"||e===null)return e;let t=e;if(t.mode!=="deny")return e;let n={...t};if("extract"in n&&typeof n.extract!=="string")delete n.extract;if("onExtractNoMatch"in n&&n.onExtractNoMatch!=="warn"&&n.onExtractNoMatch!=="deny"&&n.onExtractNoMatch!=="error")delete n.onExtractNoMatch;if("decode"in n&&n.decode!=="jwt")delete n.decode;if("maskClaims"in n&&!(Array.isArray(n.maskClaims)&&n.maskClaims.every((r)=>typeof r==="string")))delete n.maskClaims;if("maskDuplicates"in n&&typeof n.maskDuplicates!=="boolean")delete n.maskDuplicates;if("injectHosts"in n&&!(Array.isArray(n.injectHosts)&&n.injectHosts.every((r)=>typeof r==="string")))delete n.injectHosts;return n}var db=D(()=>ot(N5,A({path:g().min(1).describe("Path to a credential file or directory. Same resolution as sandbox.filesystem.* paths: absolute, ~ expanded, or relative to the settings file root (project root for project settings, ~/.claude for user settings)."),mode:Z(["deny","mask"]).describe("Access mode for this path. `deny` blocks reads inside the sandbox; `mask` shows sandboxed commands a sentinel-substituted copy (whole-file, or only the spans captured by `extract`) and the "+"host proxy swaps sentinel→real on egress to `injectHosts`. "+"On macOS and Windows `mask` currently degrades to `deny`."),extract:g().optional().describe("Optional regex for structured masking when mode is `mask`. Applied globally to the file; capture group 1 of each match is a credential value, and only those captured spans are replaced "+"with sentinels — the rest of the file is preserved so a tool "+"that parses it (.netrc, JSON, YAML) still succeeds. Without `extract`, the entire file content is replaced with one sentinel (whole-file masking, suited to single-secret files). If the regex matches nothing, behavior is governed by `onExtractNoMatch` (default `warn`). Accepted but ignored for `deny`."),onExtractNoMatch:Z(["warn","deny","error"]).optional().describe("What to do when `extract` matches nothing in the file — or, "+"with `decode`, when no candidate survives verification. `warn` (default) emits a stderr warning and leaves the file readable as-is inside the sandbox (fail-open, for credentials that may be legitimately absent); `deny` degrades the entry to "+"mode `deny` so the file is unreadable (fail-closed) — under "+"`sandbox.filesystem.disabled` it is treated as `error`, since read-denies are dropped in that mode; `error` aborts at sandbox setup so nothing runs until the config is fixed. Only meaningful when mode is `mask` and `extract` or `decode` is set; accepted but ignored otherwise."),decode:Z(["jwt"]).optional().describe("Optional encoded-credential format for `mask` mode. `jwt`: candidates are located with a built-in JWT regex (or the explicit `extract` pattern, if set), verified to actually be JWTs before masking, and replaced with a structurally valid fake JWT so client-side token parsing inside the sandbox keeps working. If no candidate verifies, behavior is governed by `onExtractNoMatch` (default `warn`). Accepted but ignored for `deny`."),maskClaims:I(g()).optional().describe("Names of top-level payload claims to mask inside each decoded value, instead of replacing the whole token. Each named claim present with a string value gets its own sentinel and the token is rebuilt around the modified payload; all other claims are preserved so a tool that decodes the token and reads a non-secret claim keeps working. Requires `decode`. If no named claim matches in any verified token, behavior is governed by `onExtractNoMatch` (default `warn`). Only meaningful when mode is `mask`; accepted but ignored for `deny`."),maskDuplicates:R().optional().describe("If true, verbatim occurrences of each captured credential value outside the regex-matched spans are also replaced with the "+"corresponding sentinel — for a secret repeated where the regex "+"does not reach (e.g. pasted into a comment). Matches raw substrings, so short or common values may corrupt unrelated content; intended for long, high-entropy secrets. Defaults to false. Only meaningful when mode is `mask` and `extract` or `decode` is set; accepted but ignored otherwise."),injectHosts:I(g()).optional().describe("Optional narrowing of where the proxy substitutes this credential. Only meaningful when mode is `mask`; accepted but ignored for `deny`. If unset, defaults to "+"`network.allowedDomains` — the credential is injected at "+"every reachable host. Each entry must be reachable via `network.allowedDomains` (sandbox-runtime validates this).")}).superRefine((e,t)=>{if(e.mode==="mask"&&e.path.endsWith("/"))t.addIssue({code:vr.custom,path:["path"],message:'Credential mode "mask" applies to a single file, not a directory. List the specific credential file(s), or use "deny" for the directory.'});if(e.mode==="mask"&&e.extract!==void 0)M5(e.extract,t);if(e.mode==="mask"&&e.maskClaims!==void 0)L5(e.maskClaims,e.decode,t)}))),hu=()=>g().regex(/^[A-Za-z_][A-Za-z0-9_]*$/,"Environment variable name must start with a letter or underscore and contain only letters, digits, and underscores"),pb=D(()=>ot(N5,A({name:hu().describe("Environment variable name."),mode:Z(["deny","mask"]).describe("Access mode for this environment variable. `deny` unsets the variable for sandboxed commands; `mask` shows sandboxed commands a sentinel value and the "+"host proxy swaps sentinel→real on egress to `injectHosts`."),extract:g().optional().describe("Optional regex for structured masking when mode is `mask`. Applied globally to the value; capture group 1 of each match is a credential value, and only those captured spans are "+"replaced with sentinels — the rest of the value is preserved "+"so a tool that parses it (a `DATABASE_URL` connection string, a composite `KEY:SECRET` pair) still succeeds inside the sandbox. Without `extract`, the entire value is replaced with one sentinel (whole-value masking, suited to bare tokens). If the regex matches nothing, behavior is governed by `onExtractNoMatch` (default `warn`). Cannot be combined with `decode` (the decode path never consults it). Accepted but ignored for `deny`."),onExtractNoMatch:Z(["warn","deny","error"]).optional().describe("What to do when `extract` matches nothing in the value. `warn` (default) emits a stderr warning and lets the variable pass through unmasked (fail-open, for credentials that may be legitimately absent); `deny` unsets the variable inside the sandbox (fail-closed); `error` aborts at sandbox setup so nothing runs until the config is fixed. Only meaningful when mode is `mask` and `extract` is set without `decode`. On a mask entry with `decode`, the runtime takes the decode path and never consults this field, so a fail-closed setting "+"cannot be honored — `deny` and `error` are rejected there; "+"only `warn` is accepted. In all other shapes the field is accepted but ignored."),decode:Z(["jwt"]).optional().describe("Optional encoded-credential format for `mask` mode. `jwt`: the variable's whole value is verified to actually be a JWT and replaced with a structurally valid fake JWT so client-side token parsing inside the sandbox keeps working; the proxy swaps the whole fake token on egress. If the value does not verify, the variable is left unmasked with a stderr warning "+"(fail-open). Cannot be combined with `extract` — the decode "+"path never consults it. Accepted but ignored for `deny`."),maskClaims:I(g()).optional().describe("Names of top-level payload claims to mask inside the decoded value, instead of replacing the whole token. Each named claim present with a string value gets its own sentinel and the token is rebuilt around the modified payload; all other claims are preserved so claim-reading clients keep working. Requires `decode`. If no named claim matches, the variable is left unmasked with a stderr warning (fail-open). Only meaningful when mode is `mask`; accepted but ignored for `deny`."),injectHosts:I(g()).optional().describe("Optional narrowing of where the proxy substitutes this credential. Only meaningful when mode is `mask`; accepted but ignored for `deny`. If unset, defaults to "+"`network.allowedDomains` — the credential is injected at "+"every reachable host. Each entry must be reachable via `network.allowedDomains` (sandbox-runtime validates this).")}).superRefine((e,t)=>{if(e.mode==="mask"&&e.extract!==void 0)M5(e.extract,t);if(e.mode==="mask"&&e.maskClaims!==void 0)L5(e.maskClaims,e.decode,t);if(e.mode==="mask"&&e.decode!==void 0&&e.extract!==void 0)t.addIssue({code:vr.custom,path:["extract"],message:"extract cannot be combined with decode on an env entry — the runtime takes the decode path (whole-value JWT verification) and never consults extract, silently disabling the structured masking. Remove one of the two."});if(e.mode==="mask"&&e.decode!==void 0&&(e.onExtractNoMatch==="deny"||e.onExtractNoMatch==="error"))t.addIssue({code:vr.custom,path:["onExtractNoMatch"],message:"onExtractNoMatch cannot be honored on an env entry with decode — the runtime takes the decode path (which is unconditionally fail-open on verify failure) and never consults extract or onExtractNoMatch. Remove onExtractNoMatch, or drop decode to use extract-based masking (whose no-match handling does honor it)."})}))),gu=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"];var $O="_INVALID_PAIR_",U5="_PARENT_PAIR_SUPPRESSOR_";var fb=D(()=>A({accessKeyIdVar:hu().describe("Name of the masked env var holding the AWS access key id."),secretAccessKeyVar:hu().describe("Name of the masked env var holding the AWS secret access key."),sessionTokenVar:hu().optional().describe("Optional name of the masked env var holding the AWS session token (temporary credentials). When set, the proxy sends the real token as x-amz-security-token on re-signed requests and adds it to the signed header set if the client did not.")}).superRefine((e,t)=>{let n=new Map;for(let[r,o]of[["accessKeyIdVar",e.accessKeyIdVar],["secretAccessKeyVar",e.secretAccessKeyVar],["sessionTokenVar",e.sessionTokenVar]]){if(o===void 0)continue;let s=n.get(o);if(s!==void 0)t.addIssue({code:vr.custom,path:[r],message:`${r} names the same env var ('${o}') as ${s} — each pair member must be a distinct variable.`});else n.set(o,r)}})),KWe=D(()=>{let e=Z(["deny","passthrough"]);return A({streaming:e.optional().describe("Policy for aws-chunked streaming uploads (x-amz-content-sha256: STREAMING-*): per-chunk signatures chain off the seed signature, so re-signing would require rewriting the body. `deny` (default) fails closed with a 403; `passthrough` forwards the request unre-signed (the upstream will reject its signature)."),presigned:e.optional().describe("Policy for presigned URLs (X-Amz-Algorithm/X-Amz-Signature in the query, no Authorization header): the signature lives in the URL itself. `deny` (default) or `passthrough`."),sigv4a:e.optional().describe("Policy for SigV4A (AWS4-ECDSA-P256-SHA256) asymmetric signatures: there is no shared-key HMAC to recompute. `deny` (default) or `passthrough`.")})}),GWe=D(()=>A({files:I(db()).optional().describe("Credential files or directories to protect. `deny` blocks reads inside the sandbox; `mask` substitutes a sentinel inside the sandbox (whole-file, or per-`extract` capture) and injects the real value at the proxy. On macOS and Windows `mask` degrades to `deny`."),envVars:I(pb()).optional().describe("Environment variables to protect. `deny` unsets the variable for sandboxed commands; `mask` substitutes a sentinel inside the sandbox and injects the real value at the proxy."),allowPlaintextInject:R().optional().describe("Allow sentinel→real substitution on the plain-HTTP proxy path. "+"Defaults to false: without TLS termination the upstream identity is unverified and the credential travels in cleartext. Set only for trusted-network test fixtures. Only honored from user, managed/policy, or CLI (`--settings`) "+"settings — project settings (.claude/settings.json and "+".claude/settings.local.json) are ignored."),awsPairs:I(fb()).optional().describe("Explicit groupings of masked env vars into AWS credential pairs for SigV4 re-signing, for non-standard variable names. The conventional AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_SESSION_TOKEN trio is paired automatically when masked. Only honored from user, managed/policy, or CLI (`--settings`) "+"settings — project settings (.claude/settings.json and "+".claude/settings.local.json) are ignored. A member is only usable when its env var is forwarded as a whole-value `mask` entry (an entry carrying `extract` or `decode` does not "+"qualify — re-signing needs the whole real value). A pair "+"whose key id or secret member is unusable never re-signs: it is dropped, unless it names a conventional AWS variable, in which case it is forwarded as an inert suppressor so implicit auto-pairing stays overridden. A pair whose ONLY unusable member is the session token still re-signs, without an x-amz-security-token (temporary-credential requests fail upstream until the entry is fixed)."),sigv4:KWe().optional().describe("Policies for AWS SigV4 request shapes the proxy cannot re-sign (streaming, presigned, sigv4a) when they reference a masked credential pair: `deny` (default) or `passthrough`. Only honored from user, managed/policy, or CLI (`--settings`) "+"settings — project settings (.claude/settings.json and "+".claude/settings.local.json) are ignored.")}).superRefine((e,t)=>{let n=new Set;for(let[r,o]of(e?.awsPairs??[]).entries()){let s=[["accessKeyIdVar",o.accessKeyIdVar],["secretAccessKeyVar",o.secretAccessKeyVar],["sessionTokenVar",o.sessionTokenVar]],i=new Set;for(let[a,c]of s){if(c===void 0)continue;if(n.has(c))t.addIssue({code:vr.custom,path:["awsPairs",r,a],message:`"${c}" appears in more than one awsPairs slot (within or across pairs) — each variable can fill exactly one slot.`});i.add(c)}for(let a of i)n.add(a)}}).optional()),jO=D(()=>A({enabled:R().optional(),failIfUnavailable:R().optional().describe("Exit with an error at startup if sandbox.enabled is true but the sandbox cannot start (missing dependencies or unsupported platform). When false (default), a warning is shown and commands run unsandboxed. Intended for managed-settings deployments that require sandboxing as a hard gate."),autoAllowBashIfSandboxed:R().optional(),allowUnsandboxedCommands:R().optional().describe("Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true."),network:HWe(),filesystem:BWe(),credentials:GWe(),ignoreViolations:V(g(),I(g())).optional(),enableWeakerNestedSandbox:R().optional(),enableWeakerNetworkIsolation:R().optional().describe("macOS only: Allow access to com.apple.trustd.agent in the sandbox. Needed for Go-based CLI tools (gh, gcloud, terraform, etc.) to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. "+"**Reduces security** — opens a potential data exfiltration vector through the trustd service. Default: false"),allowAppleEvents:R().optional().describe("macOS only: Allow sandboxed commands to send Apple Events (and look up the appleeventsd Mach service). Needed for `open`, `osascript`, and browser-based auth flows that open URLs. "+"**Removes code-execution isolation** — sandboxed commands can launch other applications "+"unsandboxed with no user prompt, and can script running apps (e.g. Terminal) subject to the user's per-app TCC automation consent. "+"Only honored from user, managed/policy, or CLI (--settings) settings — "+"project settings (.claude/settings.json and .claude/settings.local.json) are ignored. Default: false"),excludedCommands:I(g()).optional(),ripgrep:A({command:g(),args:I(g()).optional()}).optional().describe("Custom ripgrep configuration for bundled ripgrep support. "+"Only honored from user, managed/policy, or CLI (--settings) settings — "+"project settings (.claude/settings.json and .claude/settings.local.json) are ignored."),bwrapPath:ot((e)=>typeof e==="string"&&D5(e)?e:void 0,g()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the bwrap (bubblewrap) binary. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings."),socatPath:ot((e)=>typeof e==="string"&&D5(e)?e:void 0,g()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the socat binary used for the sandbox network proxy. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings.")}).passthrough());var tm=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],F5=[...tm],z5=F5;function nm(e){return e==="manual"?"default":e}var HDt=`Cannot set permission mode: must be one of ${F5.join(", ")}`,BDt={dangerousRemoval:{bypassImmune:!0,classifierRouted:!0},backgroundOperator:{bypassImmune:!1,classifierRouted:!0},suspiciousWindowsPath:{bypassImmune:!1,classifierRouted:!0},isolatePeerMachines:{bypassImmune:!0,classifierRouted:!1},...{}};var $5=["auto","iterm2","terminal_bell","iterm2_with_bell","kitty","ghostty","notifications_disabled"];var j5=["normal","vim"],H5=["classic","readline"];var B5=["auto","tmux","iterm2","in-process"],WWe=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],K5=["auto",...WWe],G5=["auto","alwaysAsk","disabled"];var qDt=rs()==="macos"?"⏺":"●";var t0t=D(()=>ot(nm,Z(z5))),n0t=D(()=>ot(nm,Z(tm)));import{posix as sqe,win32 as iqe}from"path";import{isIPv4 as aqe,isIPv6 as cqe}from"net";var W5=["bash","powershell"];var rm=D(()=>g().optional().describe('Permission rule syntax to filter when this hook runs (e.g., "Bash(git *)"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.'));function qWe(){let e=A({type:z("command").describe("Shell command hook type"),command:g().describe("Shell command to execute"),args:I(g()).optional().describe("Argument list for exec form. When present, `command` is resolved as "+"an executable and spawned directly with these arguments — no shell. "+"Path placeholders like ${CLAUDE_PLUGIN_ROOT} are substituted per-element as plain strings, so paths with quotes, $, or backticks never reach a shell parser. When absent, `command` runs through a shell (bash on POSIX, PowerShell on Windows without Git Bash)."),if:rm(),shell:Z(W5).optional().describe("Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash (powershell on Windows without Git Bash)."),timeout:K().positive().optional().describe("Timeout in seconds for this specific command"),statusMessage:g().optional().describe("Custom status message to display in spinner while hook runs"),once:R().optional().describe("If true, hook runs once and is removed after execution"),async:R().optional().describe("If true, hook runs in background without blocking"),asyncRewake:R().optional().describe("If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async."),rewakeMessage:g().min(1).optional().describe("@internal Custom prefix for the system-reminder shown to the model when an asyncRewake hook exits with code 2. The hook output is appended after this prefix."),rewakeSummary:g().min(1).optional().describe('@internal One-line summary shown to the user in the terminal when an asyncRewake hook exits with code 2. Defaults to "Stop hook feedback".')}),t=A({type:z("prompt").describe("LLM prompt hook type"),prompt:g().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),if:rm(),timeout:K().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:g().optional().describe('Model to use for this prompt hook (e.g., "claude-sonnet-5"). If not specified, uses the default small fast model.'),continueOnBlock:R().optional().describe(`Sets the continue value for the decision:"block" produced when ok is false. Default false (turn ends). Whether continue:true lets the turn proceed depends on the event's decision:"block" semantics. On PostToolUse, the reason is fed back to Claude and the turn continues.`),statusMessage:g().optional().describe("Custom status message to display in spinner while hook runs"),once:R().optional().describe("If true, hook runs once and is removed after execution")}),n=A({type:z("mcp_tool").describe("MCP tool hook type"),server:g().describe("Name of an already-configured MCP server to invoke"),tool:g().describe("Name of the tool on that server to call"),input:V(g(),xe()).optional().describe('Arguments passed to the MCP tool. String values support ${path} interpolation from the hook input JSON (e.g. "${tool_input.file_path}").'),if:rm(),timeout:K().positive().optional().describe("Timeout in seconds for this specific tool call"),statusMessage:g().optional().describe("Custom status message to display in spinner while hook runs"),once:R().optional().describe("If true, hook runs once and is removed after execution")}),r=A({type:z("http").describe("HTTP hook type"),url:g().url().describe("URL to POST the hook input JSON to"),if:rm(),timeout:K().positive().optional().describe("Timeout in seconds for this specific request"),headers:V(g(),g()).optional().describe('Additional headers to include in the request. Values may reference environment variables using $VAR_NAME or ${VAR_NAME} syntax (e.g., "Authorization": "Bearer $MY_TOKEN"). Only variables listed in allowedEnvVars will be interpolated.'),allowedEnvVars:I(g()).optional().describe("Explicit list of environment variable names that may be interpolated in header values. Only variables listed here will be resolved; all other $VAR references are left as empty strings. Required for env var interpolation to work."),statusMessage:g().optional().describe("Custom status message to display in spinner while hook runs"),once:R().optional().describe("If true, hook runs once and is removed after execution")}),o=A({type:z("agent").describe("Agentic verifier hook type"),prompt:g().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),if:rm(),timeout:K().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:g().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-5"). If not specified, uses Haiku.'),statusMessage:g().optional().describe("Custom status message to display in spinner while hook runs"),once:R().optional().describe("If true, hook runs once and is removed after execution")});return{BashCommandHookSchema:e,PromptHookSchema:t,HttpHookSchema:r,AgentHookSchema:o,McpToolHookSchema:n}}var q5=D(()=>{let{BashCommandHookSchema:e,PromptHookSchema:t,AgentHookSchema:n,HttpHookSchema:r,McpToolHookSchema:o}=qWe();return Ri("type",[e,t,n,r,o])}),V5=D(()=>A({matcher:g().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:I(q5()).describe("List of hooks to execute when the matcher matches")})),La=D(()=>V0(Z(Ka),I(V5())));var u0t=D(()=>Z(["local","user","project","dynamic","enterprise","claudeai","managed","agent"])),d0t=D(()=>Z(["stdio","sse","sse-ide","http","ws","sdk"])),_u=D(()=>z("comms").optional().catch(void 0)),_i=D(()=>K().int().positive()),VWe=300000,Z5=D(()=>K().int().positive().optional().catch(void 0).describe("@internal CCR backend wire hint; folded into timeout at parse."));function Y5({request_timeout_ms:e,...t}){return{...t,...t.timeout===void 0&&e!==void 0&&{timeout:Math.min(e,VWe)}}}var ZWe=D(()=>A({type:z("stdio").optional(),command:g().min(1,"Command cannot be empty"),args:I(g()).default([]),env:V(g(),g()).optional(),timeout:_i().optional(),alwaysLoad:R().optional(),role:_u()})),YWe=D(()=>R()),J5=D(()=>A({clientId:g().optional(),callbackPort:K().int().positive().optional(),authServerMetadataUrl:g().url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),scopes:g().min(1).optional(),xaa:YWe().optional()})),X5=D(()=>A({name:g(),permission_policy:Z(["always_allow","always_ask","always_deny"]).optional()})),JWe=D(()=>A({type:z("sse"),url:g(),headers:V(g(),g()).optional(),headersHelper:g().optional(),oauth:J5().optional(),timeout:_i().optional(),request_timeout_ms:Z5(),tools:I(X5()).optional(),alwaysLoad:R().optional(),discoveryCache:R().optional(),role:_u(),toolPermissions:V(g(),HO()).optional()}).transform(Y5)),XWe=D(()=>A({type:z("sse-ide"),url:g(),ideName:g(),ideRunningInWindows:R().optional(),timeout:_i().optional(),alwaysLoad:R().optional(),role:_u()})),QWe=D(()=>A({type:z("ws-ide"),url:g(),ideName:g(),authToken:g().optional(),ideRunningInWindows:R().optional(),timeout:_i().optional(),alwaysLoad:R().optional(),role:_u()})),eqe=D(()=>A({type:Z(["http","streamable-http"]).transform(()=>"http"),url:g(),headers:V(g(),g()).optional(),headersHelper:g().optional(),oauth:J5().optional(),timeout:_i().optional(),request_timeout_ms:Z5(),tools:I(X5()).optional(),alwaysLoad:R().optional(),discoveryCache:R().optional(),role:_u(),toolPermissions:V(g(),HO()).optional()}).transform(Y5)),tqe=D(()=>A({type:z("ws"),url:g(),headers:V(g(),g()).optional(),headersHelper:g().optional(),timeout:_i().optional(),alwaysLoad:R().optional(),role:_u()})),nqe=D(()=>A({type:z("sdk"),name:g(),timeout:_i().optional(),alwaysLoad:R().optional()})),HO=D(()=>Z(["allow","ask","blocked"])),rqe=D(()=>A({type:z("claudeai-proxy"),url:g(),id:g(),displayName:g().optional(),iconUrl:g().optional(),timeout:_i().optional(),alwaysLoad:R().optional(),toolPermissions:V(g(),HO()).optional(),stateless:R().optional(),cachedInitResponse:V(g(),xe()).nullish(),discoverSupport:Z(["supported","legacy","unknown"]).optional().catch(void 0),cachedDiscoverResponse:V(g(),xe()).nullish(),eligible:R().nullish(),ineligibleReason:g().nullish()})),mb=D(()=>ie([ZWe(),JWe(),XWe(),QWe(),eqe(),tqe(),nqe(),rqe()]));var p0t=D(()=>A({mcpServers:V(g(),mb())}));function oqe(e){return k_(e).replace(/ {2,}/g," ").trim()}function Q5(e,t=160){let n=oqe(e);return n.length>t?`${Ou(n,t)}…`:n}var qO=500,lqe=32;function iY(){return{sourceCommand:g().max(qO+20).optional().catch(void 0).describe("The `command`-source command the user accepted at explicit install/update. The once-per-session background re-resolve only runs while the marketplace entry still declares this exact command; a changed command (or an entry that became command-sourced later) is skipped with a warning until the user runs an explicit update."),sourceProducerPath:g().max(4096).refine(eY,{message:"must be an absolute path"}).optional().catch(void 0).describe("The directory a `command`-source plugin was last resolved to (what its command printed). Served in place in link mode and re-copied every session in copy mode, so the sandbox write-denies it; refreshed on every install/update, including no-op updates that resolve to a new location."),previousProducerPaths:I(xe()).transform((e)=>e.filter((t)=>typeof t==="string"&&t.length<=4096&&eY(t)).slice(-lqe)).optional().catch(void 0).describe("Producer directories this installation was resolved to before the current one (most recent last, bounded). A concurrent older session may still serve one of them, so the sandbox keeps write-denying them too.")}}function eY(e){return sqe.isAbsolute(e)||iqe.isAbsolute(e)}var aY=/[^\x20-\x7E]| {4,}/;function VO(){return g().max(qO,{message:"headersHelper must not be longer than the install consent UI can display"}).refine((e)=>!aY.test(e),{message:"headersHelper must be printable ASCII (letters, digits, punctuation, single spaces) with no runs of 4 or more spaces"})}var uqe=new Set(["claude-community","claude-plugins-community","healthcare"]),dqe=new Set(["claude-code-marketplace","claude-code-plugins","claude-plugins-official","anthropic-marketplace","anthropic-plugins","agent-skills","anthropic-agent-skills","life-sciences","knowledge-work-plugins","claude-for-legal","claude-for-financial-services","financial-services-plugins","first-party-plugins"]),cY=new Set([...dqe,...uqe]);var pqe=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,fqe=/[^\u0020-\u007E]/;function mqe(e){if(cY.has(e.toLowerCase()))return!1;if(fqe.test(e))return!0;return pqe.test(e)}var zo=D(()=>g().startsWith("./")),Ma=D(()=>zo().endsWith(".json")),tY=D(()=>ie([z("."),zo()])),nY=D(()=>ie([zo().refine((e)=>e.endsWith(".mcpb")||e.endsWith(".dxt"),{message:"MCPB file path must end with .mcpb or .dxt"}).describe("Path to MCPB file relative to plugin root"),g().url().refine((e)=>e.endsWith(".mcpb")||e.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")])),KO=D(()=>zo().endsWith(".md")),GO=D(()=>ie([KO(),zo()])),lY={inline:"--plugin-dir session plugins",builtin:"built-in plugins","skills-dir":"plugins auto-loaded from .claude/skills/",synced:"plugins synced from your claude.ai account"};function hqe(e){return Object.hasOwn(lY,e)}var uY=D(()=>g().min(1,"Marketplace must have a name").refine((e)=>!e.includes(" "),{message:'Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")'}).refine((e)=>!e.includes("/")&&!e.includes("\\")&&!e.includes("..")&&e!==".",{message:'Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."'}).refine((e)=>!mqe(e),{message:"Marketplace name impersonates an official Anthropic/Claude marketplace"}).superRefine((e,t)=>{let n=e.toLowerCase();if(!hqe(n))return;t.addIssue({code:"custom",message:`Marketplace name "${n}" is reserved for ${lY[n]}`})})),ZO=D(()=>A({name:g().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:g().optional().describe("Contact email for support or feedback"),url:g().optional().describe("Website, GitHub profile, or organization URL")})),gqe=D(()=>A({$schema:g().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:g().min(1,"Plugin name cannot be empty").refine((e)=>!e.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier for the plugin, used for namespacing (prefer kebab-case)"),displayName:g().optional().describe('Human-readable name shown in UI (e.g., "GitHub Utils"). Falls back to `name` when omitted. Unlike `name`, may contain spaces and any casing; not used for namespacing or lookup.'),version:g().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:g().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:ZO().optional().describe("Information about the plugin creator or maintainer"),homepage:g().url().optional().describe("Plugin homepage or documentation URL"),repository:g().optional().describe("Source code repository URL"),license:g().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:I(g()).optional().describe("Tags for plugin discovery and categorization"),defaultEnabled:R().optional().describe("Whether the plugin starts enabled when the user has no explicit enabled/disabled setting for it (default: true). Explicit enabledPlugins values always win, and a plugin required by an enabled dependent is enabled regardless of this value."),dependencies:I(pVe()).optional().describe(`Plugins that must be enabled for this plugin to function. Bare names (no "@marketplace") are resolved against the declaring plugin's own marketplace.`),metadata:ot((e)=>Qn(e)?e:void 0,V(g(),xe()).optional()).describe("Free-form metadata for the plugin author's own use (e.g. entitlement or catalog fields). Preserved on the parsed manifest but not read by Claude Code.")})),P0t=D(()=>A({description:g().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:Vm(()=>La()).describe("The hooks provided by the plugin, in the same format as the one used for settings")})),_qe=D(()=>A({hooks:ie([Ma().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),Vm(()=>La()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),I(ie([Ma().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),Vm(()=>La()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),yqe=D(()=>A({source:GO().optional().describe("Path to command markdown file, relative to plugin root"),content:g().optional().describe("Inline markdown content for the command"),description:g().optional().describe("Command description override"),argumentHint:g().optional().describe('Hint for command arguments (e.g., "[file]")'),model:g().optional().describe("Default model for this command"),allowedTools:I(g()).optional().describe("Tools allowed when command runs")}).refine((e)=>e.source&&!e.content||!e.source&&e.content,{message:'Command must have either "source" (file path) or "content" (inline markdown), but not both'})),bqe=D(()=>A({commands:ie([GO().describe("Path to a command file or skill directory, relative to the plugin root. When set, the commands/ directory is not auto-loaded — list its files here if you want both."),I(GO().describe("Path to a command file or skill directory, relative to the plugin root. When set, the commands/ directory is not auto-loaded — list its files here if you want both.")).describe("List of command file or skill directory paths. When set, the commands/ directory is not auto-loaded."),V(g(),yqe()).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" → "/plugin:about")')])})),Sqe=D(()=>A({agents:ie([KO().describe("Path to an agent file, relative to the plugin root. When set, the agents/ directory is not auto-loaded — list its files here if you want both."),I(KO().describe("Path to an agent file, relative to the plugin root. When set, the agents/ directory is not auto-loaded — list its files here if you want both.")).describe("List of agent file paths. When set, the agents/ directory is not auto-loaded.")])})),Eqe=D(()=>A({skills:ie([tY().describe('Path to a skill directory, relative to the plugin root ("." / "./" denote the plugin root itself). Loaded in addition to the skills/ directory (except: for a marketplace entry whose source resolves to the marketplace root, declaring a specific subdirectory replaces the skills/ scan).'),I(tY().describe('Path to a skill directory, relative to the plugin root ("." / "./" denote the plugin root itself).')).describe("List of skill directory paths, loaded in addition to the skills/ directory (except: for a marketplace entry whose source resolves to the marketplace root, declaring specific subdirectories replaces the skills/ scan).")])})),xqe=D(()=>ie([g(),I(g())])),dY=D(()=>A({outputStyles:ie([zo().describe("Path to an output-styles directory or file, relative to the plugin root. When set, the output-styles/ directory is not auto-loaded — list its files here if you want both."),I(zo().describe("Path to an output-styles directory or file, relative to the plugin root. When set, the output-styles/ directory is not auto-loaded — list its files here if you want both.")).describe("List of output-style directory or file paths. When set, the output-styles/ directory is not auto-loaded.")])})),vqe=D(()=>g().max(64).regex(/^[a-z][a-z0-9_-]*$/,"must match ^[a-z][a-z0-9_-]*$")),wqe=16,Aqe=D(()=>A({id:vqe(),remote:g().max(256).regex(/^(npm:[@a-z0-9/._-]+(@[a-z0-9._+-]+)?|github:[\w.-]+\/[\w.-]+@[\w./-]+#.+\.js)$/,"must be npm:<pkg>[@ver] or github:<owner>/<repo>@<ref>#<path>.js").optional(),integrity:g().max(512).regex(/^sha(256|384|512)-[A-Za-z0-9+/=]+$/,"must be SRI form: sha256-, sha384-, or sha512-<base64>").optional()}).strict()),Tqe=D(()=>A({syntaxHighlighting:A({hljsLanguages:I(Aqe()).max(wqe)}).strict()})),pY=D(()=>A({themes:ie([zo().describe("Path to a themes directory or file, relative to the plugin root. When set, the themes/ directory is not auto-loaded — list its files here if you want both."),I(zo().describe("Path to a themes directory or file, relative to the plugin root. When set, the themes/ directory is not auto-loaded — list its files here if you want both.")).describe("List of theme directory or file paths. When set, the themes/ directory is not auto-loaded.")])})),kqe=D(()=>A({})),rY=D(()=>g().min(1)),Cqe=D(()=>g().min(2).refine((e)=>e.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),Rqe=D(()=>A({mcpServers:ie([Ma().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),nY().describe("Path or URL to MCPB file containing MCP server configuration"),V(g(),mb()).describe("MCP server configurations keyed by server name"),I(ie([Ma().describe("Path to MCP servers configuration file"),nY().describe("Path or URL to MCPB file"),V(g(),mb()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),fY=D(()=>A({type:Z(["string","number","boolean","directory","file"]).describe("Type of the configuration value"),title:g().describe("Human-readable label shown in the config dialog"),description:g().describe("Help text shown beneath the field in the config dialog"),required:R().optional().describe("If true, validation fails when this field is empty"),default:ie([g(),K(),R(),I(g())]).optional().describe("Default value used when the user provides nothing"),multiple:R().optional().describe("For string type: allow an array of strings"),sensitive:R().optional().describe("If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json"),min:K().optional().describe("Minimum value (number type only)"),max:K().optional().describe("Maximum value (number type only)")}).strict()),Oqe=D(()=>A({userConfig:V(g().regex(/^[A-Za-z_]\w*$/,"Option keys must be valid identifiers (letters, digits, underscore; no leading digit) — they become CLAUDE_PLUGIN_OPTION_<KEY> env vars in hooks"),fY()).optional().describe("User-configurable values this plugin needs. Prompted at enable time. Non-sensitive values saved to settings.json; sensitive values to secure storage. Available as ${user_config.KEY} in MCP/LSP server config, hook commands, and (non-sensitive only) skill/agent content. Keep sensitive value counts small.")})),Pqe=D(()=>A({channels:I(A({server:g().min(1).describe("Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers."),displayName:g().optional().describe('Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.'),userConfig:V(g(),fY()).optional().describe("Fields to prompt the user for when enabling this plugin in assistant mode. Saved values are substituted into ${user_config.KEY} references in the mcpServers env.")}).strict()).describe("Channels this plugin provides. Each entry declares an MCP server as a message channel and optionally specifies user configuration to prompt for at enable time.")})),oY=D(()=>Ax({command:g().min(1).refine((e)=>{if(e.includes(" ")&&!e.startsWith("/"))return!1;return!0},{message:"Command should not contain spaces. Use args array for arguments."}).describe('Command to execute the LSP server (e.g., "typescript-language-server")'),args:I(rY()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:V(Cqe(),rY()).refine((e)=>Object.keys(e).length>0,{message:"extensionToLanguage must have at least one mapping"}).describe("Mapping from file extension to LSP language ID. File extensions and languages are derived from this mapping."),transport:Z(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:V(g(),g()).optional().describe("Environment variables to set when starting the server"),initializationOptions:xe().optional().describe("Initialization options passed to the server during initialization"),settings:xe().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:g().optional().describe("Workspace folder path to use for the server"),startupTimeout:K().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:K().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),restartOnCrash:R().optional().describe("Whether to restart the server if it crashes"),maxRestarts:K().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up"),diagnostics:R().optional().describe("Whether to push publishDiagnostics into the agent context after edits. Set to false to keep LSP navigation (goToDefinition, hover, etc.) but suppress automatic diagnostic injection. Defaults to true.")})),Iqe=D(()=>Ax({name:g().min(1).describe("Identifier for this monitor, unique within the plugin. Used to dedupe so re-arming (plugin reload, repeat skill invoke) does not spawn duplicates."),command:g().min(1).describe('Shell command to run as a persistent background monitor. Each stdout line is delivered to the model as a <task_notification> event; the process runs for the session lifetime. ${CLAUDE_PLUGIN_ROOT}, ${CLAUDE_PLUGIN_DATA}, ${CLAUDE_PROJECT_DIR}, ${user_config.*}, and ${ENV_VAR} are substituted. Runs in the session cwd — prefix with `cd "${CLAUDE_PLUGIN_ROOT}" && ` if the script needs its own directory.'),description:g().min(1).describe("Short human-readable description of what is being monitored (shown in task panel and notification summary)."),when:ie([z("always"),g().startsWith("on-skill-invoke:").refine((e)=>e.length>16,{message:"on-skill-invoke: must specify a skill name"})]).default("always").describe('Arm trigger. "always" arms at session start and on plugin reload. "on-skill-invoke:<skill>" arms the first time that skill is dispatched (via Skill tool or slash command).')})),Dqe=D(()=>I(Iqe()).refine((e)=>new Set(e.map((t)=>t.name)).size===e.length,{message:"Monitor names must be unique within a plugin"})),mY=D(()=>A({monitors:ie([Ma().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),Dqe()]).describe("Background watch scripts the host arms as persistent Monitor tasks (unsandboxed, same trust tier as hooks) so plugins need not instruct the model to arm them. When omitted, monitors/monitors.json at the plugin root is loaded if present.")})),Lqe=D(()=>A({lspServers:ie([Ma().describe("Path to .lsp.json configuration file relative to plugin root"),V(g(),oY()).describe("LSP server configurations keyed by server name"),I(ie([Ma().describe("Path to LSP configuration file"),V(g(),oY()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),hY=D(()=>g().refine((e)=>!e.includes("..")&&!e.includes("//"),"Package name cannot contain path traversal patterns").refine((e)=>{let t=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,n=/^[a-z0-9][a-z0-9-._]*$/;return t.test(e)||n.test(e)},"Invalid npm package name format")),Mqe=/^[a-z0-9](?:[a-z0-9._-]*[a-z0-9_-])?$/,Nqe=/^[0-9a-f]{64}$/;var Uqe=64;var Fqe=D(()=>A({sha256:g().regex(Nqe)}));function zqe(e){let t=V(g(),xe()).safeParse(e);if(!t.success)return;let n=Object.create(null),r=0;for(let[o,s]of Object.entries(t.data)){if(r>=Uqe)break;let i=Fqe().safeParse(s);if(Mqe.test(o)&&i.success)n[o]=i.data,r++}return r>0?n:void 0}var $qe=D(()=>A({binaries:xe().transform(zqe).describe("sha256-pinned files to fetch into bin/ at install time, keyed by basename (target triple encoded in the name)")})),jqe=D(()=>A({settings:V(g(),xe()).optional().describe("Settings to merge into the user settings while this plugin is enabled. Only the documented allowlisted keys are applied.")})),Hqe=D(()=>A({experimental:ot((e)=>Qn(e)?e:void 0,A({...pY().partial().shape,...Tqe().partial().shape,...mY().partial().shape,...dY().partial().shape,evals:xqe().optional().describe("Directory of eval cases for the plugin evaluation harness, relative to the plugin root (default: evals/). A list is accepted; its first entry is the case directory.")}).passthrough().optional().describe("Components whose manifest shape may change without a deprecation cycle. Move a key out of here once it is promoted to stable."))}));var Bqe=D(()=>A({...gqe().shape,..._qe().partial().shape,...bqe().partial().shape,...Sqe().partial().shape,...Eqe().partial().shape,...dY().partial().shape,...pY().partial().shape,...kqe().shape,...Pqe().partial().shape,...Rqe().partial().shape,...Lqe().partial().shape,...mY().partial().shape,...jqe().partial().shape,...Oqe().partial().shape,...$qe().partial().shape,...Hqe().partial().shape})),gY=new Set(["url","github","git","npm","file","directory","skills-dir","hostPattern","pathPattern","settings"]),bu=D(()=>Ri("source",[A({source:z("url"),url:g().url().describe("Direct URL to marketplace.json file"),headers:V(g(),g()).optional().describe("Custom HTTP headers (e.g., for authentication)"),headersHelper:VO().optional().describe("Command that prints a JSON object of HTTP headers (e.g. a short-lived auth token). Its output overrides `headers` and, like `headers`, is inherited by same-origin archive downloads from this marketplace. Runs from a fixed directory (the Claude config home, never the session's), so give a bare command found via PATH or an absolute path; it is re-run on later refreshes of this marketplace.")}),A({source:z("github"),repo:g().describe('GitHub repository in owner/repo format. ONLY in the managed-settings policy lists (strictKnownMarketplaces / blockedMarketplaces) the owner-wildcard form "owner/*" matches every repository under exactly that owner. Everywhere else (marketplace add, extraKnownMarketplaces, known_marketplaces.json) the value '+"must name a single repository — a wildcard is taken literally and fails to clone."),ref:g().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:g().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:I(g()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.'),skipLfs:R().optional().describe("Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.")}),A({source:z("git"),url:g().describe("Full git repository URL"),ref:g().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:g().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:I(g()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.'),skipLfs:R().optional().describe("Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.")}),A({source:z("npm"),package:hY().describe("NPM package containing marketplace.json")}),A({source:z("file"),path:g().describe("Local file path to marketplace.json")}),A({source:z("directory"),path:g().describe("Local directory containing .claude-plugin/marketplace.json")}),A({source:z("skills-dir")}).describe("Policy-list sentinel for the ~/.claude/skills/ auto-load (@skills-dir plugins). In strictKnownMarketplaces: opt the scan back IN (by default any allowlist blocks it). In blockedMarketplaces: turn the scan OFF without otherwise restricting marketplaces. Only meaningful in those two managed-settings lists (areLocalPluginDirsAllowedByPolicy); known_marketplaces.json / marketplace add etc. ignore it."),A({source:z("hostPattern"),hostPattern:g().describe('Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against github.com. For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., "^github\\.mycompany\\.com$").')}),A({source:z("pathPattern"),pathPattern:g().describe('Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use ".*" to allow all filesystem paths, or a narrower pattern (e.g., "^/opt/approved/") to restrict to specific directories.')}),A({source:z("settings"),name:uY().refine((e)=>!cY.has(e.toLowerCase()),{message:"Reserved marketplace names cannot be used with settings sources. validateOfficialNameSource only accepts github/git sources from anthropics/* for these names; a settings source would be rejected after loadAndCacheMarketplace has already written to disk with cleanupNeeded=false."}).describe("Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation "+"as PluginMarketplaceSchema plus reserved-name rejection — "+"validateOfficialNameSource runs after the disk write, too late to clean up."),plugins:I(Vqe()).describe("Plugin entries declared inline in settings.json"),owner:ZO().optional()}).describe("Inline marketplace manifest defined directly in settings.json. The reconciler writes a synthetic marketplace.json to the cache; diffMarketplaces detects edits via isEqual on the stored source (the plugins array is inside this object, so edits surface as sourceChanged).")])),BO=D(()=>g().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),Kqe=D(()=>g().regex(/^[0-9a-fA-F]{64}$/,"Must be a 64-character hex SHA-256 digest"));function WO(e){let t=e.toLowerCase().replace(/^\[|\]$/g,"");if(t.endsWith("."))t=t.slice(0,-1);if(t===""||t==="localhost"||t.endsWith(".localhost"))return!0;if(aqe(t)){let[s=0,i=0,a=0,c=0]=t.split(".").map(Number);return s===127||s===169&&i===254||s===0||s===100&&i===100&&a===100&&c===200}if(!cqe(t))return!1;let n=/^::ffff:(\d+\.\d+\.\d+\.\d+)$/.exec(t);if(n?.[1])return WO(n[1]);let r=/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/.exec(t);if(r?.[1]!==void 0&&r[2]!==void 0){let s=parseInt(r[1],16),i=parseInt(r[2],16);return WO(`${s>>8}.${s&255}.${i>>8}.${i&255}`)}if(t==="::1"||t==="::"||t==="fd00:ec2::254")return!0;let o=parseInt(/^([0-9a-f]{1,4}):/.exec(t)?.[1]??"0",16);return o>=65152&&o<=65215}var Gqe="Archive URLs must use https:// and must not point at a loopback, link-local, or cloud-metadata host";function Wqe(e){try{let t=new URL(e);return t.protocol==="https:"&&!WO(t.hostname)}catch{return!1}}var qqe=D(()=>A({source:z("archive"),url:g().url().refine(Wqe,{message:Gqe}).describe("HTTPS URL of a zip archive containing the plugin. The plugin root (the directory holding .claude-plugin/) may be at the top of the archive "+"or nested one directory deep — a single wrapping directory is stripped."),sha256:Kqe().optional().describe("SHA-256 digest of the archive. When set, every download is verified against it and the install is refused on mismatch. It also serves as the version identity when neither plugin.json nor the marketplace entry declares a `version`. Recommended. Note the update signal is the version string (plugin.json "+"version, else the entry version, else this digest) — changing only the digest "+"while a version is declared does not trigger an update.")}).describe("Plugin distributed as a zip archive fetched over HTTPS — for hosting on any "+"static file server or artifact repository (S3, GitLab, nginx) with no git or npm on the client. Authentication: the entry's own `headers` / `headersHelper` (bound to this URL), overlaid on the enclosing url-source marketplace's headers (static or `headersHelper`-minted) when the archive shares its origin.")),_Y=D(()=>ie([ot((e)=>e==="."?"./":e,zo()).describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),A({source:z("npm"),package:hY().or(g().refine((e)=>/^(?:file|https?|git(?:\+https?|\+ssh)?|ssh|github|gitlab|bitbucket):/i.test(e)||!e.includes(".."),'Package reference cannot contain ".." path segments')).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:g().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:g().url().optional().describe("Custom NPM registry URL (defaults to using system default, likely npmjs.org)")}).describe("NPM package as plugin source"),A({source:z("url"),url:g().describe("Full git repository URL (https:// or git@)"),ref:g().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:BO().optional().describe("Specific commit SHA to use")}),A({source:z("github"),repo:g().describe("GitHub repository in owner/repo format"),ref:g().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:BO().optional().describe("Specific commit SHA to use")}),A({source:z("git-subdir"),url:g().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:g().min(1).describe('Subdirectory within the repo containing the plugin (e.g., "tools/claude-plugin"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.'),ref:g().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:BO().optional().describe("Specific commit SHA to use")}).describe("Plugin located in a subdirectory of a larger repository (monorepo). Only the specified subdirectory is materialized; the rest of the repo is not downloaded."),qqe(),A({source:z("command"),command:g().min(1).max(qO,{message:"command must not be longer than the install consent UI can display"}).refine((e)=>!aY.test(e),{message:"command must be printable ASCII (letters, digits, punctuation, single spaces) with no runs of 4 or more spaces"}).describe("Shell command that prints the absolute path of the plugin directory on stdout (exactly one line) and exits 0. It must leave a complete plugin in that directory before exiting; the directory is copied into the plugin cache, so the printed path may change between runs (it is re-resolved on every install and update, and once per session in the background). Runs through the platform shell (sh on macOS/Linux, cmd.exe on Windows) from the user's home directory with Claude Code's subprocess environment."),timeout:K().int().positive().max(600).optional().describe("Seconds to wait for the command before giving up (default: 60)"),mode:Z(["copy","link"]).optional().describe("copy (default): the printed directory is copied into the plugin cache and content-hashed, so it may be deleted afterwards. link: the cache entry links to the printed directory "+"in place (no copy, no size limit; macOS/Linux) — for large exports; the directory must then stay "+"valid while Claude Code runs, and a different printed path is what signals new content.")}).describe("Plugin directory produced by a locally installed tool (e.g. an IDE that renders its plugin for the currently selected SDK). Claude Code runs the command, copies the directory it prints, and re-runs it in the background at startup to pick up changes."),A({source:z("unsupported"),error:g().optional()}).describe("Placeholder for source types this Claude Code version does not recognize, or a known type whose fields failed validation (then `error` "+"holds the reason). Never authored by hand — PluginMarketplaceSchema rewrites "+"unparseable sources to this so the entry remains in marketplace.plugins (detectDelistedPlugins must not see it as removed). Install attempts fail at cachePlugin with an actionable message.")])),Vqe=D(()=>A({name:g().min(1,"Plugin name cannot be empty").refine((e)=>!e.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Plugin name as it appears in the target repository"),source:_Y().describe("Where to fetch the plugin from. Must be a remote source — relative "+"paths have no marketplace repository to resolve against."),description:g().optional(),version:g().optional(),strict:R().optional(),headers:V(g(),g()).optional().describe("HTTP headers sent when downloading this entry's `archive` source."),headersHelper:VO().optional().describe("Command that prints a JSON object of HTTP headers for downloading this entry's `archive` source. Runs only when a user explicitly installs or updates this plugin. Unlike a catalog entry, an entry written here does not need `strict: false`: it is declared in a settings file, which has no manifest fields to inline. A declaration in project settings is not operator-authored, so request-routing and client-identity header names are still filtered there. Use an absolute path.")}).refine((e)=>typeof e.source!=="string",{message:'Plugins in a settings-sourced marketplace must use remote sources (github, git-subdir, npm, url, archive, command). Relative-path sources like "./foo" have no marketplace repository to resolve against.'}).refine((e)=>typeof e.source==="string"||e.source.source!=="unsupported",{message:"source.source: 'unsupported' is a parse-time placeholder and cannot be authored. Use a remote source (github, git-subdir, npm, url, archive, command)."}));var Zqe=D(()=>A({cli:I(g().max(64)).max(10).optional().describe('First command tokens (e.g. ["stripe"]) — exact match against commands run this session.'),hosts:I(g().max(128)).max(20).optional().describe('Hostnames (e.g. ["api.stripe.com"]) — exact, case-insensitive match against '+"hostnames seen in https?:// URLs in bash commands run this session. Bare hostname only: lowercase, no scheme, no port, no path."),filesRead:I(g().max(256)).max(10).optional().describe('Glob patterns (e.g. ["**/*.tf"]) — the plugin is relevant when a file Claude has read '+"this session matches any pattern. Matched against read-file paths, forward-slash normalized, case-insensitive."),manifestDeps:I(A({file:g().max(256),pattern:g().max(256)})).max(10).optional().describe("Dependency declared in a package manifest. Each {file, pattern} is a pair of RegExp sources: "+"`file` matches the manifest filename (package.json, go.mod, requirements.txt, …); "+"`pattern` matches the dependency declaration inside that file. Evaluated against files read this session."),cwd:I(g().max(256)).max(10).optional().describe('Glob patterns (e.g. ["Engine/Source/Runtime/Renderer/**"]) — the plugin is relevant when the '+`session's working directory is at or under a directory matching the pattern. Matched against the cwd both relative to the enclosing git repo root and as an absolute path, forward-slash normalized, case-insensitive. A bare directory (no glob characters) means "cwd is at or under this directory". Known at session start, so this signal can surface a suggestion before the first turn.`)})),Yqe=D(()=>A({topic:g().max(64).optional().describe('What the user is working with when this plugin is relevant — fills "Working with {topic}?". '+'Often the product name (e.g. "Stripe"); use a domain (e.g. "design") when the plugin name does not read naturally as a topic. Defaults to the plugin name with each hyphen-segment capitalized.'),signals:Zqe().optional().describe("Matchers that determine when the plugin is relevant.")})),Jqe=D(()=>Bqe().partial().extend({name:g().min(1,"Plugin name cannot be empty").refine((e)=>!e.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier matching the plugin name"),source:_Y().describe("Where to fetch the plugin from"),headers:V(g(),g()).optional().describe("Custom HTTP headers for fetching this plugin's archive; overrides the marketplace's"),headersHelper:VO().optional().describe("Command that prints a JSON object of HTTP headers for fetching this plugin's archive (e.g. a short-lived auth token); overrides this entry's `headers` and the marketplace's. Runs only when the user installs or updates this plugin, never during catalog browse. An entry that sets it must be `strict: false` with its manifest inlined here, so consent is informed from the entry alone before the command runs."),category:g().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:I(g()).optional().describe("Tags for searchability and discovery"),strict:R().optional().default(!0).describe("Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest."),relevance:ot((e)=>Qn(e)?e:void 0,Yqe().optional()).describe(`Declares when this plugin is relevant to the user's work. Consumed by the spinner tip ("Working with {topic}?"), session-start auto-suggest, and marketplace browse ranking.`)})),Xqe=D(()=>A({name:g().min(1).refine((e)=>!e.includes(" "))}));function Qqe(e){let t=Jqe();return e.flatMap((n,r)=>{let o=t.safeParse(n);if(o.success){let a=o.data.source;if(typeof a==="object"&&a.source==="unsupported"&&a.error!==void 0)return[{...o.data,source:{source:"unsupported"}}];return[o.data]}let s=Xqe().safeParse(n).data?.name,i=o.error.issues.map((a)=>`${a.path.join(".")}: ${a.message}`).join(", ");if(s){de(`Stubbing unparseable marketplace plugin entry (${s}): ${i}`,{level:"warn"});let a=yY(Qn(n)?n.source:void 0)?iVe:YO(n)?void 0:tVe(o.error.issues)??hb(o.error.issues);return[{name:s,source:{source:"unsupported",...a&&{error:a}},strict:!0}]}return de(`Dropping unparseable marketplace plugin entry (index ${r}): ${i}`,{level:"warn"}),[]})}var eVe=new Set(["npm","url","github","git-subdir","archive","command","unsupported"]);function YO(e){if(!e||typeof e!=="object")return!1;let t=e.source;if(!t||typeof t!=="object")return!1;let n=t.source;return typeof n==="string"&&!eVe.has(n)}function tVe(e){let t=e.find((r)=>r.path.length===1&&r.path[0]==="source");if(!t||t.code!=="invalid_union")return;let n=t.errors.find((r)=>!r.some((o)=>o.path.length===0||o.code==="invalid_value"&&o.path[0]==="source"));if(!n||n.length===0)return;return hb(n.map((r)=>({...r,path:["source",...r.path]})))}var nVe=/^[A-Za-z0-9_$.-]{1,40}$/;function yu(e){return nVe.test(e)?e:"<key>"}var rVe=3,oVe=160;function hb(e){let t=e.slice(0,rVe).map((r)=>{let o=r.path.map(String).map((i)=>yu(i)).join("."),s=r.code==="unrecognized_keys"?`Unrecognized ${r.keys.length===1?"field":"fields"}: ${r.keys.map(yu).join(", ")}`:Q5(r.message,oVe);return o?`${o}: ${s}`:s}),n=e.length-t.length;return n>0?`${t.join(", ")} (+${n} more)`:t.join(", ")}var sVe=/^[A-Za-z0-9][-A-Za-z0-9._]*$/,iVe='Bare source names resolve under metadata.pluginRoot, which this marketplace does not set (or sets to a path outside the marketplace root). Use a "./relative/path" source, or set metadata.pluginRoot to allow bare names.';function yY(e){return typeof e==="string"&&sVe.test(e)&&!e.includes("..")}function aVe(e){if(typeof e!=="string"||e===""||e.startsWith("/")||e.includes("\\")||e.includes(":"))return;let t=e.replace(/^\.\//,"").replace(/\/+$/,"");if(t===""||t===".")return".";if(t.split("/").some((n)=>n===""||n==="."||n===".."))return;return t}function cVe(e,t){if(t===void 0||!Qn(e)||!yY(e.source))return e;let n=t==="."?`./${e.source}`:`./${t}/${e.source}`;return{...e,source:n}}function lVe(e){if(!Qn(e)||!Array.isArray(e.plugins))return e;let t=Qn(e.metadata)?aVe(e.metadata.pluginRoot):void 0;if(t===void 0)return e;return{...e,plugins:e.plugins.map((n)=>cVe(n,t))}}var uVe=D(()=>A({$schema:g().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:uY(),version:g().optional().describe("Marketplace manifest version"),description:g().optional().describe("Human-readable description of this marketplace"),owner:ZO().describe("Marketplace maintainer or curator information"),plugins:I(xe()).transform(Qqe).describe("Collection of available plugins in this marketplace"),forceRemoveDeletedPlugins:R().optional().describe("When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users"),metadata:A({pluginRoot:g().optional().describe('Base directory for bare plugin source names, relative to the marketplace root (e.g. "./plugins" resolves "source": "formatter" as ./plugins/formatter). Sources that already start with "./" are unaffected.'),version:g().optional().describe("Marketplace version"),description:g().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata"),allowCrossMarketplaceDependenciesOn:I(g()).optional().describe("Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies — no transitive trust."),renames:V(g(),g().nullable()).optional().catch(void 0).describe("Append-only map of old plugin name → current name (or null when removed). The loader follows this on plugin-not-found and migrates user settings to the new name.")})),I0t=D(()=>ot(lVe,uVe())),sY="[A-Za-z0-9][-A-Za-z0-9._]*",bY=D(()=>g().regex(new RegExp(`^${sY}@${sY}$`),"Plugin ID must be in format: plugin@marketplace")),D0t=new RegExp(`[@:\\s/\\\\${Ml}]`,"u"),L0t=new RegExp(`[${Ml}]`,"u"),dVe=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,pVe=D(()=>ie([g().regex(dVe,"Dependency must be a plugin name, optionally qualified with @marketplace").transform((e)=>e.replace(/@\^[^@]*$/,"")),A({name:g().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/),marketplace:g().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/).optional()}).loose().transform((e)=>e.marketplace?`${e.name}@${e.marketplace}`:e.name)])),fVe=D(()=>A({version:g().describe("Currently installed version"),installedAt:g().describe("ISO 8601 timestamp of installation"),lastUpdated:g().optional().describe("ISO 8601 timestamp of last update"),installPath:g().describe("Absolute path to the installed plugin directory"),gitCommitSha:g().optional().describe("Git commit SHA for git-based plugins (for version tracking)"),resolvedVersion:g().optional().describe("Tag-derived semver this install resolved to (when fetched via a version constraint). Used by verifyAndDemote in preference to manifest.version, since the upstream may have forgotten to bump plugin.json."),auto:R().optional().describe("True when this plugin was pulled in as a dependency rather than installed explicitly. Auto-installed plugins are eligible for removal by the orphan sweep when nothing depends on them. Absent = manual (preserves pre-flag installs)."),...iY()})),M0t=D(()=>A({version:z(1).describe("Schema version 1"),plugins:V(bY(),fVe()).describe("Map of plugin IDs to their installation metadata")})),mVe=D(()=>Z(["managed","user","project","local"])),hVe=D(()=>A({scope:mVe().describe("Installation scope"),projectPath:g().optional().describe("Project path (required for project/local scopes)"),installPath:g().describe("Absolute path to the versioned plugin directory"),version:g().optional().describe("Currently installed version"),installedAt:g().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:g().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:g().optional().describe("Git commit SHA for git-based plugins"),resolvedVersion:g().optional().describe("Tag-derived semver this install resolved to"),auto:R().optional().describe("True when pulled in as a dependency. Eligible for orphan sweep."),...iY()})),N0t=D(()=>A({version:z(2).describe("Schema version 2"),plugins:V(bY(),I(hVe())).describe("Map of plugin IDs to arrays of installation entries")})),gVe=D(()=>A({source:bu().describe("Where to fetch the marketplace from"),installLocation:g().describe("Local cache path where marketplace manifest is stored"),lastUpdated:g().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:R().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),U0t=D(()=>V(g(),gVe()));var gb=["aspell","hunspell","ispell"];var _Ve=["autoMode","deepLink","voice","briefView","screenReader"],JO={},_b={autoMode:{buildGate:()=>!1,shape:()=>JO,permissionsShape:()=>JO,permissionModes:()=>[]},deepLink:{buildGate:()=>!0,shape:()=>({disableDeepLinkRegistration:Z(["disable"]).optional().describe("Prevent claude-cli:// protocol handler registration with the OS")})},voice:{buildGate:()=>!0,shape:()=>({voiceEnabled:R().optional().describe("Enable voice mode (hold-to-talk dictation)")})},briefView:{buildGate:()=>!0,shape:()=>({defaultView:Z(["chat","transcript"]).optional().describe("Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)")})},screenReader:{buildGate:()=>!1,shape:()=>JO}};function sm(){return _Ve.filter((e)=>_b[e].buildGate())}function SY(e){let t={};for(let n of e)t={...t,..._b[n].shape()};return t}function EY(e){let t={};for(let n of e)t={...t,..._b[n].permissionsShape?.()};return t}function xY(e){let t=[];for(let n of e)t.push(..._b[n].permissionModes?.()??[]);return t}var vY={Task:"Agent",KillShell:"TaskStop",KillBash:"TaskStop",AgentOutputTool:"TaskOutput",BashOutputTool:"TaskOutput",AgentOutput:"TaskOutput",BashOutput:"TaskOutput",ListPeers:"ListAgents",Brief:"SendUserMessage",ListMcpResources:"ListMcpResourcesTool",ReadMcpResource:"ReadMcpResourceTool",ReadMcpResourceDir:"ReadMcpResourceDirTool"};function Su(e){return Object.hasOwn(vY,e)?vY[e]:e}var wY="workspace",K0t=`mcp__${wY}__bash`,G0t=`mcp__${wY}__web_fetch`;function yb(e){return e.includes("*")}function yVe(e){return e.replaceAll("\\","\\\\").replaceAll("(","\\(").replaceAll(")","\\)")}function bVe(e){return e.replaceAll("\\(","(").replaceAll("\\)",")").replaceAll("\\\\","\\")}function AY(e){let t=SVe(e,"(");if(t===-1)return{toolName:Su(e)};let n=EVe(e,")");if(n===-1||n<=t)return{toolName:Su(e)};if(n!==e.length-1)return{toolName:Su(e)};let r=e.substring(0,t),o=e.substring(t+1,n);if(!r)return{toolName:Su(e)};if(o===""||o==="*")return{toolName:Su(r)};let s=bVe(o);return{toolName:Su(r),ruleContent:s}}function XO(e){if(!e.ruleContent)return e.toolName;let t=yVe(e.ruleContent);return`${e.toolName}(${t})`}function SVe(e,t){for(let n=0;n<e.length;n++)if(e[n]===t){let r=0,o=n-1;while(o>=0&&e[o]==="\\")r++,o--;if(r%2===0)return n}return-1}function EVe(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]===t){let r=0,o=n-1;while(o>=0&&e[o]==="\\")r++,o--;if(r%2===0)return n}return-1}function QO(e){let t=e.split("__"),[n,r,...o]=t;if(n!=="mcp"||!r)return null;let s=o.length>0?o.join("__"):void 0;return{serverName:r,toolName:s}}var bb={filePatternTools:["Read","Write","Edit","Glob","NotebookRead","NotebookEdit","Cd"],bashPrefixTools:["Bash"],customValidation:{WebSearch:(e)=>{if(e.includes("*")||e.includes("?"))return{valid:!1,error:"WebSearch does not support wildcards",suggestion:"Use exact search terms without * or ?",examples:["WebSearch(claude ai)","WebSearch(typescript tutorial)"]};return{valid:!0}},WebFetch:(e)=>{if(e.includes("://")||e.startsWith("http"))return{valid:!1,error:"WebFetch permissions use domain format, not URLs",suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:github.com)"]};if(!e.startsWith("domain:"))return{valid:!1,error:'WebFetch permissions must use "domain:" prefix',suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:*.google.com)"]};return{valid:!0}}}};function TY(e){return bb.filePatternTools.includes(e)}function kY(e){return bb.bashPrefixTools.includes(e)}function CY(e){return Object.hasOwn(bb.customValidation,e)?bb.customValidation[e]:void 0}function OY(e,t){let n=0,r=t-1;while(r>=0&&e[r]==="\\")n++,r--;return n%2!==0}function eP(e,t){let n=0;for(let r=0;r<e.length;r++)if(e[r]===t&&!OY(e,r))n++;return n}function xVe(e){for(let t=0;t<e.length-1;t++)if(e[t]==="("&&e[t+1]===")"){if(!OY(e,t))return!0}return!1}function RY(e){if(!yb(e))return null;let t=QO(e);if(t&&!yb(t.serverName))return null;return{valid:!1,error:`Wildcard tool name "${e}" is not supported in allow rules`,suggestion:"An allow pattern must name the scope it widens — globs are permitted only in the tool position after a literal mcp__<server>__ prefix. Deny and ask rules accept wildcards anywhere",examples:["mcp__puppeteer__*","mcp__github__get_*"]}}function tP(e,t){if(!e||e.trim()==="")return{valid:!1,error:"Permission rule cannot be empty"};let n=eP(e,"("),r=eP(e,")");if(n!==r)return{valid:!1,error:"Mismatched parentheses",suggestion:"Ensure all opening parentheses have matching closing parentheses"};if(xVe(e)){let a=e.substring(0,e.indexOf("("));if(!a)return{valid:!1,error:"Empty parentheses with no tool name",suggestion:"Specify a tool name before the parentheses"};return{valid:!1,error:"Empty parentheses",suggestion:`Either specify a pattern or use just "${a}" without parentheses`,examples:[`${a}`,`${a}(some-pattern)`]}}let o=AY(e),s=QO(o.toolName);if(s){if(o.ruleContent!==void 0||eP(e,"(")>0)return{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:`Use "${o.toolName}" without parentheses, or use "mcp__${s.serverName}__*" for all tools`,examples:[`mcp__${s.serverName}`,`mcp__${s.serverName}__*`,s.toolName&&s.toolName!=="*"?`mcp__${s.serverName}__${s.toolName}`:void 0].filter(Boolean)};if(t==="allow"){let a=RY(o.toolName);if(a)return a}return{valid:!0}}if(!o.toolName||o.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(t==="allow"){let a=RY(o.toolName);if(a)return a}if(!o.toolName.includes("_")&&o.toolName[0]!==o.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${Ru(String(o.toolName))}"`};let i=CY(o.toolName);if(i&&o.ruleContent!==void 0){let a=i(o.ruleContent);if(!a.valid)return a}if(kY(o.toolName)&&o.ruleContent!==void 0){let a=o.ruleContent;if(a.includes(":*")&&!a.endsWith(":*"))return{valid:!1,error:"The :* pattern must be at the end",suggestion:"Move :* to the end for prefix matching, or use * for wildcard matching",examples:["Bash(npm run:*) - prefix matching (legacy)","Bash(npm run *) - wildcard matching"]};if(a===":*")return{valid:!1,error:"Prefix cannot be empty before :*",suggestion:"Specify a command prefix before :*",examples:["Bash(npm *)","Bash(git *)"]}}if(TY(o.toolName)&&o.ruleContent!==void 0){if(o.ruleContent.includes(":*"))return{valid:!1,error:'The ":*" syntax is only for Bash prefix rules',suggestion:'Use glob patterns like "*" or "**" for file matching',examples:[`${o.toolName}(*.ts) - matches .ts files`,`${o.toolName}(src/**) - matches all files in src`,`${o.toolName}(**/*.test.ts) - matches test files`]}}if(o.ruleContent!==void 0){let a=o.toolName==="Write"||o.toolName==="NotebookEdit"||o.toolName==="MultiEdit"?"Edit":o.toolName==="Glob"?"Read":void 0;if(a!==void 0&&!o.ruleContent.includes(":*"))return{valid:!0,warning:`${XO(o)} is not matched by file permission checks — only ${a}(path) rules are. Use ${XO({toolName:a,ruleContent:o.ruleContent})} instead (${a} rules cover all file-${a==="Edit"?"editing":"reading"} tools).`}}return{valid:!0}}var nP=D(()=>IY()),PY=D(()=>IY("allow"));function IY(e){return g().superRefine((t,n)=>{let r=tP(t,e);if(!r.valid){let o=r.error;if(r.suggestion)o+=`. ${r.suggestion}`;if(r.examples&&r.examples.length>0)o+=`. Examples: ${r.examples.join(", ")}`;n.addIssue({code:vr.custom,message:o,params:{received:t}})}})}var vVe=D(()=>V(g(),Zm.string()));function $Y(e){return A({allow:I(PY()).optional().describe("List of permission rules for allowed operations"),deny:I(nP()).optional().describe("List of permission rules for denied operations"),ask:I(nP()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:ot(nm,Z([...tm,...xY(e)])).optional().describe("Default permission mode when Claude Code needs access ('manual' is accepted as an alias for 'default')"),disableBypassPermissionsMode:Z(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),...EY(e),additionalDirectories:I(g()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}var xLt=D(()=>$Y(sm())),sP=D(()=>A({source:bu().describe("Where to fetch the marketplace from"),installLocation:g().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)"),autoUpdate:R().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),xb=D(()=>A({serverName:g().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that users are allowed to configure"),serverCommand:I(g()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for allowed stdio servers"),serverUrl:g().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine((e)=>Ap([e.serverName!==void 0,e.serverCommand!==void 0,e.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),vb=D(()=>A({serverName:g().min(1,"Server name must be non-empty").refine((e)=>e.trim().length>0,{message:"Server name must not be whitespace-only"}).refine((e)=>e===e.trim(),{message:"Server name has leading or trailing whitespace and will never match (names are compared verbatim)"}).optional().describe("Name of the MCP server that is explicitly blocked"),serverCommand:I(g()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for blocked stdio servers"),serverUrl:g().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers')}).refine((e)=>Ap([e.serverName!==void 0,e.serverCommand!==void 0,e.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),wVe=/[\x00-\x1f\x7f-\x9f\u2028\u2029]|\p{DI}/u;function AVe(e){let t=e.replaceAll("/","\\");if(Ha(t))return!1;return/^\\{2}[^\\]/.test(t)}function TVe(e){return _s(e)||/^\/network\/servers(\/|$)/i.test(e)}function kVe(e){return/^\/(proc|dev\/(fd|stdin|stdout|stderr))(\/|$)/i.test(e)}function CVe(e,t,n={}){if(t==="win32"){let r=e.replaceAll("/","\\");if(Ha(r))return!1;let o=AVe(r);if(n.rejectUnc&&o)return!1;if(n.rejectDriveRelative){if(!/^[A-Za-z]:\\/.test(r)&&!o&&/^(\\|[A-Za-z]:)/.test(r))return!1}if(zY.normalize(r)!==r)return!1;let s=r.split("\\");if(s.some((a)=>a==="."||a===".."))return!1;if(s.some((a,c)=>/[. ]$/.test(a)||a.includes(":")&&!(c===0&&/^[A-Za-z]:$/.test(a))))return!1;let i=r.startsWith("\\\\")?r.slice(2):r;if(/\\{2}/.test(i))return!1;return!r.endsWith("\\")||/^([A-Za-z]:)?\\$/.test(r)}if(n.rejectNetworkRoot&&TVe(e))return!1;if(n.rejectMagicLinkRoot&&kVe(e))return!1;if(FY.normalize(e)!==e)return!1;if(e.split("/").some((r)=>r==="."||r===".."))return!1;if(/\/{2}/.test(e))return!1;return!e.endsWith("/")||e==="/"}var RVe=/\.(exe|ps1)$/i;function OVe(e){return/\.ps1$/i.test(e)}function PVe(e){return OVe(e)&&/[[\]`*?]/.test(e)}var IVe='a .ps1 path must not contain "[", "]", "`", "*", or "?" on Windows (PowerShell resolves them as wildcard syntax)',DVe=()=>g().describe("Absolute path to the helper executable"),im=(e)=>ot((t)=>t===null?void 0:t,e.optional()).optional(),DY=["path","script","defaultSettings"];function jY(e){if(!e||typeof e!=="object"||Array.isArray(e))return!1;let t=e;return DY.some((n)=>t[n]===null)&&DY.every((n)=>t[n]===null||t[n]===void 0)}var Eb=D(()=>A({path:DVe(),timeoutMs:im(K().int().min(1000)),refreshIntervalMs:im(ie([z(0),K().int().min(60000)]))})),LVe=(e)=>(e==="windows"?z("pwsh",{message:"interpreter must be 'pwsh' on windows ('sh' is not supported there)"}):z("sh",{message:"interpreter must be 'sh' on macos/linux/wsl"})).describe("Fixed interpreter for `script`: 'sh' (/bin/sh) on macos/linux/wsl entries; 'pwsh' (PowerShell at its fixed install locations, never PATH) on the windows entry"),MVe="exactly one of path/script must be configured",NVe='"script" and "interpreter" must be configured together',UVe="script must be ASCII-only on Windows (PowerShell decodes stdin with the console OEM code page); spell non-ASCII characters as escapes, e.g. [char]0x00E9",FVe=(e)=>g({message:"script must be a string"}).min(1,{message:"script must not be empty"}).max(65536,{message:"script must be at most 65536 characters"}).refine((t)=>!t.includes("\x00"),{message:"script must not contain NUL bytes"}).refine((t)=>Em(t),{message:"script must be valid UTF-8 (no lone surrogates)"}).refine((t)=>e!=="windows"||!/[\u0080-\uffff]/.test(t),{message:UVe}).describe("Inline helper script, delivered to the fixed interpreter over stdin (never written to disk)");var hs=["macos","linux","windows","wsl"];function zVe(e){return e==="windows"?"win32":"posix"}function $Ve(e){return{rejectDriveRelative:e==="windows",rejectUnc:e==="windows",rejectNetworkRoot:e!=="windows",rejectMagicLinkRoot:e!=="windows",requireWin32ExecutableSuffix:e==="windows"}}function jVe(e){let t=zVe(e),n=$Ve(e);return g().max(1024,{message:"path must be at most 1024 characters"}).refine((r)=>!wVe.test(r),{message:"path must not contain control, line/paragraph-separator, or invisible (default-ignorable) characters"}).refine((r)=>(t==="win32"?zY:FY).isAbsolute(r),{message:"path must be absolute"}).refine((r)=>!(t==="win32"&&n.requireWin32ExecutableSuffix)||RVe.test(r),{message:"path must end in .exe or .ps1 on Windows"}).refine((r)=>t!=="win32"||!PVe(r),{message:IVe}).refine((r)=>CVe(r,t,n),{message:t==="win32"?'path must be in normalized form: no "." or ".." segments, no doubled or trailing separators, no component ending in "." or a space, no ":" outside the drive letter, no device-namespace (\\\\?\\) prefix, no drive-relative (\\dir or C:name) or UNC (\\\\server\\share) form':'path must be in normalized form: no "." or ".." segments, no doubled or trailing separators, and not under a network automount root (/net/<host>, /Network/Servers) or a kernel magic-link root (/proc, /dev/fd)'}).describe("Absolute path to the helper executable")}var iP=[...hs,"default"],rP=["path","script","interpreter","timeoutMs","refreshIntervalMs","defaultSettings"],Sb=["managedSettings","appendSystemPrompt"],Na=D(()=>V(g(),xe()).superRefine((e,t)=>{for(let n of["policyHelper","policyHelpers"])if(e[n]!==void 0&&e[n]!==null)t.addIssue({code:"custom",message:`must not contain "${n}" — the default payload is applied as managed settings and cannot configure further policy helpers`});for(let n of rP)if(e[n]!==void 0&&e[n]!==null)t.addIssue({code:"custom",message:`must not contain "${n}" — a static payload is a managed-settings object, not a policyHelpers entry; entry fields (${rP.join("/")}) belong on the per-OS entries (policyHelpers.${hs.join("/")})`});for(let n of Sb)if(e[n]!==void 0&&e[n]!==null)t.addIssue({code:"custom",message:`must not contain "${n}" — a static payload is the managedSettings SUBTREE, not the helper's stdout envelope; paste the object your helper emits UNDER "managedSettings", not the envelope around it`});for(let n of iP)if(e[n]!==void 0&&e[n]!==null)t.addIssue({code:"custom",message:`must not contain "${n}" — a static payload is the VALUE of a policyHelpers key (a managed-settings object), never another policyHelpers map; don't paste the map or its "${n}" line inside the slot`})})),HVe='Entry must carry "path" (a helper executable) or "script" + "interpreter" (an inline helper), and/or "defaultSettings" (a static settings payload)';function BVe(e){let{path:t,script:n,interpreter:r,defaultSettings:o}=e;if(t!==void 0&&n!==void 0)return MVe;if(n===void 0!==(r===void 0))return NVe;if(t===void 0&&n===void 0&&o===void 0)return HVe;return null}function HY(e,t){return Eb().omit({path:!0}).extend({path:im(jVe(e)),script:im(FVe(e)),interpreter:im(LVe(e)),defaultSettings:ot((n)=>n===null?void 0:n,t.optional()).optional()}).check((n)=>{if(n.issues.length>0)return;let r=BVe(n.value);if(r!==null)n.issues.push({code:"custom",message:r,input:n.value})})}var vLt=D(()=>HY("linux",Na()));function oP(e,t=Na()){return e==="default"?Na():HY(e,t)}var KVe=D(()=>A(Object.fromEntries(iP.map((e)=>[e,ot((t)=>{if(t===null)return;if(e!=="default"&&jY(t))return;return t},oP(e).optional()).optional()])))),LY=["skills","agents","hooks","mcp"],MY=Object.freeze({type:"invalid-entry-stripped"}),GVe=D(()=>ie([A({type:z("regex").describe('Config variant. This client understands "regex": matches turn output and builds a URL from named capture groups. Entries with other variants are preserved but skipped at runtime.'),pattern:g().describe("Regex matched against turn output (tool results and assistant text)"),url:g().describe("Link target. {name} placeholders are filled from named regex capture groups, e.g. (?<id>...) -> {id}. Values are URL-encoded; the origin must be literal in the template. The scheme must be https, http, or a recognized editor or workspace deep-link scheme: vscode, vscode-insiders, cursor, windsurf, zed, jetbrains, idea, slack, linear, notion, figma."),label:g().optional().describe("Badge text. {name} placeholders filled from named capture groups; defaults to the full match.")}).passthrough(),A({type:g().describe("Config variant discriminator for entries this client does not understand; the entry is preserved as-is and skipped at runtime.")}).passthrough()]));function wb(e,{strictPolicyHelperKeys:t=!1}={}){function n(o){return V(g(),sP()).check((s)=>{for(let[i,a]of Object.entries(s.value))if(a.source.source==="settings"&&a.source.name!==i)s.issues.push({code:"custom",input:a.source.name,path:[i,"source","name"],message:`Settings-sourced marketplace name must match its ${o} key (got key "${i}" but source.name "${a.source.name}")`})})}let r=(o,s)=>t?ot((i)=>{if(i===null)return;return s?s(i):i},o):o.catch(void 0);return A({$schema:g().optional().describe("JSON Schema reference for Claude Code settings"),apiKeyHelper:g().optional().describe("Path to a script that outputs authentication values"),proxyAuthHelper:g().optional().describe("Shell command that outputs a Proxy-Authorization header value (EAP)"),awsCredentialExport:g().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:g().optional().describe("Path to a script that refreshes AWS authentication"),gcpAuthRefresh:g().optional().describe("Command to refresh GCP authentication (e.g., gcloud auth application-default login)"),processWrapper:g().optional().describe("Corporate launcher argv prefix for the background-agent supervisor, the sessions and workers it hosts, and the other covered background processes listed in the Claude Code corporate-launcher documentation. Equivalent to the CLAUDE_CODE_PROCESS_WRAPPER environment variable, which takes precedence when set. Honored from managed settings, a --settings/SDK-supplied settings file, and user settings, in that precedence order; project and local settings are ignored."),policyHelper:r(Eb().optional(),(o)=>o&&typeof o==="object"&&!Array.isArray(o)&&o.path===null?void 0:o).describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),policyHelpers:r(KVe().optional()).describe(`@internal Per-OS variant of policyHelper, keyed by platform: macos, linux, windows, wsl, plus an optional "default" entry that is a STATIC settings payload (a JSON object of managed settings, not a helper). Each per-OS entry carries a helper — a "path", or an inline "script" + "interpreter" delivered to a fixed interpreter over stdin, either with timeoutMs/refreshIntervalMs — its own static "defaultSettings" payload, or both; an entry may be payload-only. Selection for a platform walks its chain (the platform's own entry; on wsl the linux entry next): the first helper on the chain wins over policyHelper; if no helper is configured — or the selected helper fails at startup or refresh — the first payload applies (the chain's "defaultSettings" in platform-specific-first order, then the top-level "default", applied with no process spawned; unrecognized platforms reach only "default"); with no payload either, policyHelper. Honored only from admin-controlled policy sources.`),...Cn.CLAUDE_CODE_ENABLE_XAA&&{xaaIdp:A({issuer:g().url().describe("IdP issuer URL for OIDC discovery"),clientId:g().describe("Claude Code's client_id registered at the IdP"),callbackPort:K().int().positive().optional().describe("Fixed loopback callback port for the IdP OIDC login. Only needed if the IdP does not honor RFC 8252 port-any matching.")}).optional().describe("XAA (SEP-990) IdP connection. Configure once; all XAA-enabled MCP servers reuse this.")},fileSuggestion:A({type:z("command"),command:g()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:R().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),breakReminder:A({enabled:R().optional().describe("Show a friendly nudge after sustained continuous use (default false). Must be true for the reminder to fire."),intervalMinutes:K().int().positive().optional().describe("Minutes of continuous use before the reminder fires (default 30). Re-fires every interval until you take a break."),breakThresholdMinutes:K().int().positive().optional().describe("Minutes of inactivity that count as a break and reset the timer (default 10)"),message:g().optional().describe("Custom reminder text. Leave unset for a rotating set of friendly nudges.")}).optional().describe("@internal Opt-in break reminder. When enabled, shows a dismissible nudge after sustained continuous use. Never blocks — just a friendly heads-up."),quietHours:A({enabled:R().optional().describe("Show a one-time nudge when you start or keep using the CLI inside your quiet-hours window (default false)."),start:g().regex(/^([01]?\d|2[0-3]):[0-5]\d$/,'Expected 24-hour local time "HH:MM" (e.g. "22:00")').optional().describe('Start of the quiet-hours window, 24-hour local time "HH:MM".'),end:g().regex(/^([01]?\d|2[0-3]):[0-5]\d$/,'Expected 24-hour local time "HH:MM" (e.g. "07:00")').optional().describe('End of the quiet-hours window, 24-hour local time "HH:MM". May be earlier than start for an overnight range.')}).optional().describe("@internal Opt-in quiet hours. When enabled, shows a single soft nudge per session while inside the configured local-time window. Never blocks."),cleanupPeriodDays:K().int().positive().optional().describe("Number of days to retain chat transcripts before automatic cleanup (default: 30). Minimum 1. Use a large value for long retention; use --no-session-persistence to disable transcript writes entirely."),syncClaudeAiSkills:R().optional().describe("Set to false to turn off syncing of the skills you have enabled on claude.ai. In your user settings (or managed settings): nothing more is downloaded, previously synced skills (~/.claude/skills/synced) can no longer be run, are hidden from every session started afterwards, and are moved to ~/.claude/skills/.trash at the next launch (deleted after cleanupPeriodDays; re-downloaded, not restored, if you re-enable). In .claude/settings.local.json or --settings: downloads stop and synced skills are blocked and hidden for sessions in that workspace or invocation only (nothing is moved). Not read from project settings (.claude/settings.json). Only false is honored — the feature is enabled server-side for your account, so setting true does not turn it on early. While it is on, synced skills are available in every session, re-synced every 10 minutes, and removed when you disable them on claude.ai. Only applies when signed in with your Claude account."),skillListingMaxDescChars:K().int().positive().optional().describe("Per-skill description character cap in the skill listing sent to Claude (default: 1536). Descriptions longer than this are truncated. Raise to opt in to higher per-turn context cost."),skillListingBudgetFraction:K().gt(0).lte(1).optional().describe("Fraction of the context window (in characters) reserved for the skill listing sent to Claude (default: 0.01 = 1%). When the listing exceeds this, descriptions are shortened to fit. Raise to opt in to higher per-turn context cost."),wslInheritsWindowsSettings:R().optional().describe("When set to true in either admin-only Windows source — the HKLM SOFTWARE/Policies/ClaudeCode registry key or C:/Program Files/ClaudeCode/managed-settings.json — WSL reads managed settings from the full Windows policy chain (HKLM, C:/Program Files/ClaudeCode via DrvFs, HKCU) in addition to /etc/claude-code. Windows sources take priority. The flag is also required in HKCU itself for HKCU policy to apply on WSL (double opt-in: admin enables the chain, user confirms HKCU). On native Windows the flag has no effect."),env:vVe().optional().describe("Environment variables to set for Claude Code sessions"),attribution:A({commit:g().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:g().optional().describe("Attribution text for pull request descriptions. Empty string hides attribution."),sessionUrl:R().optional().describe("Whether to append the claude.ai session link to commits and PRs created from web or Remote Control sessions (default: true). Set to false to omit the Claude-Session trailer and PR-body link."),...!1}).passthrough().optional().describe("Customize attribution text for commits and PRs. Each field defaults to the standard Claude Code attribution if not set."),includeCoAuthoredBy:R().optional().describe("Deprecated: Use attribution instead. Whether to include Claude's co-authored by attribution in commits and PRs (defaults to true)"),...!1,includeGitInstructions:R().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),permissions:$Y(e).optional().describe("Tool usage permissions configuration"),model:g().optional().describe("Override the default model used by Claude Code"),fallbackModel:I(g()).optional().describe('Fallback model(s) tried in order when the primary model is overloaded or unavailable. Each element accepts a model name or alias; "default" expands to the default model. CLI --fallback-model takes precedence.'),availableModels:I(g()).optional().describe('Allowlist of models that users can select. Accepts family aliases ("opus" allows any opus version), version prefixes ("opus-4-5" allows only that version), and full model IDs. If undefined, all models are available. If empty array, only the default model is available. Typically set in managed settings by enterprise administrators.'),enforceAvailableModels:R().optional().describe("When true and availableModels is a non-empty array, the Default model selection is also constrained: if the default model for the user tier is not in availableModels, Default resolves to the first allowed availableModels entry instead. Has no effect when availableModels is unset or an empty array. Typically set in managed settings by enterprise administrators."),modelOverrides:V(g(),g()).optional().describe('Override mapping from Anthropic model ID (e.g. "claude-opus-4-6") to provider-specific model ID (e.g. a Bedrock inference profile ARN). Typically set in managed settings by enterprise administrators.'),enableAllProjectMcpServers:R().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:I(g()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:I(g()).optional().describe("List of rejected MCP servers from .mcp.json"),disableClaudeAiConnectors:R().optional().describe("When true in any settings source, claude.ai MCP cloud connectors are not auto-fetched or connected. "+"Only gates auto-fetched connectors — a claudeai-proxy server passed explicitly "+"(e.g. via --mcp-config or the SDK mcpServers option) still follows the normal MCP config trust flow. Any-source-true wins: a project can opt out, but a project-level false cannot override a user-level true."),skillOverrides:V(g(),Z(["on","name-only","user-invocable-only","off"])).optional().describe('Per-skill listing overrides keyed by skill name. "name-only" lists the skill without its description; "user-invocable-only" hides it from the model but keeps /name; "off" hides it from both. Absent = on.'),disableBundledSkills:R().optional().describe("Disable the skills and workflows that ship with Claude Code: bundled skills and workflows are removed entirely; built-in slash commands stay typable but are hidden from the model. Plugins, .claude/skills/, and .claude/commands/ are unaffected. Equivalent to CLAUDE_CODE_DISABLE_BUNDLED_SKILLS=1."),allowedMcpServers:I(xb()).optional().describe("Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied."),deniedMcpServers:I(vb()).optional().describe("Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied."),hooks:La().optional().describe("Custom commands to run before/after tool executions"),worktree:A({symlinkDirectories:I(g()).optional().describe('Directories to symlink from main repository to worktrees to avoid disk bloat. Must be explicitly configured - no directories are symlinked by default. Common examples: "node_modules", ".cache", ".bin"'),sparsePaths:I(g()).optional().describe("Directories to include when creating worktrees, via git sparse-checkout (cone mode). "+"Dramatically faster in large monorepos — only the listed paths are written to disk."),baseRef:Z(["fresh","head"]).optional().describe("Which ref new worktrees branch from. 'fresh' (default) branches from origin/<default-branch> for a clean tree. 'head' branches from your current local HEAD so unpushed commits and feature-branch state are present. Applies to --worktree, EnterWorktree, and agent isolation."),bgIsolation:Z(["worktree","none"]).optional().catch(void 0).describe("Isolation mode for background sessions in this repo. 'worktree' (default) blocks Edit/Write in the main checkout until EnterWorktree is called. 'none' lets background jobs edit the working copy directly."),location:g().optional().catch(void 0).describe("Directory under which Claude Code Desktop creates the worktrees of SSH sessions that run on this machine (an absolute path or one starting with ~/), instead of <project>/.claude/worktrees. Read by the desktop app from the SSH host user settings; a location chosen in the desktop app's SSH connection settings takes precedence. The CLI (--worktree, EnterWorktree, agent isolation) does not read it yet.")}).optional().describe("Git worktree configuration: the CLI --worktree flag, EnterWorktree and agent isolation, plus the location Claude Code Desktop uses for SSH-session worktrees on this machine."),disableAllHooks:R().optional().describe("Disable all hooks and statusLine execution"),disableAgentView:R().optional().describe("Disable agent view (`claude agents`, `--bg`, /background, the on-demand daemon). Typically set in managed settings. Equivalent to CLAUDE_CODE_DISABLE_AGENT_VIEW=1."),disableRemoteControl:R().optional().describe("Disable Remote Control (claude.ai/code, `claude remote-control`, `--remote-control`/`--rc`, auto-start, and the in-session toggle). Typically set in managed settings."),disableWorkflows:R().optional().describe("Disable the Workflows feature (also via CLAUDE_CODE_DISABLE_WORKFLOWS)."),disableArtifact:R().optional().describe("Disable the Artifact tool (also via CLAUDE_CODE_DISABLE_ARTIFACT)."),enableArtifact:R().optional().describe("Enable or disable the Artifact tool for this user. Unset defaults to enabled once the feature is available."),enableWorkflows:R().optional().describe("Enable or disable the Workflows feature for this user. Unset = default by plan once the feature is available."),workflowSizeGuideline:Z(["unrestricted","small","medium","large"]).optional().describe('Advisory size guideline for the dynamic workflows Claude writes: "small" aims for fewer than 5 agents, "medium" (the default) fewer than 15, "large" fewer than 50, and "unrestricted" sends no guideline. A value here — including from managed settings — takes precedence over the "Dynamic workflow size" choice in /config, and that /config row is hidden while a settings file provides the key. This is a guideline, not an enforced limit.'),workflowKeywordTriggerEnabled:R().optional().describe('Enable the "ultracode" keyword trigger: including the keyword in a prompt opts that turn into the Workflow tool. Set to false to disable the trigger. Default: true.'),disableSkillShellExecution:R().optional().describe("Disable inline shell execution in skills and custom slash commands from user, project, or plugin sources. Commands are replaced with a placeholder instead of being run."),defaultShell:Z(["bash","powershell"]).optional().describe("Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip)."),respondToBashCommands:R().optional().describe("Whether Claude responds after an input-box ! bash command runs. Set to false to add the command output to context without a response. Default: true."),allowManagedHooksOnly:R().optional().describe("When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored."),allowedHttpHookUrls:I(g()).optional().describe('Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard (e.g. "https://hooks.example.com/*"). When set, HTTP hooks with non-matching URLs are blocked. If undefined, all URLs are allowed. If empty array, no HTTP hooks are allowed. Arrays merge across settings sources (same semantics as allowedMcpServers).'),httpHookAllowedEnvVars:I(g()).optional().describe("Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. If undefined, no restriction is applied. Arrays merge across settings sources (same semantics as allowedMcpServers)."),allowManagedPermissionRulesOnly:R().optional().describe("When true (and set in managed settings), only permission rules (allow/deny/ask) from managed settings are respected. User, project, local, and CLI argument permission rules are ignored."),allowManagedMcpServersOnly:R().optional().describe("When true (and set in managed settings), allowedMcpServers is only read from managed settings. deniedMcpServers still merges from all sources, so users can deny servers for themselves. Users can still add their own MCP servers, but only the admin-defined allowlist applies."),allowAllClaudeAiMcps:R().optional().describe("When true (and set in managed settings), claude.ai cloud MCP connectors load alongside managed-mcp.json instead of being suppressed by its exclusive-control lockdown. Default off preserves the lockdown. Read from managed settings only."),strictPluginOnlyCustomization:ot((o)=>Array.isArray(o)?o.filter((s)=>LY.includes(s)):o,ie([R(),I(Z(LY))])).optional().catch(void 0).describe('When set in managed settings, blocks non-plugin customization sources for the listed surfaces. Array form locks specific surfaces (e.g. ["skills", "hooks"]); `true` locks all four; `false` is an explicit no-op. Blocked: ~/.claude/{surface}/, .claude/{surface}/ (project), settings.json hooks, .mcp.json. NOT blocked: managed (policySettings) sources, plugin-provided customizations. '+"Composes with strictKnownMarketplaces for end-to-end admin control — plugins gated by "+"marketplace allowlist, everything else blocked here."),statusLine:A({type:z("command"),command:g(),padding:K().optional(),refreshInterval:K().min(1).optional().catch(void 0).describe("Re-run the status line command every N seconds in addition to event-driven updates"),hideVimModeIndicator:R().optional().describe("Hide the built-in `-- INSERT --` / `-- VISUAL --` indicator below the prompt. Use this when your status line script renders `vim.mode` itself.")}).optional().describe("Custom status line display configuration"),prUrlTemplate:g().optional().describe('URL template for PR links in the footer link badges and inline messages. The detected git PR is rendered as the first footer-link badge. Placeholders: {host} {owner} {repo} {number} {url}. Example: "https://reviews.example.com/{owner}/{repo}/pull/{number}"'),footerLinksRegexes:I(GVe().catch(MY)).transform((o)=>o.filter((s)=>s!==MY)).optional().catch(void 0).describe("Extra clickable footer badges that appear when a regex matches turn output (tool results and assistant responses). Read from user, flag, and managed settings only; ignored in project .claude/settings.json and local .claude/settings.local.json. At most 5 badges render; the oldest is displaced by newer matches and /clear removes them. Use to surface IDs printed by project CLIs as session links."),subagentStatusLine:A({type:z("command"),command:g()}).optional().describe("Custom per-subagent status line shown in the agent panel; receives row context as JSON on stdin"),enabledPlugins:V(g(),ie([I(g()),R(),xx()])).optional().describe('Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints. Settings precedence is user < project < local < flag < policy, so to disable a plugin that project settings enable, set it to false in .claude/settings.local.json — setting false in ~/.claude/settings.json is overridden by the project.'),extraKnownMarketplaces:n("extraKnownMarketplaces").optional().describe("Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources."),additionalMarketplaces:n("additionalMarketplaces").optional().describe("Alias for extraKnownMarketplaces: this key is read exactly as if it were spelled "+"extraKnownMarketplaces. Do not set both in one file — if both appear, this key is ignored "+"with a warning. Claude Code may rewrite this key as extraKnownMarketplaces when it updates the file. Clients older than this alias ignore it, so prefer extraKnownMarketplaces while older Claude Code versions still share the same settings."),strictKnownMarketplaces:I(bu()).optional().describe('Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these sources can be added as marketplaces. Entries match exactly, except that a github entry may use the owner-wildcard form {"source":"github","repo":"owner/*"} to allow every repository under that owner. The check happens BEFORE downloading, so blocked sources never touch the filesystem. '+"Note: this is a policy gate only — it does NOT register marketplaces. "+"To pre-register allowed marketplaces for users, also set extraKnownMarketplaces."),allowedMarketplaces:I(bu()).optional().describe("Alias for strictKnownMarketplaces (managed settings only): this key is read exactly as if it "+"were spelled strictKnownMarketplaces. Do not set both in one file — if both appear, this key "+"is ignored with a warning. Clients older than this alias ignore it, so keep using strictKnownMarketplaces when the allowlist must also bind older Claude Code versions."),blockedMarketplaces:I(bu()).optional().describe('Enterprise blocklist of marketplace sources. When set in managed settings, these sources are blocked from being added as marketplaces. Entries match exactly, except that a github entry may use the owner-wildcard form {"source":"github","repo":"owner/*"} to block every repository under that owner. The check happens BEFORE downloading, so blocked sources never touch the filesystem.'),disableCommandPluginSources:R().optional().describe("Controls the `command` plugin source, whose plugin directory is produced by running a marketplace-declared command on this machine. true: command-sourced plugins are never installed, updated, or re-resolved (the command never runs). false: explicitly allowed. "+"Unset: follows allowManagedHooksOnly — an org that restricts hook execution to managed "+"settings gets command sources disabled too. Only honored from managed settings."),disableSideloadFlags:R().optional().describe("When true (and set in managed settings), rejects the --plugin-dir, --plugin-url, --agents, and non-sdk --mcp-config CLI flags at startup. Closes the CLI-flag bypass of strictKnownMarketplaces. Pair with allowedMcpServers for per-server MCP control; this setting does not gate other MCP entry points (SDK setMcpServers, claude mcp add, .mcp.json). Also blocks surfaces that spawn the CLI with these flags internally (see settings documentation). Only honored from managed settings; ignored in user/project/local settings."),pluginSuggestionMarketplaces:I(g()).optional().describe("Marketplace names whose plugins may surface as contextual install suggestions (relevance-based tips). No marketplace-declared suggestions surface without this allowlist; the built-in first-party frontend-design tip is unaffected. Only honored when set in managed settings (policy scope); the key is ignored in user, project, and local settings. A name only takes effect when the marketplace is registered on the machine AND its registered source is also declared in managed settings, either as the extraKnownMarketplaces entry for that name or as an entry of strictKnownMarketplaces. A marketplace registered from a different source under an allowlisted name is ignored. The official marketplace is exempt from the source requirement: allowlisting its name alone suffices, since that name can only register from the official Anthropic source."),forceLoginMethod:Z(["claudeai","console","gateway"]).optional().catch(void 0).describe('Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing, "gateway" for the Cloud gateway OIDC device flow'),forceLoginGatewayUrl:g().url().optional().catch(void 0).describe('Cloud gateway URL to pre-fill and auto-connect to during login, alongside forceLoginMethod: "gateway". Honored only from admin-controlled managed settings (MDM / managed-settings.json / policy helper); ignored in user, project, and remote-delivered settings.'),parentSettingsBehavior:Z(["first-wins","merge"]).optional().describe('Controls whether the SDK parent tier (Options.managedSettings / --managed-settings) layers under this admin tier. "first-wins" '+"(default): parent is dropped — admin tiers are the only policy "+`source. "merge": parent's restrictive-only-filtered settings union under the admin winner. Has no effect when no admin tier exists (parent applies as the sole policy tier, still filtered restrictive-only).`),forceLoginOrgUUID:ie([g(),I(g())]).optional().describe("Organization UUID to require for OAuth login. Accepts a single UUID string or an array of UUIDs (any one is permitted). When set in managed settings, login fails if the authenticated account does not belong to a listed organization."),forceRemoteSettingsRefresh:R().optional().describe("When set in managed settings, the CLI blocks startup until remote managed settings are freshly fetched, and exits if the fetch fails"),otelHeadersHelper:g().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:g().optional().describe("Controls the output style for assistant responses"),viewMode:Z(["default","verbose","focus"]).optional().catch(void 0).describe("Default transcript view mode on startup"),language:g().optional().describe('Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")'),skipWebFetchPreflight:R().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:jO().optional(),feedbackSurveyRate:K().min(0).max(1).optional().describe("Probability (0–1) that the session quality survey appears when eligible. 0.05 is a reasonable starting point."),feedbackDrafts:Z(["notify","quiet","off"]).optional().describe('Model-drafted feedback (the SendFeedback tool). "notify" (default) shows a one-line notice when a draft is queued; "quiet" shows only the footer counter; "off" disables the tool entirely so drafts are never queued.'),spinnerTipsEnabled:R().optional().describe("Whether to show tips in the spinner"),spinnerVerbs:A({mode:Z(["append","replace"]),verbs:I(g())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),spinnerTipsOverride:A({excludeDefault:R().optional(),tips:I(g())}).optional().describe("Override spinner tips. tips: array of tip strings. excludeDefault: if true, only show custom tips (default: false)."),syntaxHighlightingDisabled:R().optional().describe("Whether to disable syntax highlighting in diffs"),spellcheck:A({enabled:R().optional().catch(void 0).describe("Turn on spell checking of the prompt input (default: false)"),checker:g().optional().catch(void 0).describe(`Which spell checker to run: ${gb.map((o)=>`"${o}"`).join(", ")}, or "auto" (default) for the first of those found on PATH`),language:g().optional().catch(void 0).describe(`Dictionary to use, passed to the checker as-is (aspell --lang, hunspell -d, ispell -d), e.g. "en_GB"; names are checker-specific (letters, digits and _ - . , only). Default: the checker's own default`),color:g().optional().catch(void 0).describe(`Color of misspelled words (they are also underlined): a terminal color name such as "red" or "magenta", "#rrggbb", "rgb(r,g,b)", "ansi256(n)" or "ansi:<name>". Default: the theme's error color`)}).passthrough().optional().catch(void 0).describe(`Underline misspelled words in the prompt input as you type, using an installed ${gb.slice(0,-1).join(", ")} or ${gb.at(-1)} (off unless "enabled" is true; does nothing if none is installed). Read from user, flag and managed settings only (the whole block from the highest-precedence of those applies); ignored in project .claude/settings.json and .claude/settings.local.json.`),terminalTitleFromRename:R().optional().describe("Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles."),alwaysThinkingEnabled:R().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),effortLevel:Z(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for supported models."),modelSettings:ot((o)=>typeof o==="object"&&o!==null&&!Array.isArray(o)?Qf(o,(s,i)=>Object.hasOwn(Object.prototype,i)):o,V(g(),A({effortLevel:Z(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for this model.")}).passthrough().optional().catch(void 0))).optional().catch(void 0).describe("Per-model settings keyed by canonical model name."),ultracode:R().optional().catch(void 0).describe("Enable ultracode for the session: xhigh effort plus standing dynamic-workflow orchestration. "+"Session-scoped — typically provided via --settings or the apply_flag_settings control request; "+"interactive toggles never persist it. Requires workflows to be enabled and an xhigh-capable model."),autoCompactWindow:K().int().min(1e5).max(1e6).optional().catch(void 0).describe("Auto-compact window size"),advisorModel:g().optional().describe("Advisor model for the server-side advisor tool."),fastMode:R().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),fastModePerSessionOptIn:R().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),promptSuggestionEnabled:R().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),emojiCompletionEnabled:R().optional().describe("When false, the :emoji: shortcode typeahead (the suggestion popup and the :name: inline replacement) is disabled. When absent or true, it is enabled."),awaySummaryEnabled:R().optional().describe("@internal When false, the session recap (shown when you return after being away for 5+ minutes) is disabled. When absent or true, recap is enabled. Hidden from public SDK types until external launch."),showClearContextOnPlanAccept:R().optional().describe('When true, the plan-approval dialog offers a "clear context" option. Defaults to false.'),askUserQuestionTimeout:Z(["60s","5m","10m","never"]).optional().catch(void 0).describe("Idle time before Claude's questions auto-continue with any answers "+"selected so far. Defaults to never — auto-continue only runs "+"when explicitly set to 60s/5m/10m."),dialogExpiry:Z(["60s","5m","10m","never"]).optional().catch(void 0).describe('Max time a permission/user dialog forwarded to a remote client stays parked awaiting an answer, and how long a HELD cross-session message awaits approval, before either resolves to its safe no-action default (cancelled / dropped-with-denial). Defaults to 5m to match the long-standing remote-dialog deadline; "never" disables the deadline. Local-only permission prompts (no remote client) are unaffected. The CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS env var, when set, overrides this. Read from trusted sources only (never a checked-in repo settings file).'),agent:g().optional().describe("Name of an agent (built-in or custom) to use for the main thread. Applies the agent's system prompt, tool restrictions, and model."),modelProposedGoals:Z(G5).optional().catch(void 0).describe("@internal Controls the ProposeGoal tool (model-proposed session goals). 'auto' (the default when absent) lets the model choose per proposal whether to ask for approval via its ask_user parameter; 'alwaysAsk' routes every model-proposed goal through the approval dialog; 'disabled' turns the tool off. A typed /goal is unaffected. Consent-affecting, so it is read "+"from trusted sources only (user/policy/flag) — "+"workspace-resident project and local settings are ignored."),companyAnnouncements:I(g()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:V(g(),A({mcpServers:V(g(),V(g(),ie([g(),K(),R(),I(g())]))).optional().describe("User configuration values for MCP servers keyed by server name"),options:V(g(),ie([g(),K(),R(),I(g())])).optional().describe("Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.")}).or(xx())).optional().describe("Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)"),remote:A({defaultEnvironmentId:g().optional().describe("Default environment ID to use for cloud sessions")}).optional().describe("Cloud session configuration"),autoUpdatesChannel:Z(["latest","stable","rc"]).optional().describe("Release channel for auto-updates (latest or stable)"),minimumVersion:g().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),requiredMinimumVersion:g().optional().describe("Minimum Claude Code version required to start. If the running version is older, Claude Code exits at startup with instructions to update. Only enforced from managed (policy) settings."),requiredMaximumVersion:g().optional().describe("Maximum Claude Code version allowed to start. If the running version is newer, Claude Code exits at startup with instructions to install an approved version. Only enforced from managed (policy) settings."),plansDirectory:g().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/"),tui:Z(["default","fullscreen"]).optional().describe('Terminal UI renderer. "fullscreen" uses the flicker-free alt-screen renderer with virtualized scrollback (equivalent to CLAUDE_CODE_NO_FLICKER=1). "default" uses the classic main-screen renderer.'),...!1,voice:A({enabled:R().optional(),mode:Z(["hold","tap"]).optional().describe("'hold' (default): hold to talk. 'tap': tap to start, tap to stop+submit."),autoSubmit:R().optional().describe("Submit the prompt when hold-to-talk is released (hold mode only)")}).optional().describe("Voice mode settings (hold-to-talk / tap-to-toggle dictation)"),channelsEnabled:R().optional().describe("Managed-org opt-in for channel notifications (MCP servers with the claude/channel capability pushing inbound messages). claude.ai Teams/Enterprise: default off. Console: default on unless managed settings exist. Set true to allow; users then select servers via --channels."),allowedChannelPlugins:I(A({marketplace:g(),plugin:g()})).optional().describe("Managed-org allowlist of channel plugins. When set, "+"replaces the default Anthropic allowlist — admins decide which "+"plugins may push inbound messages. Undefined falls back to the default. Requires channelsEnabled: true."),prefersReducedMotion:R().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),doneMeansMerged:R().optional().describe("@internal When true, Claude keeps working until the PR is ready for you to merge, a cron/Monitor is armed to resume later, or it hands you a self-contained next step."),totalTokensReminder:Z(["off","infinite","fixed","countdown","padded-countdown"]).optional().describe("@internal Emit a <total_tokens>N tokens left</total_tokens> block in the system prompt, after each tool result, and (when totalTokensReminderAfterUserTurn is on) after each regular user prompt. 'infinite' uses the literal value Infinite, 'fixed' uses 5000000, 'countdown' uses the live remaining context-window tokens, 'padded-countdown' counts down from totalTokensReminderBudget (re-anchoring to the full budget on each regular user prompt when totalTokensReminderAfterUserTurn "+"is on — task-budget semantics). Defaults to padded-countdown. "+"Env var CLAUDE_CODE_TOTAL_TOKENS_REMINDER overrides."),totalTokensReminderBudget:K().int().positive().optional().describe("@internal Starting budget (tokens) for totalTokensReminder 'padded-countdown' mode. Defaults to 15000000. Server-controlled via GrowthBook; env var CLAUDE_CODE_TOTAL_TOKENS_REMINDER_BUDGET overrides."),totalTokensReminderAfterUserTurn:R().optional().describe("@internal When true, emit the totalTokensReminder block after each regular user prompt and (for 'padded-countdown') re-anchor the task budget to the full configured value at the start of each user turn. When false, the reminder appears only in the system prompt and after each tool-result batch, and 'padded-countdown' counts down over the whole session. Defaults to on. Env var CLAUDE_CODE_TOTAL_TOKENS_REMINDER_AFTER_USER_TURN overrides; server-controlled via GrowthBook tengu_lapis_anchor_user_turn."),autoMemoryEnabled:R().optional().describe("Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory."),autoMemoryDirectory:g().optional().describe("Custom directory path for auto-memory storage. Supports ~/ prefix for home directory expansion. Ignored if set in projectSettings (checked-in .claude/settings.json) for security. When unset, defaults to ~/.claude/projects/<sanitized-cwd>/memory/."),autoDreamEnabled:R().optional().describe("Enable background memory consolidation (auto-dream). When set, overrides the server-side default."),showThinkingSummaries:R().optional().describe("Request API-side thinking summaries and show them in the conversation and in the transcript view (ctrl+o). Set explicitly to override the default for your install."),skipDangerousModePermissionPrompt:R().optional().describe("Whether the user has accepted the bypass permissions mode dialog"),skipWorkflowUsageWarning:R().optional().describe("@internal Whether the user has accepted the multi-agent workflow usage warning. Until set, auto permission mode prompts before running a workflow."),disableAutoMode:Z(["disable"]).optional().describe("Disable auto mode"),sshConfigs:I(A({id:g().describe("Unique identifier for this SSH config. Used to match configs across settings sources."),name:g().describe("Display name for the SSH connection"),sshHost:g().describe('SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config'),sshPort:K().int().optional().describe("SSH port (default: 22)"),sshIdentityFile:g().optional().describe("Path to SSH identity file (private key)"),startDirectory:g().optional().describe("Default working directory on the remote host. Supports tilde expansion (e.g. ~/projects). If not specified, defaults to the remote user home directory. Can be overridden by the [dir] positional argument in `claude ssh <config> [dir]`.")})).optional().describe("SSH connection configurations for remote environments. Typically set in managed settings by enterprise administrators to pre-configure SSH connections for team members."),claudeMd:g().optional().describe("CLAUDE.md-style instructions injected as organization-managed memory. Only honored from managed/policy settings."),claudeMdExcludes:I(g()).optional().describe('Glob patterns or absolute paths of CLAUDE.md files to exclude from loading. Patterns are matched against absolute file paths using picomatch. Only applies to User, Project, and Local memory types (Managed/policy files cannot be excluded). Examples: "/home/user/monorepo/CLAUDE.md", "**/code/CLAUDE.md", "**/some-dir/.claude/rules/**"'),pluginTrustMessage:g().optional().describe('Custom message to append to the plugin trust warning shown before installation. Only read from policy settings (managed-settings.json / MDM). Useful for enterprise administrators to add organization-specific context (e.g., "All plugins from our internal marketplace are vetted and approved.").'),theme:ie([Z(K5),g().startsWith("custom:").transform((o)=>o)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:Z(j5).optional().catch(void 0).describe("Key binding mode for the prompt input"),keybindingFlavor:Z(H5).optional().catch(void 0).describe(`Which conventions the prompt's word-editing keys follow: "readline" matches Bash and other readline programs (Ctrl+W deletes back to the previous whitespace; Alt+F and Alt+D stop at the end of the current word and Ctrl+Y can paste back what Alt+D deleted; for Alt+B, Alt+F, Alt+D, Ctrl/Option+Arrow and Option/Ctrl+Backspace a word is a run of letters and digits, so punctuation separates words); "classic" (default) keeps Claude Code's long-standing behavior (Ctrl+W deletes the previous word; the word keys use Unicode word segmentation, so foo_bar and 3.14 are one word)`),vimInsertModeRemaps:V(g(),xe()).optional().catch(void 0).describe('Vim INSERT-mode key-sequence remaps, e.g. {"jj": "<Esc>"}. Each key is exactly two printable characters typed in sequence; "<Esc>" (return to NORMAL mode) is the only supported target. Applies when editorMode is "vim".'),verbose:R().optional().describe("Show full tool output instead of truncated summaries"),preferredNotifChannel:Z($5).optional().catch(void 0).describe("Preferred OS notification channel"),autoCompactEnabled:R().optional().describe("Automatically compact conversation when context fills"),precomputeCompactionEnabled:R().optional().describe("Precompute the compaction summary in the background before it is needed. Only applies when auto-compact is on."),switchModelsOnFlag:R().optional().describe("When safeguards flag a message, automatically switch to a different model to keep chatting. When off, your session will pause instead."),autoContinueAtUsageLimit:R().optional().describe("When a claude.ai usage limit stops your session, wait for the limit to reset and continue the task automatically. When off, the limit dialog offers the wait as a choice instead."),autoScrollEnabled:R().optional().describe("Auto-scroll the conversation view to bottom (fullscreen mode only)"),wheelScrollAccelerationEnabled:R().optional().describe("Ramp mouse-wheel scroll speed during fast scrolls (fullscreen mode only)"),fileCheckpointingEnabled:R().optional().describe("Snapshot files before edits so /rewind can restore them"),showTurnDuration:R().optional().describe('Show "Cooked for Nm Ns" after each assistant turn'),showMessageTimestamps:R().optional().describe("Stamp each message with its arrival time"),terminalProgressBarEnabled:R().optional().describe("Emit OSC 9;4 progress sequences during long operations"),todoFeatureEnabled:R().optional().describe("Enable the todo / task tracking panel"),teammateMode:Z(B5).optional().catch(void 0).describe("How spawned teammates execute (tmux, iterm2, in-process, auto)"),remoteControlAtStartup:R().optional().describe("Start Remote Control bridge automatically each session"),isolatePeerMachines:R().optional().describe("Require explicit approval before SendMessage can reach a peer session on another machine via Remote Control"),daemonColdStart:Z(["transient","ask"]).optional().describe("When no background service is running: 'transient' spawns one for this login session; 'ask' offers to install it persistently"),crossSessionInbound:Z(["accept","hold","refuse"]).optional().catch(void 0).describe("Inbound cross-session peer messages (SendMessage from your other sessions): 'accept' delivers them, 'hold' parks them for your review without letting Claude act, 'refuse' opts this session out. An explicit value always wins. Unset (mode parity): a message auto-delivers only when the sending session's permission-mode class matches yours (bypass↔bypass or prompting↔prompting); a mismatched sender's message is held for your approval; a sender that asserts no class is held only while this session bypasses permission prompts."),autoUploadSessions:R().optional().describe("Mirror local sessions to claude.ai as view-only (no remote control)"),inputNeededNotifEnabled:R().optional().describe("Push to mobile when a permission prompt or question is waiting"),agentPushNotifEnabled:R().optional().describe("Allow Claude to push proactive mobile notifications"),...SY(e)}).passthrough()}var Eu=D(()=>wb(sm())),NY=Object.freeze({serverName:"invalid-entry-stripped"});function UY(e,t,n){return I(t.catch((r)=>(n({path:`${e}[]`,message:`Invalid entry was ignored: ${r.issues[0]?.message??"failed validation"}`}),NY))).transform((r)=>r.filter((o)=>o!==NY)).optional()}function aP(e,t){let n=Eu(),r={};for(let[b,x]of Object.entries(n.shape))r[b]=x.catch((v)=>{e({path:b,message:`${v.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});return});r.allowedMcpServers=UY("allowedMcpServers",xb(),e).catch(()=>(e({path:"allowedMcpServers",message:'"allowedMcpServers" was present but invalid; enforcing an empty allowlist (no MCP servers admitted) until it is fixed.'}),[])),r.deniedMcpServers=UY("deniedMcpServers",vb(),e).catch(()=>{e({path:"deniedMcpServers",message:'"deniedMcpServers" was present but invalid and was dropped; its entries cannot be enforced until it is fixed.'});return}),r.allowManagedHooksOnly=n.shape.allowManagedHooksOnly.catch(()=>(e({path:"allowManagedHooksOnly",message:'"allowManagedHooksOnly" was present but invalid; treating it as true (only managed hooks run; command-sourced plugins disabled) until it is fixed.'}),!0)),r.syncClaudeAiSkills=n.shape.syncClaudeAiSkills.catch(()=>(e({path:"syncClaudeAiSkills",message:'"syncClaudeAiSkills" was present but invalid; treating it as false (claude.ai skills sync off) until it is fixed.'}),!1)),r.disableCommandPluginSources=n.shape.disableCommandPluginSources.catch(()=>(e({path:"disableCommandPluginSources",message:'"disableCommandPluginSources" was present but invalid; treating it as true (command-sourced plugins disabled) until it is fixed.'}),!0)),r.allowManagedMcpServersOnly=n.shape.allowManagedMcpServersOnly.catch(()=>(e({path:"allowManagedMcpServersOnly",message:'"allowManagedMcpServersOnly" was present but invalid; treating it as true until it is fixed.'}),!0)),r.enforceAvailableModels=n.shape.enforceAvailableModels.catch(()=>(e({path:"enforceAvailableModels",message:'"enforceAvailableModels" was present but invalid; treating it as true until it is fixed.'}),!0)),r.availableModels=I(xe()).transform((b,x)=>{let v=[];for(let T of b)if(typeof T==="string")v.push(T);else e({path:"availableModels",message:`"availableModels" contained a non-string entry (${JSON.stringify(T)}); the entry was ignored.`});return v}).optional().catch(()=>(e({path:"availableModels",message:'"availableModels" was present but invalid; enforcing an empty allowlist (only the default model is available) until it is fixed.'}),[])),r.forceLoginOrgUUID=n.shape.forceLoginOrgUUID.catch(()=>(e({path:"forceLoginOrgUUID",message:'"forceLoginOrgUUID" was present but invalid; no organization is permitted to log in until it is fixed.'}),[]));let o=!1,s=(b,x)=>{let v=b.safeParse(x);if(v.success)return;return v.error.issues.slice(0,3).map((T)=>T.path.length?`${T.path.join(".")}: ${T.message}`:T.message).join("; ")},i;r.policyHelper=ot((b)=>{if(o=!1,i=b,b&&typeof b==="object"&&!Array.isArray(b)){let x=b;for(let v of["defaultSettings","default",...Sb])if(x[v]!==void 0&&x[v]!==null)e({path:"policyHelper",message:`"${v}" on the singular policyHelper is ignored — static fallback payloads belong on the policyHelpers per-OS entries ("defaultSettings") or the map's "default" key. The intended fallback will NOT apply from here.`,statusOnly:!0});for(let v of["policyHelper","policyHelpers"])if(x[v]!==void 0&&x[v]!==null)e({path:"policyHelper",message:`"${v}" inside the singular policyHelper is ignored — "policyHelper" and "policyHelpers" are TOP-LEVEL settings keys; nothing nests inside the singular entry. The nested config will NOT apply from here.`,statusOnly:!0});for(let v of hs)if(x[v]!==void 0&&x[v]!==null)e({path:"policyHelper",message:`"${v}" on the singular policyHelper is ignored — per-OS entries live on the policyHelpers MAP ("policyHelpers": {"${v}": ...}), not inside the singular key. The intended per-OS config will NOT apply from here.`,statusOnly:!0});if(x.claudeMd!==void 0&&x.claudeMd!==null)e({path:"policyHelper",message:`"claudeMd" on the singular policyHelper is ignored — "claudeMd" is a managed-settings key: put it at the settings top level or inside a static payload, or emit it from the helper's stdout envelope. The intended instructions will NOT apply from here.`,statusOnly:!0});if(x.path===null||x.path===void 0)o=!0}return b===null?void 0:b},Eb().optional()).catch((b)=>{e({path:"policyHelper",message:`${b.issues[0]?.message??s(Eb(),i)??"Failed schema validation"}. This field was ignored.`,...o&&{statusOnly:!0}});return});let a=(b,x)=>{e({path:b,message:`"${b}" is not a valid static settings payload: ${x??"failed validation"}. When delivered from an OS-admin policy source (MDM or the managed settings file), Claude Code will not start until this is fixed.`,startupFatal:!0})},c=(b)=>{let x=!1,v,T=oP(b,Na().optional().catch((U)=>{x=!0,a(`policyHelpers.${b}.defaultSettings`,U.issues[0]?.message??s(Na(),v&&typeof v==="object"&&!Array.isArray(v)?v.defaultSettings:void 0));return}));return ot((U)=>{if(x=!1,v=U,b!=="default"&&U&&typeof U==="object"&&!Array.isArray(U)){let M=U;for(let F of[...Sb,"claudeMd"])if(M[F]!==void 0&&M[F]!==null)e({path:`policyHelpers.${b}`,message:`"${F}" on the policyHelpers.${b} entry is ignored — helper output cannot be pre-seeded on an entry; a static fallback payload goes under this entry's "defaultSettings" (a managed-settings object). The intended content will NOT apply from here.`,statusOnly:!0});for(let F of["policyHelper","policyHelpers"])if(M[F]!==void 0&&M[F]!==null)e({path:`policyHelpers.${b}`,message:`"${F}" on the policyHelpers.${b} entry is ignored — "policyHelper" and "policyHelpers" are TOP-LEVEL settings keys; nothing nests inside an entry. The nested config will NOT apply from here.`,statusOnly:!0});for(let F of hs)if(M[F]!==void 0&&M[F]!==null)e({path:`policyHelpers.${b}`,message:`"${F}" on the policyHelpers.${b} entry is ignored — per-OS entries are SIBLINGS on the policyHelpers map, not nested inside each other. The intended ${F} config will NOT apply from here.`,statusOnly:!0});if(M.default!==void 0&&M.default!==null)e({path:`policyHelpers.${b}`,message:`"default" on the policyHelpers.${b} entry is ignored — the per-entry static payload field is spelled "defaultSettings"; "default" is the MAP's any-platform catch-all key (a sibling of the OS entries). The intended fallback will NOT apply from here.`,statusOnly:!0});if(jY(U))return}return U===null?void 0:U},T.optional()).catch((U)=>{if(b==="default"){a("policyHelpers.default",U.issues[0]?.message??s(Na(),v));return}if(x)return;let M=s(oP(b),v)??"failed validation",F=v;if(F&&typeof F==="object"&&!Array.isArray(F)){let W=F.defaultSettings;if(W!==void 0&&W!==null){let ce=Na().safeParse(W);if(ce.success)return e({path:`policyHelpers.${b}`,message:`Invalid entry: its helper fields were ignored (${M}), but its "defaultSettings" static payload was kept. No policy helper runs on ${b} from this entry.`,statusOnly:!0}),{defaultSettings:ce.data}}}e({path:`policyHelpers.${b}`,message:`Invalid entry was ignored: ${M}. No policy helper runs on ${b} from this entry.`,statusOnly:!0});return})};r.policyHelpers=ot((b)=>{if(b&&typeof b==="object"&&!Array.isArray(b)){let x=b;for(let v of["defaultSettings",...Sb,"claudeMd"])if(x[v]!==void 0&&x[v]!==null)e({path:"policyHelpers",message:`"${v}" directly on the policyHelpers map is ignored — static fallback payloads go on a per-OS entry's "defaultSettings" or the map's "default" key (a managed-settings object), and helper-output keys come from the helper's stdout. The intended content will NOT apply from here.`,statusOnly:!0});for(let v of["policyHelper","policyHelpers"])if(x[v]!==void 0&&x[v]!==null)e({path:"policyHelpers",message:`"${v}" inside the policyHelpers map is ignored — "policyHelper" and "policyHelpers" are TOP-LEVEL settings keys; the map's keys are the per-OS entries and "default". The nested config will NOT apply from here.`,statusOnly:!0});for(let v of rP.filter((T)=>T!=="defaultSettings"))if(x[v]!==void 0&&x[v]!==null)e({path:"policyHelpers",message:`"${v}" directly on the policyHelpers map is ignored — helper configs go on a per-OS entry (policyHelpers.${hs.join("/")})${v==="script"||v==="interpreter"?"; inline scripts are per-OS only (the singular policyHelper key takes a path)":", or on the singular policyHelper key"}. No helper runs from this field here.`,statusOnly:!0})}return b===null?void 0:b},A(Object.fromEntries(iP.map((b)=>[b,c(b)]))).transform((b)=>{for(let x of Object.keys(b))if(b[x]===void 0)delete b[x];return b}).optional().catch((b)=>(e({path:"policyHelpers",message:`"policyHelpers" could not be parsed: expected an object mapping OS keys (${hs.join(", ")}) to helper entries, plus an optional "default" settings payload (${b.issues[0]?.message??"failed schema validation"}). When delivered from an OS-admin policy source (MDM or the managed settings file), Claude Code will not start until this is fixed.`,startupFatal:!0}),{})));let l=Object.freeze({mode:"deny"}),u=Object.freeze({accessKeyIdVar:"_STRIPPED_",secretAccessKeyVar:"_STRIPPED_2_"}),p=0,f=[],m=t===void 0?"":`${[...t].reduce((b,x)=>Math.imul(b^x.charCodeAt(0),16777619)>>>0,2166136261).toString(16).toUpperCase().padStart(8,"0")}_`,h=(b,x)=>{if(typeof b!=="object"||b===null)return;let v=(Ye)=>x.some((Et)=>Et.path?.includes(Ye)),T=(Ye)=>{let Et=b[Ye];if(typeof Et==="string")return Et;return v(Ye)?"":void 0},U=T("accessKeyIdVar"),M=T("secretAccessKeyVar"),F=T("sessionTokenVar"),W=gu;if(![U,M,F].some((Ye)=>Ye!==void 0&&W.includes(Ye)))return;let ce=(Ye)=>Ye!==void 0&&hu().safeParse(Ye).success;p+=1;let ne=(Ye)=>`${$O}${Ye}_${m}${p}_`,se=ce(U)?U:ne("ACCESS_KEY_ID"),Se=ce(M)&&M!==se?M:ne("SECRET_ACCESS_KEY"),Te=F===void 0?void 0:ce(F)&&F!==se&&F!==Se?F:ne("SESSION_TOKEN"),St=(Ye)=>Ye.startsWith($O);if(!St(se)&&!St(Se)){let Ye=W.includes(Se)?Se:void 0;if(Se=ne("SECRET_ACCESS_KEY"),Ye!==void 0){let Et=h({accessKeyIdVar:Ye},[]);if(Et!==void 0)f.push(Et)}}let Y=fb().safeParse({accessKeyIdVar:se,secretAccessKeyVar:Se,...Te!==void 0&&{sessionTokenVar:Te}});return Y.success?Y.data:void 0},_=(b,x,v)=>I(x.catch((T)=>{let U=v(T.value);if(U!==void 0)return e({path:`sandbox.credentials.${b}[]`,message:`Invalid entry was degraded to mode "deny": ${T.issues[0]?.message??"failed validation"}. The credential stays blocked (not masked) until the entry is fixed.${b==="files"?" Under sandbox.filesystem.disabled, file read-denies are not enforced.":""}`}),U;return e({path:`sandbox.credentials.${b}[]`,message:`Invalid entry was ignored: ${T.issues[0]?.message??"failed validation"}. This credential is NOT protected until the entry is fixed.`}),l})).transform((T)=>T.filter((U)=>U!==l)).optional().catch((T)=>{if(typeof T.value==="object"&&T.value!==null&&!Array.isArray(T.value)){let U=x.safeParse(T.value);if(U.success)return e({path:`sandbox.credentials.${b}`,message:`"${b}" must be an array; a lone entry object was accepted as a one-element list. Wrap it in [ ] to silence this warning.`}),[U.data];let M=v(T.value);if(M!==void 0)return e({path:`sandbox.credentials.${b}`,message:`"${b}" must be an array; its lone entry object was invalid and was degraded to mode "deny". The credential stays blocked (not masked) until it is fixed.`}),[M]}return e({path:`sandbox.credentials.${b}`,message:`${T.issues[0]?.message??"Invalid value"}. "${b}" was ignored; these credential entries are NOT protected until it is fixed.`}),[]}),y=A({files:_("files",db(),(b)=>{if(typeof b!=="object"||b===null||!("mode"in b)||b.mode!=="mask"&&b.mode!=="deny"||!("path"in b)||typeof b.path!=="string")return;let x=db().safeParse({path:b.path,mode:"deny"});return x.success?x.data:void 0}),envVars:_("envVars",pb(),(b)=>{if(typeof b!=="object"||b===null||!("mode"in b)||b.mode!=="mask"&&b.mode!=="deny"||!("name"in b)||typeof b.name!=="string")return;let x=pb().safeParse({name:b.name,mode:"deny"});return x.success?x.data:void 0}),allowPlaintextInject:R().optional().catch((b)=>(e({path:"sandbox.credentials.allowPlaintextInject",message:`${b.issues[0]?.message??"Invalid value"}. "allowPlaintextInject" was degraded to an explicit false; plaintext credential injection stays disabled (lower-precedence values cannot enable it) until it is fixed.`}),!1)),awsPairs:I(fb().catch((b)=>{let x=h(b.value,b.issues);if(x!==void 0)return e({path:"sandbox.credentials.awsPairs[]",message:`Invalid pair was degraded to a non-functional suppressor: ${b.issues[0]?.message??"failed validation"}. It keeps implicit AWS auto-pairing suppressed but re-signs nothing until it is fixed.`}),x;return e({path:"sandbox.credentials.awsPairs[]",message:`Invalid pair was ignored: ${b.issues[0]?.message??"failed validation"}. SigV4 re-signing stays unconfigured for this pair until it is fixed.`}),u})).transform((b)=>{let x=b.filter((v)=>v!==u);if(f.length>0)x.push(...f),f.length=0;return x}).optional().catch((b)=>{let x=typeof b.value==="object"&&b.value!==null?h(b.value,[]):void 0,v=typeof b.value==="object"&&b.value!==null&&(("accessKeyIdVar"in b.value)||("secretAccessKeyVar"in b.value)||("sessionTokenVar"in b.value));if(x===void 0&&v)return f.length=0,e({path:"sandbox.credentials.awsPairs",message:`${b.issues[0]?.message??"Invalid value"}. "awsPairs" must be an array; its lone pair-shaped entry claimed no conventional AWS name and was ignored. SigV4 re-signing stays unconfigured until it is fixed.`}),[];let T=x!==void 0?[x]:gu.flatMap((U)=>{let M=h({accessKeyIdVar:U},[]);return M!==void 0?[M]:[]});if(f.length>0)T.push(...f),f.length=0;return e({path:"sandbox.credentials.awsPairs",message:`${b.issues[0]?.message??"Invalid value"}. "awsPairs" was degraded to non-functional suppressor pair(s); implicit AWS auto-pairing stays suppressed but nothing re-signs until it is fixed.`}),T}),sigv4:A(Object.fromEntries(["streaming","presigned","sigv4a"].map((b)=>[b,Z(["deny","passthrough"]).optional().catch((x)=>(e({path:`sandbox.credentials.sigv4.${b}`,message:`${x.issues[0]?.message??"Invalid value"}. "${b}" was degraded to an explicit deny; this SigV4 request shape stays denied until it is fixed.`}),"deny"))]))).optional().catch((b)=>(e({path:"sandbox.credentials.sigv4",message:`${b.issues[0]?.message??"Invalid value"}. "sigv4" was degraded to an all-deny block (all shapes stay denied, and lower-precedence sigv4 values cannot take effect) until it is fixed.`}),{streaming:"deny",presigned:"deny",sigv4a:"deny"}))}).optional().catch((b)=>{e({path:"sandbox.credentials",message:`${b.issues[0]?.message??"Failed schema validation"}. The credentials block was degraded to a fail-closed skeleton (all-deny sigv4, implicit AWS auto-pairing suppressed, no masking) until it is fixed.`});let x=gu.flatMap((v)=>{let T=h({accessKeyIdVar:v},[]);return T!==void 0?[T]:[]});return f.length=0,{allowPlaintextInject:!1,awsPairs:x,sigv4:{streaming:"deny",presigned:"deny",sigv4a:"deny"}}});return r.sandbox=jO().extend({credentials:y}).optional().catch((b)=>{e({path:"sandbox",message:`${b.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});let x=b.value;if(typeof x==="object"&&x!==null&&"credentials"in x){let v=y.safeParse(x.credentials);if(v.success&&v.data!==void 0)return e({path:"sandbox.credentials",message:"The credentials block was salvaged from the invalid sandbox value and stays enforced; every other sandbox field was ignored."}),{credentials:v.data}}return}),A(r).passthrough().transform((b)=>{for(let x of Object.keys(b))if(b[x]===void 0)delete b[x];return b})}function Ab(e){if(Array.isArray(e))return e.map(Ab);if(e!==null&&typeof e==="object"){let t={};for(let n of Object.keys(e).sort())t[n]=Ab(e[n]);return t}return e}function KY(e){if(!e)return{shellSettings:{},envVars:{},hasHooks:!1,hasClaudeMd:!1};let t={};for(let a of O5){let c=e[a];if(a==="policyHelpers"){if(c!==null&&typeof c==="object")for(let u of hs){let p=VVe(c[u]);if(p)t[`policyHelpers.${u}`]=p}continue}let l;if(typeof c==="string")l=c;else if(c!==null&&typeof c==="object"&&"command"in c&&typeof c.command==="string")l=c.command;if(l!==void 0&&l.length>0)t[a]=l}let n=JVe(e);if(n&&typeof n==="object")for(let[a,c]of Object.entries(n)){let l=c?.source;if(!l||typeof l!=="object")continue;if(l.source==="url"&&typeof l.headersHelper==="string"&&l.headersHelper.length>0)t[`extraKnownMarketplaces[${fe(a)}].source.headersHelper`]=BY(l.headersHelper,"url",l.url);if(l.source==="settings"&&Array.isArray(l.plugins)){let u=new Map;for(let p of l.plugins){let f=fe(p?.name),m=u.get(f)??0;u.set(f,m+1);let h=p?.source;if(h!==null&&typeof h==="object"&&"source"in h&&h.source==="command"&&"command"in h&&typeof h.command==="string"&&h.command.length>0)t[`extraKnownMarketplaces[${fe(a)}].plugins[${fe(p.name)}][${m}].source.command`]=h.command;if(typeof p?.headersHelper==="string"&&p.headersHelper.length>0){let _=p.source,y=_!==null&&typeof _==="object";t[`extraKnownMarketplaces[${fe(a)}].plugins[${fe(p.name)}][${m}].headersHelper`]=BY(p.headersHelper,y&&"source"in _?_.source:void 0,y&&"url"in _?_.url:void 0)}}}}let r=e.sandbox;if(r!==null&&typeof r==="object")for(let a of P5){let c=ZVe(r[a]);if(c)t[`sandbox.${a}`]=c}let o={};if(e.env&&typeof e.env==="object")for(let[a,c]of Object.entries(e.env)){if(c===void 0)continue;let l=String(c);if(l.length>0&&!I5(a,l))o[a]=l}let s=e.hooks!==void 0&&e.hooks!==null&&typeof e.hooks==="object"&&Object.keys(e.hooks).length>0,i=typeof e.claudeMd==="string"&&e.claudeMd.length>0;return{shellSettings:t,envVars:o,hasHooks:s,hooks:s?e.hooks:void 0,hasClaudeMd:i,claudeMd:i?e.claudeMd:void 0}}function qVe(e){return Object.keys(e.shellSettings).some((t)=>t.startsWith("policyHelpers."))}function GY(e){return qVe(e)||Object.keys(e.shellSettings).some((t)=>t.startsWith("extraKnownMarketplaces["))}function VVe(e){if(e===null||typeof e!=="object"||!("path"in e)||typeof e.path!=="string"||!e.path)return;let{timeoutMs:t,refreshIntervalMs:n}=e;return fe([e.path,t??null,n??null])}function ZVe(e){if(typeof e==="string")return e||void 0;if(e===null||typeof e!=="object"||!("command"in e)||typeof e.command!=="string"||!e.command)return;let t="args"in e&&Array.isArray(e.args)?e.args.map(String):[];return fe([e.command,...t])}function YVe(e){return fe(Ab({shellSettings:e.shellSettings,envVars:e.envVars,hooks:e.hooks,claudeMd:e.claudeMd}))}function WY(e){return WVe("sha256").update(YVe(e)).digest("hex")}function BY(e,t,n){return fe([e,typeof t==="string"?t:null,typeof n==="string"?n:null])}function qY(e){return e.replace(/[^\x20-\x7e]/gu,"?")}function JVe(e){let t=e.extraKnownMarketplaces;if(t!==void 0&&t!==null)return t;let n=e;for(let{alias:r,canonical:o}of em){if(o!=="extraKnownMarketplaces")continue;let s=n[r];if(s!==void 0&&s!==null&&typeof s==="object")return s}return}var XVe="remote-settings.json";var ZY="remote-settings-helper-consent";function QVe(){return VY(jt(),ZY)}function e4e(e){if(e.policyHelpers===void 0&&e.extraKnownMarketplaces===void 0&&!em.some(({alias:n,canonical:r})=>r==="extraKnownMarketplaces"&&e[n]!==void 0))return;let t=KY(e);return GY(t)?WY(t):void 0}function t4e(e){return Qf(e,(t,n)=>n.startsWith("$")&&n!=="$schema")}class YY{sessionCache=null;eligible=void 0;eligibilityMemo=void 0;policySettingsNotified=!1;verifiedPayload=null;consentedPayload=null;resetEpoch=0;backendView=void 0;replaceSessionCache(e,t){if(this.sessionCache=e,t?.verified)this.verifiedPayload=e;if(e!==null)this.backendView?.standDown("cache loaded")}seedFromDisk(e){this.sessionCache=e;let t=e4e(e);if(t===void 0||t===s4e())this.consentedPayload??=e;this.backendView?.standDown("cache loaded")}markConsented(e){this.consentedPayload=e}markPolicySettingsNotified(){this.policySettingsNotified=!0}recordEligibility(e,t){if(this.eligible=e,t.memoize)this.eligibilityMemo=e;if(!e)this.backendView?.standDown("ineligible")}resetListener=null;registerResetListener(e){if(this.resetListener!==null)throw Error("registerSyncCacheResetListener: a listener is already registered; a second one would unhook the first");this.resetListener=e}reset(){this.sessionCache=null,this.eligible=void 0,this.eligibilityMemo=void 0,this.policySettingsNotified=!1,this.verifiedPayload=null,this.consentedPayload=null,this.resetEpoch++,this.backendView?.standDown("account changed")}}var n4e=new ft(()=>new YY);function cP(){return n4e.of(Nt().host)}function Tb(){return}function r4e(){return Tb()??VY(jt(),XVe)}function o4e(){try{let e=i4e();if(e===null)return null;let t=yt(Nl(e));if(!t||typeof t!=="object"||Array.isArray(t))return null;return t4e(t)}catch{return null}}function s4e(){let e=JY();if(e!==void 0)return e.attestation;try{return Pa(QVe()).trim()||void 0}catch{return}}function i4e(){let e=JY();if(e!==void 0)return e.content;return Pa(r4e())}function JY(){let e=cP().backendView;if(!He()||e===void 0||e.stoodDown||Tb()!==void 0)return;if(!aL(e.configHome)){e.standDown("config home changed");return}return e}var aMt=un.state("remote-settings"),cMt=un.state(ZY);var a4e=new Set(["HTTPS_PROXY","HTTP_PROXY","NO_PROXY","CLAUDE_CODE_PROXY_RESOLVES_HOSTS","CLAUDE_CODE_ENABLE_PROXY_AUTH_HELPER","CLAUDE_CODE_PROXY_AUTH_HELPER_TTL_MS","API_FORCE_IDLE_TIMEOUT","ANTHROPIC_UNIX_SOCKET","NODE_EXTRA_CA_CERTS","CLAUDE_CODE_CERT_STORE","CLAUDE_CODE_CLIENT_CERT","CLAUDE_CODE_CLIENT_KEY","CLAUDE_CODE_CLIENT_KEY_PASSPHRASE","ALL_PROXY","NODE_OPTIONS","NODE_TLS_REJECT_UNAUTHORIZED",...IO,...DO,"AWS_ENDPOINT_URL_STS","AWS_ENDPOINT_URL","AWS_ENDPOINT_URL_SSO","AWS_ENDPOINT_URL_SSO_OIDC","AWS_ENDPOINT_URL_BEDROCK","AWS_ENDPOINT_URL_BEDROCK_RUNTIME",...UO,...FO,...zO,"CLOUDSDK_CONFIG","GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES","GCLOUD_PROJECT","CLAUDE_CODE_CUSTOM_OAUTH_URL",...LO,"CLAUDE_CODE_API_BASE_URL","CLAUDE_CODE_OAUTH_REFRESH_TOKEN","CLAUDE_CODE_OAUTH_SCOPES","CLAUDE_CODE_OAUTH_CLIENT_ID","CLAUDE_CODE_SESSION_ACCESS_TOKEN","CLAUDE_SESSION_INGRESS_TOKEN_FILE","CLAUDE_CODE_ENVIRONMENT_KIND","CLAUDE_CODE_REMOTE_SESSION_ID","ANTHROPIC_FEDERATION_RULE_ID","ANTHROPIC_ORGANIZATION_ID","ANTHROPIC_WORKSPACE_ID","ANTHROPIC_SERVICE_ACCOUNT_ID","ANTHROPIC_IDENTITY_TOKEN","ANTHROPIC_IDENTITY_TOKEN_FILE","ANTHROPIC_SCOPE","ANTHROPIC_PROFILE","ANTHROPIC_CONFIG_DIR","HOME","XDG_CONFIG_HOME","APPDATA","USERPROFILE","ANTHROPIC_CUSTOM_HEADERS","CLAUDE_CODE_HOST_CREDS_FILE","CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST","CLAUDE_CODE_HOST_AUTH_ENV_VAR","CLAUDE_CONFIG_DIR","CLAUDE_SECURESTORAGE_CONFIG_DIR","CLAUDE_CODE_REMOTE_SETTINGS_PATH","CLAUDE_CODE_MANAGED_SETTINGS_PATH","CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION","CLAUDE_CODE_MOCK_REMOTE_SETTINGS","USE_LOCAL_OAUTH","USE_STAGING_OAUTH","CLAUDE_LOCAL_OAUTH_API_BASE","CLAUDE_LOCAL_OAUTH_APPS_BASE","CLAUDE_LOCAL_OAUTH_CONSOLE_BASE","CLAUDE_BRIDGE_BASE_URL","CLAUDE_BRIDGE_OAUTH_TOKEN","CLAUDE_BRIDGE_SESSION_INGRESS_URL","CLAUDE_REMOTE_TOOLS_BRIDGE_URL"].map((e)=>e.toUpperCase()));function c4e(e){if(!e?.env)return e;let t=Qf(e.env,(n,r)=>a4e.has(r.toUpperCase()));return{...e,env:t}}function l4e(){let e=cP();if(!Tb()&&e.eligible!==!0)return null;if(e.sessionCache)return e.sessionCache;let t=o4e();if(t)return e.seedFromDisk(t),Fw(),t;return null}function XY(){let e=l4e();if(e===cP().verifiedPayload||Tb())return e;return c4e(e)}var QY=["userSettings","projectSettings","localSettings","flagSettings","policySettings"];function u4e(e){return e!==void 0&&(e.commit!==void 0||e.pr!==void 0)}function eJ(e,t){let n=e?.commitTrailers;if(typeof n==="boolean")return n?"explicit-enabled":"disabled";if(e!==void 0&&u4e(e))return e.commit===""?"disabled":"implicit-enabled";if(t!==void 0)return t?"implicit-enabled":"disabled";return}import{userInfo as d4e}from"os";var tJ="com.anthropic.claudecode",am="HKLM\\SOFTWARE\\Policies\\ClaudeCode",cm="HKCU\\SOFTWARE\\Policies\\ClaudeCode",yi="Settings",nJ="/usr/bin/plutil",rJ=["-convert","json","-o","-","--"],oJ=5000,lP="/mnt/c/Windows/System32/reg.exe",xu="/mnt/c/Program Files/ClaudeCode";function kb(){if(process.platform!=="linux")return!1;if(process.env.WSL_DISTRO_NAME)return!0;try{let e=Ne("fs").readFileSync("/proc/version","utf8").toLowerCase();return e.includes("microsoft")||e.includes("wsl")}catch{return!1}}function sJ(){let e="";try{e=d4e().username}catch{}let t=[];if(e)t.push({path:`/Library/Managed Preferences/${e}/${tJ}.plist`,label:"per-user managed preferences"});return t.push({path:`/Library/Managed Preferences/${tJ}.plist`,label:"device-level managed preferences"}),t}var iJ=512;function aJ(e){return e.map(p4e)}function p4e(e){let{file:t,severity:n,docLink:r,statusOnly:o,startupFatal:s,mcpErrorMetadata:i,path:a,message:c,expected:l,suggestion:u,invalidValue:p,...f}=e,m=f;return{file:t,severity:n,docLink:r,statusOnly:o,startupFatal:s,mcpErrorMetadata:i,path:lm(a),message:lm(c),expected:l===void 0?void 0:lm(l),suggestion:u===void 0?void 0:lm(u),invalidValue:typeof p==="string"?lm(p):void 0}}function lm(e){let t=qY(e.replace(/\s+/gu," "));return t.length>iJ?`${t.slice(0,iJ-1)}…`:t}var gs="https://code.claude.com/docs/en",f4e=[{matches:(e)=>e.path==="permissions.defaultMode"&&e.code==="invalid_value",tip:{suggestion:'Valid modes: "acceptEdits" (ask before file changes), "plan" (analysis only), "bypassPermissions" (auto-accept all), or "default" (standard behavior)',docLink:`${gs}/iam#permission-modes`}},{matches:(e)=>e.path==="apiKeyHelper"&&e.code==="invalid_type",tip:{suggestion:'Provide a shell command that outputs your API key to stdout. The script should output only the API key. Example: "/bin/generate_temp_api_key.sh"'}},{matches:(e)=>e.path==="cleanupPeriodDays"&&e.code==="too_small",tip:{suggestion:'cleanupPeriodDays must be at least 1. To keep transcripts for a long time, set a large number (e.g. 3650 for ~10 years). To disable transcript writes entirely, remove this setting and use the --no-session-persistence CLI flag or the SDK persistSession:false option instead. (0 is rejected because it previously silently disabled all transcript writes, which users setting it to mean "never clean up" did not expect.)'}},{matches:(e)=>e.path.startsWith("env.")&&e.code==="invalid_type",tip:{suggestion:'Environment variables must be strings. Wrap numbers and booleans in quotes. Example: "DEBUG": "true", "PORT": "3000"',docLink:`${gs}/settings#environment-variables`}},{matches:(e)=>(e.path==="permissions.allow"||e.path==="permissions.deny")&&e.code==="invalid_type"&&e.expected==="array",tip:{suggestion:'Permission rules must be in an array. Format: ["Tool(specifier)"]. Examples: ["Bash(npm run build)", "Edit(docs/**)", "Read(~/.zshrc)"]. Use * for wildcards.'}},{matches:(e)=>e.path.startsWith("hooks.")&&e.code==="invalid_key",tip:{suggestion:"Not a recognized hook event. Common events: PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, SessionEnd, Stop. Check spelling and capitalization.",docLink:`${gs}/hooks`}},{matches:(e)=>/\.hooks\.\d+\.command$/.test(e.path)&&e.code==="invalid_type"&&e.received==="undefined",tip:{suggestion:'Command hooks require `command`. For exec form (no shell), set `command` to the executable and `args` to its arguments: {"type": "command", "command": "echo", "args": ["hi"]}. For shell form, set `command` to the full shell string: {"type": "command", "command": "echo hi"}.',docLink:`${gs}/hooks#exec-form-and-shell-form`}},{matches:(e)=>e.path.includes("hooks")&&e.code==="invalid_type",tip:{suggestion:'Hooks use a matcher + hooks array. The matcher is a string: a tool name ("Bash"), pipe-separated list ("Edit|Write"), or empty to match all. Example: {"PostToolUse": [{"matcher": "Edit|Write", "hooks": [{"type": "command", "command": "echo Done"}]}]}'}},{matches:(e)=>e.code==="invalid_type"&&e.expected==="boolean",tip:{suggestion:'Use true or false without quotes. Example: "includeCoAuthoredBy": true'}},{matches:(e)=>e.code==="unrecognized_keys",tip:{suggestion:"Check for typos or refer to the documentation for valid fields",docLink:`${gs}/settings`}},{matches:(e)=>e.code==="invalid_value"&&e.enumValues!==void 0,tip:{suggestion:void 0}},{matches:(e)=>e.code==="invalid_type"&&e.expected==="object"&&e.received===null&&e.path==="",tip:{suggestion:"Check for missing commas, unmatched brackets, or trailing commas. Use a JSON validator to identify the exact syntax error."}},{matches:(e)=>e.path==="permissions.additionalDirectories"&&e.code==="invalid_type",tip:{suggestion:'Must be an array of directory paths. Example: ["~/projects", "/tmp/workspace"]. You can also use --add-dir flag or /add-dir command',docLink:`${gs}/iam#working-directories`}}],m4e={permissions:`${gs}/iam#configuring-permissions`,env:`${gs}/settings#environment-variables`,hooks:`${gs}/hooks`};function cJ(e){let t=f4e.find((r)=>r.matches(e));if(!t)return null;let n={...t.tip};if(e.code==="invalid_value"&&e.enumValues&&!n.suggestion)n.suggestion=`Valid values: ${e.enumValues.map((r)=>`"${r}"`).join(", ")}`;if(!n.docLink&&e.path)n.docLink=m4e[qb(e.path,".")];return n}var WMt=D(()=>wb(sm(),{strictPolicyHelperKeys:!0}).strict());function lJ(e){return e.code==="invalid_type"}function uJ(e){return e.code==="invalid_value"}function h4e(e){return e.code==="unrecognized_keys"}function dJ(e){return e.code==="too_small"}function Ua(e){if(e===null)return"null";if(e===void 0)return"undefined";if(Array.isArray(e))return"array";return typeof e}function pJ(e){let t=e.match(/received (\w+)/);return t?t[1]:void 0}function um(e,t){return e.issues.map((n)=>{let r=n.path.map(String).join("."),o=n.message,s,i,a,c,l;if(uJ(n))i=n.values.map((p)=>String(p)),a=i.join(" | "),c=void 0,l=void 0;else if(lJ(n)){a=n.expected;let p=pJ(n.message);c=p??Ua(n.input),l=p??Ua(n.input)}else if(dJ(n))a=String(n.minimum);else if(n.code==="custom"&&"params"in n)c=n.params.received,l=c;let u=cJ({path:r,code:n.code,expected:a,received:c,enumValues:i,message:n.message,value:c});if(uJ(n))s=i?.map((p)=>`"${p}"`).join(", "),o=`Invalid value. Expected one of: ${s}`;else if(lJ(n)){let p=pJ(n.message)??Ua(n.input);if(n.expected==="object"&&p==="null"&&r==="")o="Invalid or malformed JSON";else o=`Expected ${n.expected}, but received ${p}`}else if(h4e(n)){let p=n.keys.join(", ");o=`Unrecognized ${JP(n.keys.length,"field")}: ${p}`}else if(dJ(n))o=`Number must be greater than or equal to ${n.minimum}`,s=String(n.minimum);return{file:t,path:r,message:o,expected:s,invalidValue:l,suggestion:u?.suggestion,docLink:u?.docLink}})}function g4e(e,t){if(!e||typeof e!=="object")return[];let n=e;if(!n.permissions||typeof n.permissions!=="object")return[];let r=n.permissions,o=[];for(let s of["allow","deny","ask"]){let i=r[s];if(!Array.isArray(i))continue;r[s]=i.filter((a)=>{if(typeof a!=="string")return o.push({file:t,path:`permissions.${s}`,message:`Non-string value in ${s} array was removed`,severity:"warning",invalidValue:a}),!1;let c=tP(a,s);if(!c.valid){let l=`Invalid permission rule "${a}" was skipped: ${c.error}`;if(c.suggestion)l+=`. ${c.suggestion}`;return o.push({file:t,path:`permissions.${s}`,message:l,severity:"warning",invalidValue:a}),!1}return!0})}return o}var _4e=new Set(Ka);function y4e(e,t){if(!e||typeof e!=="object")return[];let n=e;if(!("hooks"in n))return[];if(n.hooks===null||typeof n.hooks!=="object"||Array.isArray(n.hooks)){let s=Ua(n.hooks);return delete n.hooks,[{file:t,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${s}. This field was ignored.`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"}]}let r=n.hooks,o=[];for(let s of Object.keys(r)){if(!_4e.has(s)){delete r[s],o.push({file:t,path:`hooks.${s}`,message:`Unknown hook event "${s}" was ignored. Valid events: ${Ka.join(", ")}`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"});continue}if(!Array.isArray(r[s])){let i=Ua(r[s]);delete r[s],o.push({file:t,path:`hooks.${s}`,message:`Hook event "${s}" must be an array of matchers; received ${i}. This entry was ignored.`,severity:"warning",invalidValue:i,docLink:"https://code.claude.com/docs/en/hooks"})}}if(o.length>0&&Object.keys(r).length===0)delete n.hooks;return o}var b4e=[{key:"allowedMcpServers",schema:xb},{key:"deniedMcpServers",schema:vb}];function S4e(e,t,n){if(!e||typeof e!=="object")return[];let r=e,o=[];for(let{key:s,schema:i}of b4e){if(!(s in r))continue;if(!Array.isArray(r[s])){if(n?.keepWholeFieldInvalid)continue;let l=r[s];delete r[s],o.push({file:t,path:s,message:`"${s}" must be an array; received ${Ua(l)}. This field was ignored.`,severity:"warning",invalidValue:l});continue}let a=r[s],c=[];for(let l=0;l<a.length;l++){let u=i().safeParse(a[l]);if(u.success)c.push(a[l]);else o.push({file:t,path:`${s}[${l}]`,message:`Invalid entry was ignored: ${u.error.issues[0]?.message??"failed validation"}`,severity:"warning",invalidValue:a[l]})}if(c.length<a.length)r[s]=c}return o}function E4e(e){if(!e||typeof e!=="object")return;let t=e.source;if(!t||typeof t!=="object")return;let n=t.source;return typeof n==="string"?n:void 0}function x4e(e){if(!e||typeof e!=="object")return!1;let t=e.source;if(!t||typeof t!=="object")return!1;let n=t.plugins;return Array.isArray(n)&&n.some(YO)}function v4e(e,t){if(!e||typeof e!=="object")return[];let n=e,r="extraKnownMarketplaces";if(!(r in n))return[];let o=n[r];if(!o||typeof o!=="object"||Array.isArray(o)){let a=Ua(o);return delete n[r],[{file:t,path:r,message:`"${r}" must be an object mapping marketplace names to declarations; received ${a}. This field was ignored.`,severity:"warning",invalidValue:a}]}let s=o,i=[];for(let a of Object.keys(s)){let c=sP().safeParse(s[a]),l;if(!c.success){let u=E4e(s[a]);if(u!==void 0&&!gY.has(u)||x4e(s[a]))continue;l=hb(c.error.issues)}else if(c.data.source.source==="settings"&&c.data.source.name!==a)l=`key "${yu(a)}" must match the settings source name "${yu(c.data.source.name)}"`;if(l!==void 0)i.push({file:t,path:`${r}.${yu(a)}`,message:`Invalid marketplace entry was ignored: ${l}`,severity:"warning"}),delete s[a]}return i}function Fa(e,t,n){return[...w5(e,t),...g4e(e,t),...y4e(e,t),...v4e(e,t),...n?.skipMcpServerEntryFilter?[]:S4e(e,t,{keepWholeFieldInvalid:n?.mcpServerEntrySalvageOnly})]}function pP(e){let t=new Set(e.allowedSources);return t.add("flagSettings"),t.add("policySettings"),QY.filter((n)=>t.has(n))}function T4e(){return So(Da(),"managed-settings.json")}function gJ(e){if(rs()==="wsl"&&e.wslInherits?.()){let t=uP(xu,e.store);if(t.settings)return t;let n=uP(Da(),e.store);return{settings:n.settings,errors:[...t.errors,...n.errors]}}return uP(Da(),e.store)}function uP(e,t){let n=[],r={},o=!1,{settings:s,errors:i}=vu(So(e,"managed-settings.json"),t,void 0,!0);if(n.push(...i),s&&Object.keys(s).length>0)r=bo(r,s,$o),o=!0;let a=So(e,"managed-settings.d");try{let u=Xe().readdirSync(a).filter((p)=>(p.isFile()||p.isSymbolicLink())&&p.name.endsWith(".json")&&!p.name.startsWith(".")).map((p)=>p.name).sort();for(let p of u){let{settings:f,errors:m}=vu(So(a,p),t,void 0,!0);if(n.push(...m),f&&Object.keys(f).length>0)r=bo(r,f,$o),o=!0}}catch(u){let p=De(u);if(p!=="ENOENT"&&p!=="ENOTDIR")de(`managed-settings.d read failed: ${u}`,{level:"error"})}let{wslInheritsWindowsSettings:c,...l}=r;return{settings:o&&Object.keys(l).length>0?r:null,errors:n}}function k4e(e,t){if(pr(e))de(`Broken symlink or missing file encountered for settings.json at path: ${t}`);else de(`settings file read failed at ${t}: ${e}`,{level:"error"})}function vu(e,t,n,r){let o=n!==void 0?`${e}\x00pinned`:e,s=t.parsedFiles.get(o);if(s)return{settings:s.settings?ns(s.settings):null,errors:s.errors};let i=O4e(e,n,r);return t.parsedFiles.set(o,i),{settings:i.settings?ns(i.settings):null,errors:i.errors}}function _J(e){if(!e.mdm)return{settings:null,errors:[]};let t=e.mdm();return{settings:Object.keys(t.settings).length>0?t.settings:null,errors:t.errors}}function Rb(e,t){let n=ns(e),r=Fa(n,t,{skipMcpServerEntryFilter:!0}),o=[],s=aP(yJ(t,o),t).safeParse(n);if(!s.success)return{settings:null,errors:[...r,...um(s.error,t)]};return{settings:Object.keys(s.data).length>0?s.data:null,errors:[...r,...o]}}function yJ(e,t){return(n)=>{if(t.push({file:e,path:n.path,message:n.message,severity:"warning",...n.statusOnly&&{statusOnly:n.statusOnly},...n.startupFatal&&{startupFatal:n.startupFatal}}),n.statusOnly||n.startupFatal)de(`${e}: ${n.path}: ${n.message}`,{level:n.startupFatal?"error":"warn"})}}function bJ(e){let t=e?.remote?e.remote():XY();if(!t||Object.keys(t).length===0)return{settings:null,errors:[]};let{settings:n,errors:r}=Rb(t,"remote managed settings");return{settings:n,errors:aJ(r)}}function C4e(e){let t=e.parentManaged;if(!t||Object.keys(t).length===0)return{settings:null,errors:[]};return Rb(t,"parent managed settings")}function SJ(e){let t=e.flagInline;if(!t)return{settings:null,errors:[]};let n=ns(t),r=Fa(n,"SDK inline settings"),o=Eu().safeParse(n);if(!o.success)return{settings:null,errors:[...r,...um(o.error,"SDK inline settings")]};return{settings:o.data,errors:r}}var R4e=2097152;function O4e(e,t,n){try{let r;if(t!==void 0)r=t;else{let{resolvedPath:o}=Tp(Xe(),e);r=Pa(o,R4e)}return P4e(r,e,n)}catch(r){return I4e(r,e)}}function P4e(e,t,n){if(e.trim()==="")return{settings:{},errors:[]};let r=ns(Ia(e,!1));if(n){let i=Fa(r,t,{skipMcpServerEntryFilter:!0}),a=[],c=aP(yJ(t,a),t).safeParse(r);if(!c.success)return{settings:null,errors:[...i,...um(c.error,t)]};return{settings:c.data,errors:[...i,...a]}}let o=Fa(r,t),s=Eu().safeParse(r);if(!s.success){let i=um(s.error,t);return{settings:null,errors:[...o,...i]}}return{settings:s.data,errors:o}}function I4e(e,t){if(k4e(e,t),pr(e))return{settings:null,errors:[]};return{settings:null,errors:[{file:t,path:"",message:`Settings file could not be read: ${e instanceof Error?e.message:String(e)}`,severity:"fatal"}]}}function fJ(e,t){switch(e){case"userSettings":return Fr(jt());case"policySettings":case"projectSettings":return Fr(t.cwd);case"localSettings":return EJ(t.cwd,t.canonicalGitRoot);case"flagSettings":return t.flagPath?A4e(Fr(t.flagPath)):Fr(t.cwd)}}function EJ(e,t){let n=t?.(e);if(!n)return Fr(e);let r=Fr(n),o=Fr(e);if(r===o)return r;let s;try{s=N4e()}catch{return o}if(r===s)return o;if(!M4e(r))return o;return r}function D4e(e){return vJ.canonicalRootOwnerUids(e)}class xJ{ownerUidsByRoot=new Map;realHomeDir=void 0;canonicalRootOwnerUids(e){let t=this.ownerUidsByRoot.get(e);if(t!==void 0)return t;let n=L4e(e);return this.ownerUidsByRoot.set(e,n),n}hasCanonicalRootOwnerUids(e){return this.ownerUidsByRoot.has(e)}clearCanonicalRootOwnerUids(){this.ownerUidsByRoot.clear()}normalizedRealHomeDir(){return this.realHomeDir??=U4e(),this.realHomeDir}clearNormalizedRealHomeDir(){this.realHomeDir=void 0}reset(){this.ownerUidsByRoot.clear(),this.realHomeDir=void 0}}var vJ=new xJ;function L4e(e){let t=Xe(),n=null;try{n=t.lstatSync(So(e,".claude")).uid}catch(r){if(!pr(r))throw r}return{rootUid:t.statSync(e).uid,gitEntryUid:t.lstatSync(So(e,".git")).uid,claudeEntryUid:n}}function M4e(e){if(typeof process.getuid!=="function"&&typeof process.geteuid!=="function")return de(`localSettings: not canonicalizing the consent store to ${e} — this platform has no uid semantics to verify directory ownership with, so the store stays at the session cwd (canonicalization is POSIX-only)`,{level:"warn"}),!1;let t=typeof process.geteuid==="function"?process.geteuid():process.getuid?.();try{let{rootUid:n,gitEntryUid:r,claudeEntryUid:o}=D4e(e);if(n===t&&r===t&&(o===null||o===t))return!0;return de(`localSettings: not canonicalizing the consent store to ${e} — it (uid ${n}), its .git entry (uid ${r}), or its .claude entry (uid ${o??"absent"}) is not owned by the current user (uid ${t}); the store stays at the session cwd (the pre-canonicalization behavior). If you own this repo, chown it (including .git and .claude) or run from a directory you own.`,{level:"warn"}),!1}catch(n){return de(`localSettings: not canonicalizing the consent store to ${e} — its ownership could not be verified (${n instanceof Error?n.message:String(n)}); the store stays at the session cwd`,{level:"warn"}),!1}}function N4e(){return vJ.normalizedRealHomeDir()}function U4e(){let e=Kb(w4e());if(e===null)throw Error("home directory realpath unavailable");return ct(e)}var mJ={default:"settings.json",cowork:"cowork_settings.json"};function F4e(e){if(e.coworkPlugins||Cn.CLAUDE_CODE_USE_COWORK_PLUGINS)return mJ.cowork;return mJ.default}function dm(e,t){switch(e){case"userSettings":return So(fJ(e,t),F4e(t));case"projectSettings":case"localSettings":return So(fJ(e,t),wJ(e));case"policySettings":return T4e();case"flagSettings":return t.flagPath}}function wJ(e){switch(e){case"projectSettings":return So(".claude","settings.json");case"localSettings":return So(".claude","settings.local.json")}}function AJ(e){if(EJ(e.cwd,e.canonicalGitRoot)===Fr(e.cwd))return;return So(Fr(e.cwd),wJ("localSettings"))}function TJ(e,t){let n=t.store.perSource.get(e);if(n!==void 0)return n;let r=V4e(e,t);return t.store.perSource.set(e,r),r}function z4e(e){return!e||e.parentSettingsBehavior==="merge"}function $4e(e,t){let n={};if(e.allowManagedHooksOnly===!0)n.allowManagedHooksOnly=!0;if(e.disableCommandPluginSources===!0)n.disableCommandPluginSources=!0;if(e.allowManagedMcpServersOnly===!0)n.allowManagedMcpServersOnly=!0;if(e.disableClaudeAiConnectors===!0)n.disableClaudeAiConnectors=!0;if(e.syncClaudeAiSkills===!1)n.syncClaudeAiSkills=!1;if(e.allowManagedPermissionRulesOnly===!0)n.allowManagedPermissionRulesOnly=!0;if(eJ(e.attribution,e.includeCoAuthoredBy)==="disabled")n.attribution={...n.attribution,commitTrailers:!1};if(e.attribution?.sessionUrl===!1)n.attribution={...n.attribution,sessionUrl:!1};let r=e.strictPluginOnlyCustomization;if(r===!0||Array.isArray(r)&&r.length>0)n.strictPluginOnlyCustomization=r;if(e.deniedMcpServers)n.deniedMcpServers=e.deniedMcpServers;if(t.forceLoginOrgUUID===void 0&&e.forceLoginOrgUUID)n.forceLoginOrgUUID=e.forceLoginOrgUUID;if(t.allowedMcpServers===void 0&&e.allowedMcpServers)n.allowedMcpServers=e.allowedMcpServers;if(t.availableModels===void 0&&e.availableModels)n.availableModels=e.availableModels;if(e.enforceAvailableModels===!0)n.enforceAvailableModels=!0;if(e.permissions){let o=ub(e.permissions,["deny","ask"]);if(e.permissions.disableBypassPermissionsMode==="disable")o.disableBypassPermissionsMode="disable";if(t.allowManagedPermissionRulesOnly!==!0){let{allow:s,additionalDirectories:i}=e.permissions;if(s&&t.sandbox?.network?.allowManagedDomainsOnly!==!0)o.allow=s;if(i)o.additionalDirectories=i}if(Object.keys(o).length>0)n.permissions=o}if(e.sandbox){let{network:o,filesystem:s,credentials:i}=e.sandbox,a={};if(e.sandbox.enabled===!0)a.enabled=!0;if(e.sandbox.failIfUnavailable===!0)a.failIfUnavailable=!0;if(e.sandbox.allowUnsandboxedCommands===!1)a.allowUnsandboxedCommands=!1;if(e.sandbox.autoAllowBashIfSandboxed===!1)a.autoAllowBashIfSandboxed=!1;if(o){let c=ub(o,["deniedDomains"]);if(o.allowManagedDomainsOnly===!0)c.allowManagedDomainsOnly=!0;if(o.strictAllowlist===!0)c.strictAllowlist=!0;if(t.sandbox?.network?.allowManagedDomainsOnly!==!0&&o.allowedDomains)c.allowedDomains=o.allowedDomains;if(Object.keys(c).length>0)a.network=c}if(s){let c=ub(s,["denyRead","denyWrite"]);if(s.allowManagedReadPathsOnly===!0)c.allowManagedReadPathsOnly=!0;if(s.disabled===!1)c.disabled=!1;if(t.sandbox?.filesystem?.allowManagedReadPathsOnly!==!0&&s.allowRead)c.allowRead=s.allowRead;if(Object.keys(c).length>0)a.filesystem=c}if(i){let c=(i.files??[]).map((p)=>p.mode==="deny"?{path:p.path,mode:"deny"}:{path:p.path,mode:"mask",injectHosts:[]}),l=(i.envVars??[]).filter((p)=>p.mode==="deny").map((p)=>({name:p.name,mode:"deny"})),u={...c.length>0&&{files:c},...l.length>0&&{envVars:l}};if(i.allowPlaintextInject===!1)u.allowPlaintextInject=!1;if(i.sigv4){let p={};for(let f of["streaming","presigned","sigv4a"])if(i.sigv4[f]==="deny")p[f]="deny";u.sigv4=p}{let p=gu,f=ea((i.awsPairs??[]).flatMap((m)=>[m.accessKeyIdVar,m.secretAccessKeyVar,...m.sessionTokenVar!==void 0?[m.sessionTokenVar]:[]]).filter((m)=>p.includes(m)));if(f.length>0)u.awsPairs=f.map((m,h)=>({accessKeyIdVar:m,secretAccessKeyVar:`${U5}${h+1}_`}))}if(Object.keys(u).length>0)a.credentials=u}if(Object.keys(a).length>0)n.sandbox=a}return n}var j4e=new Set([...[...MO].filter((e)=>e!=="ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION"),...NO,"CLAUDE_CODE_AUTO_MODE_MODEL","CLAUDE_CODE_BG_CLASSIFIER_MODEL","CLAUDE_CONTEXT_COLLAPSE_MODEL"]);function H4e(e,t){if(!t||!e)return null;let n={};if(e.model!==void 0)n.model=e.model;if(e.availableModels!==void 0)n.availableModels=e.availableModels;if(e.enforceAvailableModels!==void 0)n.enforceAvailableModels=e.enforceAvailableModels;if(e.fallbackModel!==void 0)n.fallbackModel=e.fallbackModel;return Object.keys(n).length>0?n:null}function Cb(e){if(delete e.model,delete e.fallbackModel,delete e.modelOverrides,e.env){let t={};for(let[n,r]of Object.entries(e.env))if(!j4e.has(n.toUpperCase()))t[n]=r;e.env=t}}function kJ(e){let t=fP(e);if(t.composes==="tier")return"helper";if(t.composes==="remoteSlot"||bJ(e).settings)return"remote";if(_J(e).settings)return rs()==="macos"?"plist":"hklm";if((e.file?.()??gJ(e)).settings)return"file";let n=dP(e);if(n.parentSlice||n.hostModelOverlay)return"parent";let r=e.hkcu?.();return r&&Object.keys(r.settings).length>0?"hkcu":null}function dP(e){let t=[],{settings:n,errors:r}=bJ(e);t.push(...r);let o=fP(e),s=o.composes==="remoteSlot"?o.helper:n,{settings:i,errors:a}=_J(e);t.push(...a);let{settings:c,errors:l}=e.file?.()??gJ(e);t.push(...l);let{settings:u,errors:p}=C4e(e);t.push(...p);let f=[s,i,c].filter((x)=>x!==null),m=f[0]??null,h={remote:s!==null,mdm:i!==null,file:c!==null},_={allowManagedPermissionRulesOnly:f.some((x)=>x.allowManagedPermissionRulesOnly===!0)||void 0,forceLoginOrgUUID:f[0]?.forceLoginOrgUUID,allowedMcpServers:f[0]?.allowedMcpServers,availableModels:f[0]?.availableModels,sandbox:{network:{allowManagedDomainsOnly:f.some((x)=>x.sandbox?.network?.allowManagedDomainsOnly===!0)||void 0},filesystem:{allowManagedReadPathsOnly:f.some((x)=>x.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)||void 0}}},y=u&&z4e(m)?$4e(u,_):null,S=y&&Object.keys(y).length>0?y:null,b=H4e(u,e.hostManagedProvider);return{tiers:f,admin:m,parentSlice:S,hostModelOverlay:b,errors:t,present:h}}function fP(e){let t=e.helper?.()??null;if(!t)return{composes:"none"};return e.helperArmedFromRemote?.()===!1?{composes:"tier",helper:t}:{composes:"remoteSlot",helper:t}}var B4e=["apiKeyHelper","awsAuthRefresh","awsCredentialExport","gcpAuthRefresh"];function K4e(e){return C5.some((t)=>e.startsWith(t))||k5.includes(e)}function G4e(e,t,n){let r=new Map,o=new Map,s=!1;for(let[i,a]of e.entries()){let c=new Set,l=t?.[i]===!0;for(let[u,p]of Object.entries(a??{})){let f=u.toUpperCase(),m=K4e(f);if(m&&p.trim()==="")continue;if(m&&s)continue;if(m&&i>0&&t?.[i]===!0)continue;let h=r.get(f);if(h!==void 0){if(c.has(f))o.set(u,p);else if(!o.has(u))o.set(u,h);continue}if(i>0&&n?.[i]?.has(f))continue;if(o.set(u,p),c.add(f),r.set(f,p),m)l=!0}if(l)s=!0}return Object.fromEntries(o)}var W4e="CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION";function hJ(e){if(!e)return;let t={};for(let[n,r]of Object.entries(e))if(n.toUpperCase()!==W4e)t[n]=r;return t}function q4e(e,t){let n=Object.entries(e??{}),r=t??{};return n.length===Object.keys(r).length&&n.every(([o,s])=>r[o]===s)}function CJ(e){let t=fP(e),n=e.helperWarnings?.()??[];if(t.composes==="tier"){let{helper:h}=t;e.store.lastPolicyEnvComposition=null;let _=e.hostManagedProvider?{...h}:h;if(e.hostManagedProvider)Cb(_);e.store.policy.pairedModelOverrides={value:e.hostManagedProvider&&h.availableModels!==void 0?h.modelOverrides:void 0};let y=e.store.policy.helperBaseStatusNotices??=dP(e).errors.filter((S)=>S.statusOnly);return{settings:_,errors:[...y,...n]}}let{tiers:r,admin:o,parentSlice:s,hostModelOverlay:i,errors:a,present:c}=dP(e);if(a.push(...n),!o&&!s){e.store.lastPolicyEnvComposition=null,e.store.policy.pairedModelOverrides={value:void 0};let h=e.hkcu?.();if(h&&Object.keys(h.settings).length>0){let _=e.hostManagedProvider?{...h.settings}:h.settings;if(e.hostManagedProvider){if(Cb(_),i)Object.assign(_,i)}return{settings:_,errors:[...a,...h.errors]}}if(i)return{settings:{...i},errors:[...a,...h?.errors??[]]};return{settings:null,errors:[...a,...h?.errors??[]]}}let l=bo({},s??{},o??{},$o);if(r.some((h)=>h.forceRemoteSettingsRefresh===!0))l.forceRemoteSettingsRefresh=!0;let u=Cn.CLAUDE_CODE_DISABLE_ADMIN_ENV_UNION===!0,p=l.env;if(!u){let h=G4e(r.map((_)=>_.env),r.map((_)=>(_.otelHeadersHelper??"").trim()!==""),r.map((_)=>{let y=new Set;for(let S of B4e){let b=_[S];if(typeof b==="string"&&b.trim()!=="")for(let x of R5[S])y.add(x)}return y.size>0?y:void 0}));if(Object.keys(h).length>0)l.env=h;else delete l.env}if(l.env){let h=hJ(l.env);if(h&&Object.keys(h).length>0)l.env=h;else delete l.env}if(e.hostManagedProvider){if(Cb(l),i)Object.assign(l,i)}let f={env:hJ(p)};if(e.hostManagedProvider)Cb(f);let m=!u&&!q4e(l.env,f.env);return e.store.lastPolicyEnvComposition={unionOptedOut:u,unionChangedEnv:m,remoteTierPresent:c.remote,mdmTierPresent:c.mdm,fileTierPresent:c.file,adminTierCount:r.length,tiersWithEnv:Ap(r,(h)=>Object.keys(h.env??{}).length>0)},e.store.policy.pairedModelOverrides={value:e.hostManagedProvider&&o?.availableModels!==void 0&&o.modelOverrides!==void 0&&i?.availableModels===void 0?o.modelOverrides:void 0},{settings:l,errors:a}}function V4e(e,t,{includeLegacyLocalSettings:n=!0}={}){if(e==="policySettings")return CJ(t).settings;let r=dm(e,t),{settings:o}=r?vu(r,t.store,e==="flagSettings"?t.flagExpectedContent:void 0):{settings:null};if(e==="flagSettings"){let{settings:s}=SJ(t);if(s)return bo(o||{},s,$o)}if(e==="localSettings"&&n){let s=AJ(t);if(s){let{settings:i}=vu(s,t.store);if(i)return t.onLegacyLocalSettingsRead?.("per_source"),bo(i,o||{},$o)}}return o}function Z4e(e,t){return{...e,...t}}function $o(e,t,n){if(Array.isArray(e)&&Array.isArray(t)){if(n==="fallbackModel")return t;return ea([...e,...t])}if(n==="extraKnownMarketplaces"&&Qn(e)&&Qn(t))return Z4e(e,t);return}function Y4e(e){if(e.store.isLoadingFromDisk)return{settings:{},errors:[]};let t=Date.now();Zf("info","settings_load_started"),e.store.isLoadingFromDisk=!0;try{let n=e.store.pluginBase,r={};if(n)r=bo(r,n,$o);let o=[],s=new Set,i=new Set,a=(l)=>{for(let u of l){let p=`${u.file}:${u.path}:${u.message}`;if(!s.has(p))s.add(p),o.push(u)}},c=null;for(let l of pP(e)){if(l==="policySettings"){let{settings:p,errors:f}=CJ(e);if(c=p,p)r=bo(r,p,$o);a(f);continue}if(l==="localSettings"){let p=AJ(e);if(p&&!i.has(Fr(p))){i.add(Fr(p));let{settings:f,errors:m}=vu(p,e.store);if(a(m),f)e.onLegacyLocalSettingsRead?.("cascade"),r=bo(r,f,$o)}}let u=dm(l,e);if(u){let p=Fr(u),f=l==="flagSettings"&&e.flagExpectedContent!==void 0;if(!i.has(p)||f){i.add(p);let{settings:m,errors:h}=vu(u,e.store,l==="flagSettings"?e.flagExpectedContent:void 0);if(a(h),m)r=bo(r,m,$o)}}if(l==="flagSettings"){let{settings:p,errors:f}=SJ(e);if(a(f),p)r=bo(r,p,$o)}}if(c){if(c.availableModels!==void 0)r.availableModels=[...c.availableModels];if(c.enforceAvailableModels!==void 0)r.enforceAvailableModels=c.enforceAvailableModels}return Zf("info","settings_load_completed",{duration_ms:Date.now()-t,source_count:i.size,error_count:o.length}),{settings:r,errors:o}}finally{e.store.isLoadingFromDisk=!1}}function J4e(e){let t=e.store.mergedSettings;if(t!==null)return t;let n=Y4e(e);return e.store.mergedSettings=n,n}function X4e(e){let{settings:t}=J4e(e);return t||{}}function RJ(e){e.store.invalidateAll();let t=[];for(let n of pP(e)){let r=TJ(n,e);if(r&&Object.keys(r).length>0)t.push({source:n,settings:r})}return{effective:X4e(e),sources:t}}function OJ(e,t){let n=pP(t);for(let r=n.length-1;r>=0;r--){let o=n[r];if(TJ(o,t)?.[e]!==void 0)return o}return null}import{execFile as Q4e}from"child_process";import{existsSync as e6e}from"fs";class PJ{promise=null;start(){if(this.promise)return;this.promise=mP()}reset(){this.promise=null}}var t6e=new PJ;function pm(e,t){return new Promise((n)=>{try{Q4e(e,t,{encoding:"utf-8",timeout:oJ,windowsHide:!0},(r,o)=>{n({stdout:o??"",code:r?1:0})})}catch{n({stdout:"",code:1})}})}function mP(){return(async()=>{if(process.platform==="darwin"){let e=sJ(),n=(await Promise.all(e.map(async({path:r,label:o})=>{if(!e6e(r))return{stdout:"",label:o,ok:!1};let{stdout:s,code:i}=await pm(nJ,[...rJ,r]);return{stdout:s,label:o,ok:i===0&&!!s}}))).find((r)=>r.ok);return{plistStdouts:n?[{stdout:n.stdout,label:n.label}]:[],hklmStdout:null,hkcuStdout:null}}if(process.platform==="win32"){let t=`${process.env.SYSTEMROOT||"C:\\Windows"}\\System32\\reg.exe`,[n,r]=await Promise.all([pm(t,["query",am,"/v",yi]),pm(t,["query",cm,"/v",yi])]);return{plistStdouts:null,hklmStdout:n.code===0?n.stdout:null,hkcuStdout:r.code===0?r.stdout:null}}if(kb()){let[e,t]=await Promise.all([pm(lP,["query",am,"/v",yi]),pm(lP,["query",cm,"/v",yi])]);return{plistStdouts:null,hklmStdout:e.code===0?e.stdout:null,hkcuStdout:t.code===0?t.stdout:null}}return{plistStdouts:null,hklmStdout:null,hkcuStdout:null}})()}function IJ(){return t6e.promise}var bi=Object.freeze({settings:{},errors:[]});class NJ{mdm=null;hkcu=null;wslInherits=!1;loadPromise=null;startLoad(e){if(this.loadPromise)return;this.loadPromise=(async()=>{let t=Date.now(),n=IJ()??mP(),{mdm:r,hkcu:o,wslInherits:s}=await o6e(await n,e);this.replace(r,o,s);let i=Date.now()-t;if(de(`MDM settings load completed in ${i}ms`),Object.keys(r.settings).length>0){de(`MDM settings found: ${Object.keys(r.settings).join(", ")}`);try{Zf("info","mdm_settings_loaded",{duration_ms:i,key_count:Object.keys(r.settings).length,error_count:r.errors.length})}catch{}}})()}replace(e,t,n){this.mdm=e,this.hkcu=t,this.wslInherits=n}reset(){this.mdm=null,this.hkcu=null,this.wslInherits=!1,this.loadPromise=null}}var n6e=new ft(()=>new NJ);function fm(){return n6e.of(Nt().host)}function r6e(e){fm().startLoad(e)}async function UJ(){let e=fm();if(!e.loadPromise)r6e();await e.loadPromise}function FJ(){return fm().mdm??bi}function zJ(){return fm().hkcu??bi}function $J(){return fm().wslInherits}function hP(e,t){let n=Ia(e,!1);if(!n||typeof n!=="object")return{settings:{},errors:[]};let{settings:r,errors:o}=Rb(n,t);return{settings:r??{},errors:o}}function DJ(e,t="Settings"){let n=e.split(/\r?\n/),r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`^\\s+${r}\\s+REG_(?:EXPAND_)?SZ\\s+(.*)$`,"i");for(let s of n){let i=s.match(o);if(i&&i[1])return i[1].trimEnd()}return null}async function o6e(e,t){let n=[];if(e.plistStdouts&&e.plistStdouts.length>0){let{stdout:a,label:c}=e.plistStdouts[0],l=hP(a,c),{wslInheritsWindowsSettings:u,...p}=l.settings;if(Object.keys(p).length>0)return{mdm:l,hkcu:bi,wslInherits:!1};n.push(...l.errors)}let r=null;if(e.hklmStdout){let a=DJ(e.hklmStdout);if(a)r=hP(a,`Registry: ${am}\\${yi}`)}if(r)n.push(...r.errors);let o=n.length>0?{settings:{},errors:n}:bi,s=kb(),i=!1;if(s){if(i=r?.settings.wslInheritsWindowsSettings===!0||await i6e(t),!i)return{mdm:o,hkcu:bi,wslInherits:!1}}if(r){let{wslInheritsWindowsSettings:a,...c}=r.settings;if(Object.keys(c).length>0)return{mdm:r,hkcu:bi,wslInherits:i}}if(await s6e(i,t))return{mdm:o,hkcu:bi,wslInherits:i};if(e.hkcuStdout){let a=DJ(e.hkcuStdout);if(a){let c=hP(a,`Registry: ${cm}\\${yi}`);if(!s||c.settings.wslInheritsWindowsSettings===!0){let{wslInheritsWindowsSettings:l,...u}=c.settings;return{mdm:o,hkcu:{settings:u,errors:c.errors},wslInherits:i}}if(c.errors.length>0)return{mdm:o,hkcu:{settings:{},errors:c.errors},wslInherits:i}}}return{mdm:o,hkcu:bi,wslInherits:i}}async function jJ(e,t){if(He()&&t!==void 0)return(await SZ(e)).content;return Pa(e)}async function HJ(e,t){if(He()&&t!==void 0)return await Xe().readdir(e);return Xe().readdirSync(e)}async function s6e(e,t){if(e&&await MJ(xu,t))return!0;return MJ(Da(),t)}async function LJ(e,t){let n=ns(Ia(await jJ(e,t),!1));if(!n||typeof n!=="object")return!1;Fa(n,e);let{wslInheritsWindowsSettings:r,...o}=n;return Object.keys(o).length>0}async function i6e(e){async function t(n){try{let r=Ia(await jJ(n,e),!1);return!!r&&typeof r==="object"&&"wslInheritsWindowsSettings"in r&&r.wslInheritsWindowsSettings===!0}catch{return!1}}if(await t(wu(xu,"managed-settings.json")))return!0;try{let n=wu(xu,"managed-settings.d");for(let r of await HJ(n,e))if((r.isFile()||r.isSymbolicLink())&&r.name.endsWith(".json")&&!r.name.startsWith(".")&&await t(wu(n,r.name)))return!0}catch{}return!1}async function MJ(e,t){try{if(await LJ(wu(e,"managed-settings.json"),t))return!0}catch{}try{let n=wu(e,"managed-settings.d"),r=await HJ(n,t);for(let o of r){if(!(o.isFile()||o.isSymbolicLink())||!o.name.endsWith(".json")||o.name.startsWith("."))continue;try{if(await LJ(wu(n,o.name),t))return!0}catch{}}}catch{}return!1}var c6e={user:"userSettings",project:"projectSettings",local:"localSettings"},BJ={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},l6e=["user","project","local"],u6e=new Set(["bypassPermissions","auto","acceptEdits"]),d6e=new Set(["project"]);function p6e(e){let t=e.effective.permissions?.defaultMode;if(!t||!u6e.has(t))return e.effective;for(let n=e.sources.length-1;n>=0;n--){let r=e.sources[n];if(r.settings.permissions?.defaultMode!==void 0){if(d6e.has(r.source)){let{defaultMode:o,...s}=e.effective.permissions??{};return{...e.effective,permissions:s}}return e.effective}}return e.effective}async function KJ(e={}){await UJ();let t={store:new yg,cwd:a6e(e.cwd??Xe().cwd()),allowedSources:(e.settingSources??l6e).map((a)=>c6e[a]),parentManaged:e.managedSettings??null,flagInline:null,flagPath:void 0,mdm:FJ,hkcu:zJ,wslInherits:$J,...e.serverManagedSettings!==void 0&&{remote:()=>e.serverManagedSettings}},{effective:n,sources:r}=RJ(t),o=kJ(t)??void 0,s=r.map(({source:a,settings:c})=>({source:BJ[a],settings:c,path:a==="policySettings"?void 0:dm(a,t),...a==="policySettings"&&{policyOrigin:o}})),i={};for(let a of Object.keys(n)){let c=OJ(a,t);if(c)i[a]={source:BJ[c],path:c==="policySettings"?void 0:dm(c,t),...c==="policySettings"&&{policyOrigin:o}}}return{effective:n,provenance:i,sources:s}}process.env.NoDefaultCurrentDirectoryInExePath="1";async function LUt(e){return KJ(e)}var x6e=["enabledPlugins","extraKnownMarketplaces","additionalMarketplaces"];function GJ(e){let t;try{t=yt(Nl(e.toString("utf8")))}catch{return e}if(!WJ(t))return e;let n=!1;for(let o of x6e)if(Object.hasOwn(t,o))delete t[o],n=!0;let r=t.env;if(WJ(r)&&Object.hasOwn(r,"CLAUDE_CONFIG_DIR"))delete r.CLAUDE_CONFIG_DIR,n=!0;return n?fe(t):e}function WJ(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}async function v6e(e,t){if(!e)return;let n=e;try{let r=yt(e);if(r?.claudeAiOauth?.refreshToken)delete r.claudeAiOauth.refreshToken,n=fe(r)}catch{}await YJ(t,n,{mode:384})}function w6e(){if(process.platform!=="darwin")return Promise.resolve(void 0);let e=hq(mq);return new Promise((t)=>{f6e("security",["find-generic-password","-a",gq(),"-w","-s",e],{encoding:"utf-8",timeout:5000,windowsHide:!0},(n,r)=>t(n?void 0:r.trim()||void 0))})}async function QJ(e,t,n,r,o=60000,s){if(!nt(t))return;let i=zr(n,r),a=await Er(e.load({projectKey:i,sessionId:t}),o,`SessionStore.load() timed out after ${o}ms for session ${t}`);if(!a||a.length===0)return;let c=mn(b6e(),`claude-resume-${SP()}`);try{let l=mn(c,"projects",i);await gP(l,{recursive:!0,mode:448});let u=mn(l,`${t}.jsonl`);await cf(u,a);let p=r?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR,f=p??mn(_P(),".claude"),m;try{m=await ZJ(mn(f,".credentials.json"),"utf-8")}catch(S){if(!pr(S))throw S}if(!p&&!(r??process.env).ANTHROPIC_API_KEY&&!(r??process.env).CLAUDE_CODE_OAUTH_TOKEN)m=await w6e()??m;await v6e(m,mn(c,".credentials.json"));let h=fq(Cn.CLAUDE_CONFIG_DIR),_=mn(p??_P(),".claude.json");await G_(_,mn(c,".claude.json"),void 0,GC(s,_,h.globalConfig,un.globalConfig()));let y=mn(f,"settings.json");if(await G_(y,mn(c,"settings.json"),GJ,GC(s,y,h.userSettings,un.userSettings())),await G_(mn(f,"cowork_settings.json"),mn(c,"cowork_settings.json"),GJ),e.listSubkeys)await A6e(e,{projectKey:i,sessionId:t},mn(l,t),o);return c}catch(l){throw await Ob(c),l}}async function A6e(e,t,n,r){let o=await Er(e.listSubkeys({projectKey:t.projectKey,sessionId:t.sessionId}),r,`SessionStore.listSubkeys() timed out after ${r}ms for session ${t.sessionId}`);for(let s of o){let i=mm(n,s+".jsonl");if(!s||JJ(s)||s.split(/[\\/]/).includes("..")||!i.startsWith(n+EP)){de(`[SessionStore] skipping unsafe subpath from listSubkeys: ${s}`,{level:"warn"});continue}let a=await Er(e.load({projectKey:t.projectKey,sessionId:t.sessionId,subpath:s}),r,`SessionStore.load() timed out after ${r}ms for session ${t.sessionId} subpath ${s}`);if(!a||a.length===0)continue;let c=[],l=[];for(let u of a)if(bP(u))c.push(u);else l.push(u);if(l.length>0)await gP(yP(i),{recursive:!0}),await cf(i,l);if(c.length>0){let u=c.at(-1),p=mm(n,s+".meta.json");await gP(yP(p),{recursive:!0});let{type:f,...m}=u;await YJ(p,fe(m),{mode:384})}}}function xP(e,t){let{isSingleUserTurn:n,resumeConfigDir:r,deferSpawn:o}=t,{systemPrompt:s,settings:i,managedSettings:a,settingSources:c,sandbox:l,...u}=e??{},p,f,m;if(s===void 0)p="";else if(typeof s==="string")p=s;else if(Array.isArray(s))p=s;else if(s.type==="preset")f=s.append,m=s.excludeDynamicSections;process.env.CLAUDE_AGENT_SDK_VERSION="0.3.239";let{abortController:h=ku(),additionalDirectories:_=[],agent:y,agents:S,allowedTools:b=[],betas:x,canUseTool:v,continue:T,cwd:U,debug:M,debugFile:F,disallowedTools:W=[],tools:ce,env:ne,executable:se=Ga()?"bun":"node",executableArgs:Se=[],extraArgs:Te={},fallbackModel:St,enableFileCheckpointing:Y,toolConfig:Ye,forkSession:Et,hooks:ht,includeHookEvents:er,includePartialMessages:Tt,forwardSubagentText:re,onElicitation:Q,onUserDialog:ee,supportedDialogKinds:Ue,persistSession:we,sessionStore:Qe,sessionStoreFlush:tr,thinking:rt,effort:$r,maxThinkingTokens:jo,maxTurns:Ft,maxBudgetUsd:hm,taskBudget:i8,mcpServers:wP,model:a8,outputFormat:AP,permissionMode:c8,allowDangerouslySkipPermissions:l8=!1,permissionPromptToolName:u8,plugins:d8,getOAuthToken:TP,getHostAuthToken:kP,workload:CP,resume:RP,resumeSessionAt:p8,resumeDropsTurn:f8,sessionId:m8,skills:OP,stderr:h8,strictMcpConfig:g8}=u,PP=c8??(e?.resolvePermissionModeInCli?void 0:"default");if(Qe&&we===!1)throw Error("sessionStore cannot be used with persistSession: false -- the storage adapter requires local writes to mirror from. Use CLAUDE_CONFIG_DIR=/tmp for ephemeral local writes with external mirroring.");if(Ue!==void 0&&Ue.length>0&&!ee)throw Error("supportedDialogKinds requires an onUserDialog callback -- declaring dialog kinds without a handler would park dialogs nothing can answer. Provide onUserDialog, or omit supportedDialogKinds.");if(Qe&&T&&!RP&&!Qe.listSessions)throw Error("Options.continue with sessionStore requires store.listSessions to be implemented");if(Qe&&Y)throw Error("enableFileCheckpointing is not yet supported with sessionStore (backup blobs are not mirrored, so rewindFiles() fails after a store-backed resume).");if(Qe&&u.spawnClaudeCodeProcess)de("sessionStore with custom spawnClaudeCodeProcess: ensure the subprocess CLAUDE_CONFIG_DIR matches the parent (same path, same separators) or transcript_mirror frames will be dropped.",{level:"warn"});yq(!!v,PP??"default",b);let Ib=u.pathToClaudeCodeExecutable;if(!Ib){let nr=E6e(import.meta.url),jr=y6e(nr),Si=kB((za)=>jr.resolve(za));if(!Si)throw Error(`Native CLI binary for ${process.platform}-${process.arch} not found. Reinstall @anthropic-ai/claude-agent-sdk without --omit=optional, or set options.pathToClaudeCodeExecutable.`);Ib=Si}let IP=AP?.type==="json_schema"?AP.schema:void 0,xn=ne?{...ne}:{...process.env};if(!xn.CLAUDE_CODE_ENTRYPOINT)xn.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(!xn.CLAUDE_AGENT_SDK_VERSION)xn.CLAUDE_AGENT_SDK_VERSION="0.3.239";if(Y)xn.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING="true";if(TP)xn.CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH="1";if(kP)xn.CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH="1";if(Ye?.askUserQuestion?.previewFormat)xn.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT=Ye.askUserQuestion.previewFormat;let Db={};if(Pb.propagation.inject(Pb.context.active(),Db),"traceparent"in Db){for(let nr of["TRACEPARENT","TRACESTATE"])if(!(nr in(ne??{})))delete xn[nr]}for(let[nr,jr]of Object.entries(Db)){let Si=nr.toUpperCase();if(!(Si in(ne??{})))xn[Si]=jr}let DP={},LP=new Map;if(wP)for(let[nr,jr]of Object.entries(wP))if(jr.type==="sdk"&&jr.instance)LP.set(nr,jr.instance);else DP[nr]=jr;let Au;if(rt)switch(rt.type){case"adaptive":Au={type:"adaptive",display:rt.display};break;case"enabled":Au={type:"enabled",budgetTokens:rt.budgetTokens,display:rt.display};break;case"disabled":Au={type:"disabled"};break}else if(jo!==void 0)Au=jo===0?{type:"disabled"}:{type:"enabled",budgetTokens:jo};if(r){if(xn.CLAUDE_CONFIG_DIR=r,process.platform==="win32")xn.CLAUDE_SECURESTORAGE_CONFIG_DIR=ne?.CLAUDE_SECURESTORAGE_CONFIG_DIR??process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR??ne?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR??""}let MP=new Ok({abortController:h,additionalDirectories:_,agent:y,betas:x,cwd:U,debug:M,debugFile:F,executable:se,executableArgs:Se,extraArgs:CP?{...Te,workload:CP}:Te,pathToClaudeCodeExecutable:Ib,env:xn,forkSession:Et,stderr:h8,thinkingConfig:Au,effort:$r,maxTurns:Ft,maxBudgetUsd:hm,taskBudget:i8,model:a8,fallbackModel:St,jsonSchema:IP,permissionMode:PP,allowDangerouslySkipPermissions:l8,permissionPromptToolName:u8,continueConversation:Qe?void 0:T,resume:RP,resumeSessionAt:p8,resumeDropsTurn:f8,sessionId:m8,settings:typeof i==="object"?fe(i):i,managedSettings:a?fe(a):void 0,settingSources:c,skills:OP,allowedTools:b,disallowedTools:W,tools:ce,mcpServers:DP,strictMcpConfig:g8,canUseTool:!!v,hooks:!!ht,includeHookEvents:er,includePartialMessages:Tt,persistSession:we,sessionMirror:!!Qe,plugins:d8,sandbox:l,spawnClaudeCodeProcess:u.spawnClaudeCodeProcess,deferSpawn:o}),_8={systemPrompt:p,appendSystemPrompt:f,planModeInstructions:u.planModeInstructions,appendSubagentSystemPrompt:u.appendSubagentSystemPrompt,toolAliases:u.toolAliases,excludeDynamicSections:m,agents:S,title:u.title,skills:OP,webSearchIsolationExemptMcpServers:u.webSearchIsolationExemptMcpServers,promptSuggestions:u.promptSuggestions,agentProgressSummaries:u.agentProgressSummaries,forwardSubagentText:re,supportedDialogKinds:Ue},Lb=new y_(MP,n,v,ht,h,LP,IP,_8,Q,TP,kP,ee);if(Qe){let nr=()=>mn(xn.CLAUDE_CONFIG_DIR??mn(_P(),".claude"),"projects"),jr=tr==="eager",Si=new Lk(async(za,Mb)=>{let Tu=VJ(za,nr());if(Tu)await Qe.append(Tu,Mb);else de(`[SessionStore] dropping mirror frame: filePath ${za} is not under ${nr()} -- subprocess CLAUDE_CONFIG_DIR likely differs from parent (custom spawnClaudeCodeProcess / container?)`,{level:"warn"})},{onError:(za,Mb)=>{let Tu=VJ(za,nr());if(Tu)Lb.reportMirrorError(Tu,Mb.message)},maxPendingEntries:jr?0:b_,maxPendingBytes:jr?0:Ol});Lb.setTranscriptMirrorBatcher(Si)}return{queryInstance:Lb,transport:MP,abortController:h,processEnv:xn}}function vP(e,t,n,r){if(typeof n==="string")t.write(fe({type:"user",session_id:"",message:{role:"user",content:[{type:"text",text:n}]},parent_tool_use_id:null})+`
`);else e.streamInput(n).catch((o)=>r.abort(o))}var T6e=new Set(["EBUSY","EMFILE","ENFILE","ENOTEMPTY","EPERM"]);async function Ob(e){for(let t=0;;t++)try{return await _6e(e,{recursive:!0,force:!0})}catch(n){if(t>=4||!T6e.has(De(n)??""))return;await Hr((t+1)*100)}}function k6e(e,t){e.waitForExit().catch(()=>{}).finally(()=>Ob(t))}function MUt({prompt:e,options:t}){if((t?.resume||t?.continue)&&t?.sessionStore)return C6e(e,t);let{queryInstance:n,transport:r,abortController:o}=xP(t,{isSingleUserTurn:typeof e==="string"});return vP(n,r,e,o),n}function C6e(e,t){let{queryInstance:n,transport:r,abortController:o,processEnv:s}=xP({...t},{isSingleUserTurn:typeof e==="string",deferSpawn:!0}),i=mm(t.cwd??"."),a=t.sessionStore,c=t.loadTimeoutMs??60000,l=t.resume;return(async()=>{if(!l)l=(await Er(a.listSessions(zr(i,t.env)),c,`SessionStore.listSessions() timed out after ${c}ms`)).slice().sort((f,m)=>m.mtime-f.mtime)[0]?.sessionId;if(!l)return;return QJ(a,l,i,t.env,t.loadTimeoutMs)})().then((p)=>{if(p){r.updateResume(l);let f={CLAUDE_CONFIG_DIR:p};if(process.platform==="win32"){let m=t.env?.CLAUDE_SECURESTORAGE_CONFIG_DIR??process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR??t.env?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR??"";f.CLAUDE_SECURESTORAGE_CONFIG_DIR=m,s.CLAUDE_SECURESTORAGE_CONFIG_DIR=m}r.updateEnv(f),s.CLAUDE_CONFIG_DIR=p,n.addCleanupCallback(()=>k6e(r,p))}if(!n.isClosed())r.spawn()}).catch((p)=>{let f=Or(p);r.spawnAbort(f),n.setError(f)}),vP(n,r,e,o),n}async function NUt({options:e,initializeTimeoutMs:t=60000}={}){let n,r=e?.resume;if((r||e?.continue)&&e?.sessionStore){let a=mm(e.cwd??".");if(!r){if(!e.sessionStore.listSessions)throw Error("Options.continue with sessionStore requires store.listSessions to be implemented");let c=e.loadTimeoutMs??60000;r=(await Er(e.sessionStore.listSessions(zr(a,e.env)),c,`SessionStore.listSessions() timed out after ${c}ms`)).slice().sort((u,p)=>p.mtime-u.mtime)[0]?.sessionId}if(r)n=await QJ(e.sessionStore,r,a,e.env,e.loadTimeoutMs)}let o,s,i;try{let m=function(){if(f)return;f=!0,u.close()},a=xP(n&&r&&r!==e?.resume?{...e,resume:r}:e,{isSingleUserTurn:!1,resumeConfigDir:n});o=a.queryInstance;let{transport:c,abortController:l}=a;s=c;let u=a.queryInstance;if(n){let h=n;u.addCleanupCallback(()=>{i=c.waitForExit().catch(()=>{}).then(()=>Ob(h))})}let p=`Subprocess initialization did not complete within ${t}ms — check authentication and network connectivity`;await Er(u.initializationResult(),t,p).catch((h)=>{throw ZN(h,p)?_n(h,{telemetryMessage:`Subprocess initialization did not complete within ${t}ms`,errorClass:"initialize_timeout"}):h});let f=!1;return{query(h){if(f)throw Error("WarmQuery.query() can only be called once");f=!0;try{vP(u,c,h,l)}catch(_){throw u.close(),_}if(typeof h==="string")u.setIsSingleUserTurn(!0);return u},close:m,async[Symbol.asyncDispose](){f=!0,u.close(),await i}}}catch(a){if(o?.close(),n&&!i){let c=s;i=(c?c.waitForExit().catch(()=>{}):Promise.resolve()).then(()=>Ob(n))}throw await i,a}}async function UUt(e,t){if(t?.sessionStore)return D6e(t.sessionStore,e,t);return PW(e,t)}async function FUt(e){if(e?.sessionStore)return O6e(e.sessionStore,e);return UW(e)}async function zUt(e,t){if(t?.sessionStore)return L6e(t.sessionStore,e,t);return FW(e,t)}async function $Ut(e,t,n){if(n?.sessionStore)return M6e(n.sessionStore,e,t,n.dir);return BW(e,t,n)}async function jUt(e,t,n){if(n?.sessionStore)return N6e(n.sessionStore,e,t,n.dir);return KW(e,t,n)}async function HUt(e,t){if(!nt(e))throw new Ze(`Invalid sessionId: ${e}`,"deleteSession: invalid sessionId (must be a UUID)");if(t?.sessionStore){if(!t.sessionStore.delete)return;let n=zr(t.dir);await t.sessionStore.delete({projectKey:n,sessionId:e});return}return GW(e,t)}async function BUt(e,t){if(t?.sessionStore)return U6e(t.sessionStore,e,t);return ZW(e,t)}async function KUt(e,t,n,r){if(!nt(e))throw new Ze(`Invalid sessionId: ${e}`,"importSessionToStore: invalid sessionId (must be a UUID)");let o=He(),s=o?r:void 0,i=await ti(e,n?.dir,Vn(s),o);if(!i)throw Error(`Session ${e} not found`);let a=zr(n?.dir),c=n?.batchSize&&n.batchSize>0?n.batchSize:b_,l=s===void 0?void 0:Sa(yP(i.filePath),Wn),u=s!==void 0&&l!==void 0?{backend:s,projectKey:l}:void 0;if(u!==void 0)await BC(u.backend,un.transcript(u.projectKey,e),{projectKey:a,sessionId:e},t,c);else await qJ(i.filePath,{projectKey:a,sessionId:e},t,c);if(n?.includeSubagents===!1)return;if(u!==void 0){let m=await cq(u.backend,u.projectKey,e),h=await lq(u.backend,u.projectKey,e,m);for(let _ of m){let y={projectKey:a,sessionId:e,subpath:K_(_)};await BC(u.backend,_.kind==="agent"?un.transcript(u.projectKey,e,_.agentId,_.agentRelPath):un.journal(u.projectKey,e,_.agentRelPath),y,t,c);let S=h.get(y.subpath),b;if(S!==void 0)try{b=yt(S)}catch(x){de(`importSessionToStore: skipping unreadable sidecar for ${y.subpath}: ${x}`)}if(b!==void 0)await t.append(y,[{type:"agent_metadata",...b}])}return}let p=i.filePath.replace(/\.jsonl$/,""),f=mn(p,"subagents");for(let m of await R6e(f)){let h=XJ(p,m).split(EP);h[h.length-1]=h.at(-1).replace(/\.jsonl$/,"");let _={projectKey:a,sessionId:e,subpath:h.join("/")};await qJ(m,_,t,c);let y=m.replace(/\.jsonl$/,".meta.json"),S;try{S=yt(await ZJ(y,"utf8"))}catch(b){if(!pr(b))de(`importSessionToStore: skipping unreadable sidecar ${y}: ${b}`)}if(S!==void 0)await t.append(_,[{type:"agent_metadata",...S}])}}async function qJ(e,t,n,r){let o=S6e({input:m6e(e,{encoding:"utf8"}),crlfDelay:1/0}),s=[],i=0;for await(let a of o){if(!a)continue;try{s.push(yt(a))}catch(c){de(`importSessionToStore: skipping unparseable line in ${e}: ${c}`);continue}if(i+=a.length,s.length>=r||i>=Ol)await n.append(t,s),s=[],i=0}if(s.length>0)await n.append(t,s)}async function R6e(e){let t=[];async function n(r){let o;try{o=await g6e(r,{withFileTypes:!0})}catch{return}for(let s of o){let i=mn(r,s.name);if(s.isDirectory())await n(i);else if(s.isFile()&&s.name.endsWith(".jsonl"))t.push(i)}}return await n(e),t}async function GUt(e,t){if(t?.sessionStore)return F6e(t.sessionStore,e,t.dir);return oq(e,t)}async function WUt(e,t,n){if(n?.sessionStore)return z6e(n.sessionStore,e,t,n);return sq(e,t,n)}function e8(e){let t=mm(e??"."),n;try{n=h6e(t)}catch{n=t}return ct(n)}function zr(e,t){let n=e8(e);if(t===void 0)return cs(n);return(t.CLAUDE_CONFIG_DIR?kx(t.CLAUDE_CODE_PROJECT_DIR_NAME):void 0)??uf(n)}function t8(e){return e.map((t)=>fe(t)).join(`
`)+`
`}function n8(e,t,n){if(t!==void 0&&t>0)return e.slice(n,n+t);if(n>0)return e.slice(n);return e}function bP(e){return typeof e==="object"&&e!==null&&"type"in e&&e.type==="agent_metadata"}async function O6e(e,t){let n=e8(t.dir),r=cs(n),o=t.offset??0,s=t.limit;if(e.listSessionSummaries)return P6e(e,r,n,t.dir,s,o);if(!e.listSessions)throw Error("sessionStore.listSessions is not implemented -- cannot list sessions. Provide a store with a listSessions() method.");let a=(await e.listSessions(r)).slice().sort((l,u)=>u.mtime-l.mtime),c=n8(a,s,o);return r8(e,c,t.dir,n)}async function P6e(e,t,n,r,o,s){let i=await e.listSessionSummaries(t),a=e.listSessions?new Map((await e.listSessions(t)).map((p)=>[p.sessionId,p])):void 0,c=[];for(let p of i){let f=a?.get(p.sessionId);if(a&&!f)continue;let m=f!==void 0&&p.mtime<f.mtime;c.push({sessionId:p.sessionId,mtime:m?f.mtime:p.mtime,info:m?void 0:QP(p,n)})}if(a){let p=new Set(i.map((f)=>f.sessionId));for(let[f,m]of a)if(!p.has(f))c.push({sessionId:f,mtime:m.mtime})}else de("listSessionSummaries without listSessions: gap-fill skipped; sessions lacking a sidecar will be omitted");c.sort((p,f)=>f.mtime-p.mtime);let l=n8(c,o,s),u=l.filter((p)=>p.info===void 0);if(u.length>0){let p=await r8(e,u,r,n),f=new Map(p.map((m)=>[m.sessionId,m]));for(let m of l)if(m.info===void 0)m.info=f.get(m.sessionId)??null}return l.flatMap((p)=>p.info?[p.info]:[])}async function r8(e,t,n,r){return(await Promise.allSettled(t.map(async(s)=>{let i=await s8(e,s.sessionId,n);if(!i)return null;let a=Bl(s.sessionId,o8(i,s.mtime),r);return a?{...a,lastModified:s.mtime}:null}))).flatMap((s,i)=>{let a=t[i];if(s.status==="fulfilled")return s.value?[s.value]:[];return[{sessionId:a.sessionId,summary:"",lastModified:a.mtime}]})}function o8(e,t){let n=Buffer.from(e,"utf-8"),r=n.length,o=n.subarray(0,br).toString("utf-8"),s=r>br?n.subarray(r-br).toString("utf-8"):o;return{mtime:t,size:r,head:o,tail:s}}function I6e(e){let t=e.trimEnd(),n=t.slice(t.lastIndexOf(`
`)+1);try{let r=yt(n);if(typeof r==="object"&&r!==null&&"timestamp"in r&&typeof r.timestamp==="string"){let o=Date.parse(r.timestamp);if(!Number.isNaN(o))return o}}catch{}return Date.now()}async function s8(e,t,n){let r=zr(n),o=await e.load({projectKey:r,sessionId:t});if(!o||o.length===0)return null;return t8(o)}async function D6e(e,t,n){if(!nt(t))return[];let r=zr(n.dir),o=await e.load({projectKey:r,sessionId:t});if(!o||o.length===0)return[];return RW(o,{limit:n.limit,offset:n.offset,includeSystemMessages:n.includeSystemMessages})}async function L6e(e,t,n){if(!nt(t))return;let r=await s8(e,t,n.dir);if(!r)return;let o=o8(r,I6e(r));return Bl(t,o)??void 0}async function M6e(e,t,n,r){if(!nt(t))throw new Ze(`Invalid sessionId: ${t}`,"renameSession: invalid sessionId (must be a UUID)");if(!n.trim())throw Error("title must be non-empty");let o=zr(r);await e.append({projectKey:o,sessionId:t},[{type:"custom-title",customTitle:n.trim(),sessionId:t,uuid:SP(),timestamp:new Date().toISOString()}])}async function N6e(e,t,n,r){if(!nt(t))throw new Ze(`Invalid sessionId: ${t}`,"tagSession: invalid sessionId (must be a UUID)");if(n!==null){let s=ya(n).trim();if(!s)throw Error("tag must be non-empty (use null to clear)");n=s}let o=zr(r);await e.append({projectKey:o,sessionId:t},[{type:"tag",tag:n??"",sessionId:t,uuid:SP(),timestamp:new Date().toISOString()}])}async function U6e(e,t,n){if(!nt(t))throw new Ze(`Invalid sessionId: ${t}`,"forkSession: invalid sessionId (must be a UUID)");if(n.upToMessageId&&!nt(n.upToMessageId))throw new Ze(`Invalid upToMessageId: ${n.upToMessageId}`,"forkSession: invalid upToMessageId (must be a UUID)");let r=zr(n.dir),o=await e.load({projectKey:r,sessionId:t});if(!o||o.length===0)throw Error(`Session ${t} not found`);let{entries:s,forkedSessionId:i}=YW(o,t,n);return await e.append({projectKey:r,sessionId:i},s),{sessionId:i}}async function F6e(e,t,n){if(!nt(t))return[];if(!e.listSubkeys)throw Error("sessionStore.listSubkeys is not implemented -- cannot list subagents. Provide a store with a listSubkeys() method.");let r=zr(n),o=await e.listSubkeys({projectKey:r,sessionId:t}),s=new Set;for(let i of o){if(!i.startsWith("subagents/"))continue;let a=i.split("/").at(-1);if(a.startsWith("agent-"))s.add(a.slice(6))}return[...s]}async function z6e(e,t,n,r){if(!nt(t))return[];if(!n)return[];let o=zr(r.dir),s=`subagents/agent-${n}`;if(e.listSubkeys){let p=await e.listSubkeys({projectKey:o,sessionId:t}),f=`agent-${n}`,m=p.find((h)=>h.startsWith("subagents/")&&h.split("/").at(-1)===f);if(!m)return[];s=m}let i=await e.load({projectKey:o,sessionId:t,subpath:s});if(!i||i.length===0)return[];let a=i.findLast(bP),c=typeof a?.toolUseId==="string"?a.toolUseId:void 0,l=typeof a?.parentAgentId==="string"?a.parentAgentId:void 0,u=i.filter((p)=>!bP(p));if(u.length===0)return[];return HC(Buffer.from(t8(u)),{limit:r.limit,offset:r.offset},c,l)}function VJ(e,t){let n=XJ(t,e),r=n.split(EP);if(r[0]===".."||JJ(n))return null;if(r.length<2)return null;let o=r[0],s=r[1];if(r.length===2&&s.endsWith(".jsonl"))return{projectKey:o,sessionId:s.replace(/\.jsonl$/,"")};if(r.length>=4){let i=r.slice(2),a=i.length-1;return i[a]=i.at(-1).replace(/\.jsonl$/,""),{projectKey:o,sessionId:s,subpath:i.join("/")}}return null}export{or as AbortError,sS as CommandMatcher,yo as DirectConnectError,fZ as DirectConnectTransport,B8 as EXIT_REASONS,aS as FileIndex,Ka as HOOK_EVENTS,Vb as InMemorySessionStore,kI as ORG_POLICY_LIMIT_PREFIXES,K8 as SYSTEM_PROMPT_DYNAMIC_BOUNDARY,TI as USAGE_LIMIT_ERROR_PREFIXES,RI as USAGE_TRANSITION_PREFIXES,CI as USAGE_WARNING_PREFIXES,oGe as createSdkMcpServer,HUt as deleteSession,p6e as filterEscalatingDefaultMode,xm as foldSessionSummary,BUt as forkSession,zUt as getSessionInfo,UUt as getSessionMessages,WUt as getSubagentMessages,KUt as importSessionToStore,FUt as listSessions,GUt as listSubagents,aGe as parseDirectConnectUrl,MUt as query,$Ut as renameSession,LUt as resolveSettings,NUt as startup,jUt as tagSession,rGe as tool};