broods 0.40.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/dist/account.d.ts +25 -16
- package/dist/account.js +1 -1
- package/dist/chunk-0skcam6p.js +66 -0
- package/dist/chunk-5c27kpbz.js +1 -0
- package/dist/chunk-6en45n1d.js +19 -0
- package/dist/chunk-6fg5av4s.js +15 -0
- package/dist/chunk-a09r7men.js +2 -0
- package/dist/chunk-my7k41qq.js +4 -0
- package/dist/chunk-n50ycxj1.js +5 -0
- package/dist/{chunk-dmvntxs7.js → chunk-np588ty2.js} +1 -1
- package/dist/{chunk-jzasj71k.js → chunk-xsxy0gem.js} +1 -1
- package/dist/chunk-y3exzqph.js +1 -0
- package/dist/cli/index.js +80 -99
- package/dist/index.d.ts +36 -28
- package/dist/index.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-ae3013v2.js +0 -15
- package/dist/chunk-evtz9fz0.js +0 -1
- package/dist/chunk-f294wr3z.js +0 -17
- package/dist/chunk-h06c1tg3.js +0 -2
- package/dist/chunk-kafpmgd4.js +0 -5
- package/dist/chunk-mf5em3wq.js +0 -4
- package/dist/chunk-ta62e9cc.js +0 -1
- package/dist/chunk-yw3ecd8t.js +0 -66
package/dist/chunk-ae3013v2.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import{we,$e,le,N,ue,Q,e,ke,ee,te,o,a,T,Ee,l,n,t,d,c,R,k,s,p,r,u,F,I}from"./chunk-yw3ecd8t.js";var{create:ul,defineProperty:fo,getOwnPropertyDescriptor:dl,getOwnPropertyNames:ml,getPrototypeOf:hl}=Object,pl=Object.prototype.hasOwnProperty,qe=(m,h)=>()=>(h||m((h={exports:{}}).exports,h),h.exports),Ni=(m,h)=>{let f={};for(var g in m)fo(f,g,{get:m[g],enumerable:!0});if(h)fo(f,Symbol.toStringTag,{value:"Module"});return f},fl=(m,h,f,g)=>{if(h&&typeof h==="object"||typeof h==="function"){for(var S=ml(h),_=0,y=S.length,E;_<y;_++)if(E=S[_],!pl.call(m,E)&&E!==f)fo(m,E,{get:((b)=>h[b]).bind(null,E),enumerable:!(g=dl(h,E))||g.enumerable})}return m},go=(m,h,f)=>(f=m!=null?ul(hl(m)):{},fl(h||!m||!m.__esModule?fo(f,"default",{value:m,enumerable:!0}):f,m));var gl=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),Ii=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),Sl=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),_l=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function Oi(m){return typeof m==="string"&&Ii.has(m.replace(/#$/,""))}function ki(m,h){if(!("$schema"in m)||typeof m.$schema!=="string")return"2020-12";let f=m.$schema.replace(/#$/,"");if(gl.has(f))return"2020-12";if(Ii.has(f))return"2019-09";if(Sl.has(f)||_l.has(f))return"draft-7";throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${m.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${h}`)}var Ai={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 Mi;(function(m){})(Mi||(Mi={}));function yl(m){return $e(te,m)}var za="2025-11-25";var Rn=[za,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],zn="io.modelcontextprotocol/related-task",Vt="io.modelcontextprotocol/protocolVersion",gr="io.modelcontextprotocol/clientInfo",jt="io.modelcontextprotocol/serverInfo",Dt="io.modelcontextprotocol/clientCapabilities",$a="io.modelcontextprotocol/subscriptionId",ca="io.modelcontextprotocol/logLevel";var Pa="2.0";var Lt=F(()=>c([e(),o(),a(),T(),s(e(),Lt),n(Lt)])),tt=s(e(),Lt),$n=n(Lt),Sr=c([e(),o().int()]),_r=e(),So=t({ttl:o().optional()}),_o=t({taskId:e()}),yr=d({progressToken:Sr.optional(),[zn]:_o.optional()}),dt=t({_meta:yr.optional()}),la=dt.extend({task:So.optional()}),at=t({method:e(),params:dt.loose().optional()}),ft=t({_meta:yr.optional()}),gt=t({method:e(),params:ft.loose().optional()}),vr=d({get[jt](){return Ta.optional().catch(void 0)}}),rt=d({_meta:vr.optional()}),Ut=c([e(),o().int()]),br=t({jsonrpc:r(Pa),id:Ut,...at.shape}).strict(),Rr=t({jsonrpc:r(Pa),...gt.shape}).strict(),Ea=t({jsonrpc:r(Pa),id:Ut,result:rt}).strict(),wa=t({jsonrpc:r(Pa),id:Ut.optional(),error:t({code:o().int(),message:e(),data:l().optional()})}).strict(),yo=c([br,Rr,Ea,wa]),Pn=c([Ea,wa]),zr=rt.strict(),vo=ft.extend({requestId:Ut.optional(),reason:e().optional()}),$r=gt.extend({method:r("notifications/cancelled"),params:vo}),bo=t({src:e(),mimeType:e().optional(),sizes:n(e()).optional(),theme:p(["light","dark"]).optional()}),Ht=t({icons:n(bo).optional()}),qt=t({name:e(),title:e().optional()}),Ta=qt.extend({...qt.shape,...Ht.shape,version:e(),websiteUrl:e().optional(),description:e().optional()}),zl=k(t({applyDefaults:a().optional()}),tt),$l=I((m)=>{if(m&&typeof m==="object"&&!Array.isArray(m)&&Object.keys(m).length===0)return{form:{}};return m},k(t({form:zl.optional(),url:tt.optional()}),tt.optional())),Ro=d({list:tt.optional(),cancel:tt.optional(),requests:d({sampling:d({createMessage:tt.optional()}).optional(),elicitation:d({create:tt.optional()}).optional()}).optional()}),zo=d({list:tt.optional(),cancel:tt.optional(),requests:d({tools:d({call:tt.optional()}).optional()}).optional()}),$o=t({experimental:s(e(),tt).optional(),sampling:t({context:tt.optional(),tools:tt.optional()}).optional(),elicitation:$l.optional(),roots:t({listChanged:a().optional()}).optional(),tasks:Ro.optional(),extensions:s(e(),tt).optional()}),Po=dt.extend({protocolVersion:e(),capabilities:$o,clientInfo:Ta}),Eo=at.extend({method:r("initialize"),params:Po}),Pr=t({experimental:s(e(),tt).optional(),logging:tt.optional(),completions:tt.optional(),prompts:t({listChanged:a().optional()}).optional(),resources:t({subscribe:a().optional(),listChanged:a().optional()}).optional(),tools:t({listChanged:a().optional()}).optional(),tasks:zo.optional(),extensions:s(e(),tt).optional()}),wo=rt.extend({protocolVersion:e(),capabilities:Pr,serverInfo:Ta,instructions:e().optional()}),To=gt.extend({method:r("notifications/initialized"),params:ft.optional()}),Co=at.extend({method:r("server/discover"),params:dt.optional()}),qo=rt.extend({supportedVersions:n(e()),capabilities:Pr,instructions:e().optional()}),Er=at.extend({method:r("ping"),params:dt.optional()}),jo=t({progress:o(),total:u(o()),message:u(e())}),No=t({...ft.shape,...jo.shape,progressToken:Sr}),wr=gt.extend({method:r("notifications/progress"),params:No}),Io=dt.extend({cursor:_r.optional()}),Ft=at.extend({params:Io.optional()}),xt=rt.extend({nextCursor:_r.optional()}),Tr=t({uri:e(),mimeType:u(e()),_meta:s(e(),l()).optional()}),Cr=Tr.extend({text:e()}),En=e().refine((m)=>{try{return atob(m),!0}catch{return!1}},{message:"Invalid Base64 string"}),qr=Tr.extend({blob:En}),Kt=p(["user","assistant"]),Nt=t({audience:n(Kt).optional(),priority:o().min(0).max(1).optional(),lastModified:N({offset:!0}).optional()}),jr=t({...qt.shape,...Ht.shape,uri:e(),description:u(e()),mimeType:u(e()),size:u(o()),annotations:Nt.optional(),_meta:u(d({}))}),Oo=t({...qt.shape,...Ht.shape,uriTemplate:e(),description:u(e()),mimeType:u(e()),annotations:Nt.optional(),_meta:u(d({}))}),ko=Ft.extend({method:r("resources/list")}),Mo=xt.extend({resources:n(jr)}),Ao=Ft.extend({method:r("resources/templates/list")}),Lo=xt.extend({resourceTemplates:n(Oo)}),Ca=dt.extend({uri:e()}),Vo=Ca,Do=at.extend({method:r("resources/read"),params:Vo}),Uo=rt.extend({contents:n(c([Cr,qr]))}),Ho=gt.extend({method:r("notifications/resources/list_changed"),params:ft.optional()}),Fo=Ca,xo=at.extend({method:r("resources/subscribe"),params:Fo}),Ko=Ca,Jo=at.extend({method:r("resources/unsubscribe"),params:Ko}),Nr=t({toolsListChanged:a().optional(),promptsListChanged:a().optional(),resourcesListChanged:a().optional(),resourceSubscriptions:n(e()).optional()}),Go=dt.extend({notifications:Nr}),Bo=at.extend({method:r("subscriptions/listen"),params:Go}),Yo=ft.extend({notifications:Nr}),Wo=gt.extend({method:r("notifications/subscriptions/acknowledged"),params:Yo}),Zo=vr.extend({[$a]:Ut}),Xo=rt.extend({_meta:Zo}),Qo=ft.extend({uri:e()}),es=gt.extend({method:r("notifications/resources/updated"),params:Qo}),ts=t({name:e(),description:u(e()),required:u(a())}),as=t({...qt.shape,...Ht.shape,description:u(e()),arguments:u(n(ts)),_meta:u(d({}))}),rs=Ft.extend({method:r("prompts/list")}),os=xt.extend({prompts:n(as)}),ss=dt.extend({name:e(),arguments:s(e(),e()).optional()}),ns=at.extend({method:r("prompts/get"),params:ss}),qa=t({type:r("text"),text:e(),annotations:Nt.optional(),_meta:s(e(),l()).optional()}),ja=t({type:r("image"),data:En,mimeType:e(),annotations:Nt.optional(),_meta:s(e(),l()).optional()}),Na=t({type:r("audio"),data:En,mimeType:e(),annotations:Nt.optional(),_meta:s(e(),l()).optional()}),is=t({type:r("tool_use"),name:e(),id:e(),input:s(e(),l()),_meta:s(e(),l()).optional()}),cs=t({type:r("resource"),resource:c([Cr,qr]),annotations:Nt.optional(),_meta:s(e(),l()).optional()}),ls=jr.extend({type:r("resource_link")}),Ia=c([qa,ja,Na,ls,cs]),us=t({role:Kt,content:Ia}),ds=rt.extend({description:e().optional(),messages:n(us)}),ms=gt.extend({method:r("notifications/prompts/list_changed"),params:ft.optional()}),hs=t({title:e().optional(),readOnlyHint:a().optional(),destructiveHint:a().optional(),idempotentHint:a().optional(),openWorldHint:a().optional()}),ps=t({taskSupport:p(["required","optional","forbidden"]).optional()}),Ir=t({...qt.shape,...Ht.shape,description:e().optional(),inputSchema:t({type:r("object"),properties:s(e(),Lt).optional(),required:n(e()).optional()}).catchall(l()),outputSchema:d({$schema:e().optional()}).optional(),annotations:hs.optional(),execution:ps.optional(),_meta:s(e(),l()).optional()}),fs=Ft.extend({method:r("tools/list")}),gs=xt.extend({tools:n(Ir)}),Or=rt.extend({content:n(Ia).default([]),structuredContent:l().optional(),isError:a().optional()}),wn=Or.or(rt.extend({toolResult:l()})),Ss=la.extend({name:e(),arguments:s(e(),l()).optional()}),_s=at.extend({method:r("tools/call"),params:Ss}),ys=gt.extend({method:r("notifications/tools/list_changed"),params:ft.optional()}),Tn=t({autoRefresh:a().default(!0),debounceMs:o().int().nonnegative().default(300)}),Jt=p(["debug","info","notice","warning","error","critical","alert","emergency"]),vs=dt.extend({level:Jt}),bs=at.extend({method:r("logging/setLevel"),params:vs}),Rs=ft.extend({level:Jt,logger:e().optional(),data:l()}),zs=gt.extend({method:r("notifications/message"),params:Rs}),$s=t({name:e().optional()}),Ps=t({hints:n($s).optional(),costPriority:o().min(0).max(1).optional(),speedPriority:o().min(0).max(1).optional(),intelligencePriority:o().min(0).max(1).optional()}),Es=t({mode:p(["auto","required","none"]).optional()}),ws=t({type:r("tool_result"),toolUseId:e().describe("The unique identifier for the corresponding tool call."),content:n(Ia),structuredContent:l().optional(),isError:a().optional(),_meta:s(e(),l()).optional()}),Ts=R("type",[qa,ja,Na]),ia=R("type",[qa,ja,Na,is,ws]),Cs=t({role:Kt,content:c([ia,n(ia)]),_meta:s(e(),l()).optional()}),qs=la.extend({messages:n(Cs),modelPreferences:Ps.optional(),systemPrompt:e().optional(),includeContext:p(["none","thisServer","allServers"]).optional(),temperature:o().optional(),maxTokens:o().int(),stopSequences:n(e()).optional(),metadata:tt.optional(),tools:n(Ir).optional(),toolChoice:Es.optional()}),js=at.extend({method:r("sampling/createMessage"),params:qs}),Ns=rt.extend({model:e(),stopReason:u(p(["endTurn","stopSequence","maxTokens"]).or(e())),role:Kt,content:Ts}),Is=rt.extend({model:e(),stopReason:u(p(["endTurn","stopSequence","maxTokens","toolUse"]).or(e())),role:Kt,content:c([ia,n(ia)])}),kr=t({type:r("boolean"),title:e().optional(),description:e().optional(),default:a().optional()}),Oa=t({type:r("string"),title:e().optional(),description:e().optional(),minLength:o().optional(),maxLength:o().optional(),format:p(["email","uri","date","date-time"]).optional(),default:e().optional()}),ka=t({type:p(["number","integer"]),title:e().optional(),description:e().optional(),minimum:o().optional(),maximum:o().optional(),default:o().optional()}),Mr=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),default:e().optional()}),Ar=t({type:r("string"),title:e().optional(),description:e().optional(),oneOf:n(t({const:e(),title:e()})),default:e().optional()}),Lr=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),enumNames:n(e()).optional(),default:e().optional()}),Os=c([Mr,Ar]),Vr=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({type:r("string"),enum:n(e())}),default:n(e()).optional()}),Dr=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({anyOf:n(t({const:e(),title:e()}))}),default:n(e()).optional()}),ks=c([Vr,Dr]),Ms=c([Lr,Os,ks]),Ur=c([Ms,kr,Oa,ka]),Ma=la.extend({mode:r("form").optional(),message:e(),requestedSchema:t({type:r("object"),properties:s(e(),Ur),required:n(e()).optional()}).catchall(l())}),As=la.extend({mode:r("url"),message:e(),elicitationId:e(),url:e().url()}),Ls=c([Ma,As]),Vs=at.extend({method:r("elicitation/create"),params:Ls}),Ds=ft.extend({elicitationId:e()}),Us=gt.extend({method:r("notifications/elicitation/complete"),params:Ds}),Hs=rt.extend({action:p(["accept","decline","cancel"]),content:I((m)=>m===null?void 0:m,s(e(),c([e(),o(),a(),n(e())])).optional())}),Fs=t({type:r("ref/resource"),uri:e()}),xs=t({type:r("ref/prompt"),name:e()}),Ks=dt.extend({ref:c([xs,Fs]),argument:t({name:e(),value:e()}),context:t({arguments:s(e(),e()).optional()}).optional()}),Js=at.extend({method:r("completion/complete"),params:Ks}),Gs=rt.extend({completion:d({values:n(e()).max(100),total:u(o().int()),hasMore:u(a())})}),Bs=t({uri:e().startsWith("file://"),name:e().optional(),_meta:s(e(),l()).optional()}),Ys=at.extend({method:r("roots/list"),params:dt.optional()}),Ws=rt.extend({roots:n(Bs)}),Zs=gt.extend({method:r("notifications/roots/list_changed"),params:ft.optional()}),Cn=d({ttl:o().optional(),pollInterval:o().optional()}),Xs=p(["working","input_required","completed","failed","cancelled"]),Gt=t({taskId:e(),status:Xs,ttl:c([o(),T()]),createdAt:e(),lastUpdatedAt:e(),pollInterval:u(o()),statusMessage:u(e())}),qn=rt.extend({task:Gt}),Qs=ft.merge(Gt),jn=gt.extend({method:r("notifications/tasks/status"),params:Qs}),Nn=at.extend({method:r("tasks/get"),params:dt.extend({taskId:e()})}),In=rt.merge(Gt),On=at.extend({method:r("tasks/result"),params:dt.extend({taskId:e()})}),kn=rt.loose(),Mn=Ft.extend({method:r("tasks/list")}),An=xt.extend({tasks:n(Gt)}),Ln=at.extend({method:r("tasks/cancel"),params:dt.extend({taskId:e()})}),Vn=rt.merge(Gt),Dn=c([Er,Eo,Co,Js,bs,ns,rs,ko,Ao,Do,xo,Jo,Bo,_s,fs]),Un=c([$r,wr,To,Zs]),Hn=c([zr,Ns,Is,Hs,Ws]),Fn=c([Er,js,Vs,Ys]),xn=c([$r,wr,zs,es,Ho,ys,ms,Wo,Us]),Kn=c([zr,wo,qo,Gs,ds,os,Mo,Lo,Uo,Or,gs,Xo]),ut=ee().superRefine((m,h)=>{if(!URL.canParse(m))return h.addIssue({code:Ai.custom,message:"URL must be parseable",fatal:!0}),we}).refine((m)=>{let h=new URL(m);return h.protocol!=="javascript:"&&h.protocol!=="data:"&&h.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Jn=d({resource:e().url(),authorization_servers:n(ut).optional(),jwks_uri:e().url().optional(),scopes_supported:n(e()).optional(),bearer_methods_supported:n(e()).optional(),resource_signing_alg_values_supported:n(e()).optional(),resource_name:e().optional(),resource_documentation:e().optional(),resource_policy_uri:e().url().optional(),resource_tos_uri:e().url().optional(),tls_client_certificate_bound_access_tokens:a().optional(),authorization_details_types_supported:n(e()).optional(),dpop_signing_alg_values_supported:n(e()).optional(),dpop_bound_access_tokens_required:a().optional()}),en=d({issuer:e(),authorization_endpoint:ut,token_endpoint:ut,registration_endpoint:ut.optional(),scopes_supported:n(e()).optional(),response_types_supported:n(e()),response_modes_supported:n(e()).optional(),grant_types_supported:n(e()).optional(),token_endpoint_auth_methods_supported:n(e()).optional(),token_endpoint_auth_signing_alg_values_supported:n(e()).optional(),service_documentation:ut.optional(),revocation_endpoint:ut.optional(),revocation_endpoint_auth_methods_supported:n(e()).optional(),revocation_endpoint_auth_signing_alg_values_supported:n(e()).optional(),introspection_endpoint:e().optional(),introspection_endpoint_auth_methods_supported:n(e()).optional(),introspection_endpoint_auth_signing_alg_values_supported:n(e()).optional(),code_challenge_methods_supported:n(e()).optional(),client_id_metadata_document_supported:a().optional(),authorization_response_iss_parameter_supported:a().optional().catch(void 0)}),tn=d({issuer:e(),authorization_endpoint:ut,token_endpoint:ut,userinfo_endpoint:ut.optional(),jwks_uri:ut,registration_endpoint:ut.optional(),scopes_supported:n(e()).optional(),response_types_supported:n(e()),response_modes_supported:n(e()).optional(),grant_types_supported:n(e()).optional(),acr_values_supported:n(e()).optional(),subject_types_supported:n(e()),id_token_signing_alg_values_supported:n(e()),id_token_encryption_alg_values_supported:n(e()).optional(),id_token_encryption_enc_values_supported:n(e()).optional(),userinfo_signing_alg_values_supported:n(e()).optional(),userinfo_encryption_alg_values_supported:n(e()).optional(),userinfo_encryption_enc_values_supported:n(e()).optional(),request_object_signing_alg_values_supported:n(e()).optional(),request_object_encryption_alg_values_supported:n(e()).optional(),request_object_encryption_enc_values_supported:n(e()).optional(),token_endpoint_auth_methods_supported:n(e()).optional(),token_endpoint_auth_signing_alg_values_supported:n(e()).optional(),display_values_supported:n(e()).optional(),claim_types_supported:n(e()).optional(),claims_supported:n(e()).optional(),service_documentation:e().optional(),claims_locales_supported:n(e()).optional(),ui_locales_supported:n(e()).optional(),claims_parameter_supported:a().optional(),request_parameter_supported:a().optional(),request_uri_parameter_supported:a().optional(),require_request_uri_registration:a().optional(),op_policy_uri:ut.optional(),op_tos_uri:ut.optional(),client_id_metadata_document_supported:a().optional(),authorization_response_iss_parameter_supported:a().optional().catch(void 0)}),Gn=t({...tn.shape,...en.pick({code_challenge_methods_supported:!0}).shape}),Bn=t({access_token:e(),id_token:e().optional(),token_type:e(),expires_in:yl().optional(),scope:e().optional(),refresh_token:e().optional()}).strip(),Yn=t({issued_token_type:r("urn:ietf:params:oauth:token-type:id-jag"),access_token:e(),token_type:e().optional(),expires_in:o().optional(),scope:e().optional()}).strip(),Wn=t({error:e(),error_description:e().optional(),error_uri:e().optional()}),bn=ut.optional().or(r("").transform(()=>{return})),an=t({redirect_uris:n(ut),token_endpoint_auth_method:e().optional(),grant_types:n(e()).optional(),response_types:n(e()).optional(),application_type:e().optional(),client_name:e().optional(),client_uri:ut.optional(),logo_uri:bn,scope:e().optional(),contacts:n(e()).optional(),tos_uri:bn,policy_uri:e().optional(),jwks_uri:ut.optional(),jwks:Ee().optional(),software_id:e().optional(),software_version:e().optional(),software_statement:e().optional()}).strip(),rn=t({client_id:e(),client_secret:e().optional(),client_id_issued_at:o().optional(),client_secret_expires_at:o().optional()}).strip(),Zn=an.merge(rn),Xn=t({error:e(),error_description:e().optional()}).strip(),Qn=t({token:e(),token_type_hint:e().optional()}).strip();var ri=Symbol.for("mcp.sdk.errorBrands");function ii(m,h){let f=new Set,g=h;while(typeof g==="function"){let S=g.mcpBrand;if(Object.prototype.hasOwnProperty.call(g,"mcpBrand")&&typeof S==="string")f.add(S);g=Object.getPrototypeOf(g)}if(f.size===0)return;Object.defineProperty(m,ri,{value:f,enumerable:!1,configurable:!0})}function La(m,h){try{if(typeof h==="object"&&h!==null&&Object.prototype.hasOwnProperty.call(m,"mcpBrand")&&typeof m.mcpBrand==="string"&&Object.prototype.hasOwnProperty.call(h,ri)){let f=h[ri];if(f&&typeof f.has==="function"&&f.has(m.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(m,h)}var Xm=class m extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](h){return La(this,h)}static isInstance(h){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return La(this,h)}constructor(h,f,g){super(f);this.code=h,this.errorUri=g,this.name="OAuthError",ii(this,new.target)}toResponseObject(){let h={error:this.code,error_description:this.message};if(this.errorUri)h.error_uri=this.errorUri;return h}static fromResponse(h){return new m(h.error,h.error_description??h.error,h.error_uri)}},Be=function(m){return m.NotConnected="NOT_CONNECTED",m.AlreadyConnected="ALREADY_CONNECTED",m.NotInitialized="NOT_INITIALIZED",m.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",m.RequestTimeout="REQUEST_TIMEOUT",m.ConnectionClosed="CONNECTION_CLOSED",m.SendFailed="SEND_FAILED",m.InvalidResult="INVALID_RESULT",m.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",m.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",m.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",m.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",m.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",m.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",m.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",m.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",m.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",m.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",m.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",m}({}),Ke=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](m){return La(this,m)}static isInstance(m){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return La(this,m)}constructor(m,h,f){super(h);this.code=m,this.data=f,this.name="SdkError",ii(this,new.target)}},Qm=class extends Ke{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(m,h,f){super(m,h,f);this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};function Li(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function Ol(m,h,f){return m==="elicitation"&&h==="form"&&f.form===void 0&&f.url===void 0}function Zi(m){switch(m.method){case"elicitation/create":if(m.params?.mode==="url")return{elicitation:{url:{}}};return{elicitation:{form:{}}};case"sampling/createMessage":{let h=m.params;if(h!==void 0&&(h.tools!==void 0||h.toolChoice!==void 0))return{sampling:{tools:{}}};return{sampling:{}}}case"roots/list":return{roots:{}};default:return}}function ci(m,h){let f={};for(let[g,S]of Object.entries(m)){if(S===void 0)continue;let _=h===void 0?void 0:h[g];if(_===void 0){f[g]=S;continue}if(Li(S)&&Li(_)){let y={};for(let[E,b]of Object.entries(S))if(b!==void 0&&_[E]===void 0&&!Ol(g,E,_))y[E]=b;if(Object.keys(y).length>0)f[g]=y}}return Object.keys(f).length>0?f:void 0}var Xi="2026-07-28",z=[Xi];function Da(m){return m>=Xi}function Qi(m){return m.filter((h)=>!Da(h))}function li(m){return m.filter((h)=>Da(h))}function ec(m){let h=m.structuredContent;if(h===void 0)return m;if(!(typeof h!=="object"||h===null||Array.isArray(h)))return m;if(m.content?.some((f)=>f.type==="text")??!1)return m;return{...m,content:[...m.content??[],{type:"text",text:JSON.stringify(h)}]}}var tc=["task","inputRequests","requestState"];function ui(m){if(m===null||typeof m!=="object"||Array.isArray(m)||m.content!==void 0||tc.some((h)=>(h in m)))return m;return{...m,content:[]}}function kl(){let m=F(()=>c([e(),o(),a(),T(),s(e(),m),n(m)])),h=s(e(),m),f=c([e(),o().int()]),g=e(),S=t({ttl:o().optional()}),_=t({taskId:e()}),y=d({progressToken:f.optional(),"io.modelcontextprotocol/related-task":_.optional()}),E=t({_meta:y.optional()}),b=E.extend({task:S.optional()}),C=t({method:e(),params:E.loose().optional()}),O=t({_meta:y.optional()}),D=t({method:e(),params:O.loose().optional()}),Z=d({_meta:y.optional()}),ae=c([e(),o().int()]),x=Z.strict(),K=O.extend({requestId:ae.optional(),reason:e().optional()}),V=D.extend({method:r("notifications/cancelled"),params:K}),w=t({src:e(),mimeType:e().optional(),sizes:n(e()).optional(),theme:p(["light","dark"]).optional()}),H=t({icons:n(w).optional()}),q=t({name:e(),title:e().optional()}),B=q.extend({...q.shape,...H.shape,version:e(),websiteUrl:e().optional(),description:e().optional()}),ne=k(t({applyDefaults:a().optional()}),h),U=I((pt)=>{if(pt&&typeof pt==="object"&&!Array.isArray(pt)&&Object.keys(pt).length===0)return{form:{}};return pt},k(t({form:ne.optional(),url:h.optional()}),h.optional())),j=d({list:h.optional(),cancel:h.optional(),requests:d({sampling:d({createMessage:h.optional()}).optional(),elicitation:d({create:h.optional()}).optional()}).optional()}),ce=d({list:h.optional(),cancel:h.optional(),requests:d({tools:d({call:h.optional()}).optional()}).optional()}),Pe=t({experimental:s(e(),h).optional(),sampling:t({context:h.optional(),tools:h.optional()}).optional(),elicitation:U.optional(),roots:t({listChanged:a().optional()}).optional(),tasks:j.optional(),extensions:s(e(),h).optional()}),Ie=E.extend({protocolVersion:e(),capabilities:Pe,clientInfo:B}),Te=C.extend({method:r("initialize"),params:Ie}),je=t({experimental:s(e(),h).optional(),logging:h.optional(),completions:h.optional(),prompts:t({listChanged:a().optional()}).optional(),resources:t({subscribe:a().optional(),listChanged:a().optional()}).optional(),tools:t({listChanged:a().optional()}).optional(),tasks:ce.optional(),extensions:s(e(),h).optional()}),Ae=Z.extend({protocolVersion:e(),capabilities:je,serverInfo:B,instructions:e().optional()}),Me=D.extend({method:r("notifications/initialized"),params:O.optional()}),Ge=C.extend({method:r("ping"),params:E.optional()}),Qe=t({progress:o(),total:u(o()),message:u(e())}),Ze=t({...O.shape,...Qe.shape,progressToken:f}),nt=D.extend({method:r("notifications/progress"),params:Ze}),Ye=E.extend({cursor:g.optional()}),he=C.extend({params:Ye.optional()}),Re=Z.extend({nextCursor:g.optional()}),Ne=t({uri:e(),mimeType:u(e()),_meta:s(e(),l()).optional()}),W=Ne.extend({text:e()}),me=e().refine((pt)=>{try{return atob(pt),!0}catch{return!1}},{message:"Invalid Base64 string"}),pe=Ne.extend({blob:me}),Oe=p(["user","assistant"]),Le=t({audience:n(Oe).optional(),priority:o().min(0).max(1).optional(),lastModified:N({offset:!0}).optional()}),Je=t({...q.shape,...H.shape,uri:e(),description:u(e()),mimeType:u(e()),size:u(o()),annotations:Le.optional(),_meta:u(d({}))}),He=t({...q.shape,...H.shape,uriTemplate:e(),description:u(e()),mimeType:u(e()),annotations:Le.optional(),_meta:u(d({}))}),Xe=he.extend({method:r("resources/list")}),St=Re.extend({resources:n(Je)}),de=he.extend({method:r("resources/templates/list")}),ze=Re.extend({resourceTemplates:n(He)}),Ce=E.extend({uri:e()}),De=Ce,Ue=C.extend({method:r("resources/read"),params:De}),xe=Z.extend({contents:n(c([W,pe]))}),ot=D.extend({method:r("notifications/resources/list_changed"),params:O.optional()}),ct=Ce,mt=C.extend({method:r("resources/subscribe"),params:ct}),it=Ce,et=C.extend({method:r("resources/unsubscribe"),params:it}),Rt=O.extend({uri:e()}),lt=D.extend({method:r("notifications/resources/updated"),params:Rt}),Tt=t({name:e(),description:u(e()),required:u(a())}),$t=t({...q.shape,...H.shape,description:u(e()),arguments:u(n(Tt)),_meta:u(d({}))}),Ct=he.extend({method:r("prompts/list")}),It=Re.extend({prompts:n($t)}),Ot=E.extend({name:e(),arguments:s(e(),e()).optional()}),Zt=C.extend({method:r("prompts/get"),params:Ot}),Xt=t({type:r("text"),text:e(),annotations:Le.optional(),_meta:s(e(),l()).optional()}),Qt=t({type:r("image"),data:me,mimeType:e(),annotations:Le.optional(),_meta:s(e(),l()).optional()}),ea=t({type:r("audio"),data:me,mimeType:e(),annotations:Le.optional(),_meta:s(e(),l()).optional()}),Fa=t({type:r("tool_use"),name:e(),id:e(),input:s(e(),l()),_meta:s(e(),l()).optional()}),kt=t({type:r("resource"),resource:c([W,pe]),annotations:Le.optional(),_meta:s(e(),l()).optional()}),xa=Je.extend({type:r("resource_link")}),zt=c([Xt,Qt,ea,xa,kt]),ma=t({role:Oe,content:zt}),ha=Z.extend({description:e().optional(),messages:n(ma)}),ta=D.extend({method:r("notifications/prompts/list_changed"),params:O.optional()}),Ka=t({title:e().optional(),readOnlyHint:a().optional(),destructiveHint:a().optional(),idempotentHint:a().optional(),openWorldHint:a().optional()}),pa=t({taskSupport:p(["required","optional","forbidden"]).optional()}),aa=t({...q.shape,...H.shape,description:e().optional(),inputSchema:t({type:r("object"),properties:s(e(),m).optional(),required:n(e()).optional()}).catchall(l()),outputSchema:t({type:r("object"),properties:s(e(),m).optional(),required:n(e()).optional()}).catchall(l()).optional(),annotations:Ka.optional(),execution:pa.optional(),_meta:s(e(),l()).optional()}),fa=he.extend({method:r("tools/list")}),ga=Re.extend({tools:n(aa)}),Sa=Z.extend({content:n(zt),structuredContent:s(e(),l()).optional(),isError:a().optional()}),ht=b.extend({name:e(),arguments:s(e(),l()).optional()}),Ja=C.extend({method:r("tools/call"),params:ht}),Zr=D.extend({method:r("notifications/tools/list_changed"),params:O.optional()}),_a=p(["debug","info","notice","warning","error","critical","alert","emergency"]),Ga=E.extend({level:_a}),Ba=C.extend({method:r("logging/setLevel"),params:Ga}),Ya=O.extend({level:_a,logger:e().optional(),data:l()}),Wa=D.extend({method:r("notifications/message"),params:Ya}),Za=t({name:e().optional()}),Xa=t({hints:n(Za).optional(),costPriority:o().min(0).max(1).optional(),speedPriority:o().min(0).max(1).optional(),intelligencePriority:o().min(0).max(1).optional()}),Qa=t({mode:p(["auto","required","none"]).optional()}),Xr=t({type:r("tool_result"),toolUseId:e().describe("The unique identifier for the corresponding tool call."),content:n(zt),structuredContent:t({}).loose().optional(),isError:a().optional(),_meta:s(e(),l()).optional()}),er=R("type",[Xt,Qt,ea]),Mt=R("type",[Xt,Qt,ea,Fa,Xr]),tr=t({role:Oe,content:c([Mt,n(Mt)]),_meta:s(e(),l()).optional()}),ar=b.extend({messages:n(tr),modelPreferences:Xa.optional(),systemPrompt:e().optional(),includeContext:p(["none","thisServer","allServers"]).optional(),temperature:o().optional(),maxTokens:o().int(),stopSequences:n(e()).optional(),metadata:h.optional(),tools:n(aa).optional(),toolChoice:Qa.optional()}),rr=C.extend({method:r("sampling/createMessage"),params:ar}),or=Z.extend({model:e(),stopReason:u(p(["endTurn","stopSequence","maxTokens"]).or(e())),role:Oe,content:er}),sr=Z.extend({model:e(),stopReason:u(p(["endTurn","stopSequence","maxTokens","toolUse"]).or(e())),role:Oe,content:c([Mt,n(Mt)])}),nr=t({type:r("boolean"),title:e().optional(),description:e().optional(),default:a().optional()}),ir=t({type:r("string"),title:e().optional(),description:e().optional(),minLength:o().optional(),maxLength:o().optional(),format:p(["email","uri","date","date-time"]).optional(),default:e().optional()}),cr=t({type:p(["number","integer"]),title:e().optional(),description:e().optional(),minimum:o().optional(),maximum:o().optional(),default:o().optional()}),lr=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),default:e().optional()}),ur=t({type:r("string"),title:e().optional(),description:e().optional(),oneOf:n(t({const:e(),title:e()})),default:e().optional()}),dr=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),enumNames:n(e()).optional(),default:e().optional()}),mr=c([lr,ur]),ra=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({type:r("string"),enum:n(e())}),default:n(e()).optional()}),oa=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({anyOf:n(t({const:e(),title:e()}))}),default:n(e()).optional()}),Qr=c([ra,oa]),eo=c([dr,mr,Qr]),vt=c([eo,nr,ir,cr]),bt=b.extend({mode:r("form").optional(),message:e(),requestedSchema:t({type:r("object"),properties:s(e(),vt),required:n(e()).optional()}).catchall(l())}),hr=b.extend({mode:r("url"),message:e(),elicitationId:e(),url:e().url()}),Pt=c([bt,hr]),to=C.extend({method:r("elicitation/create"),params:Pt}),ao=O.extend({elicitationId:e()}),ro=D.extend({method:r("notifications/elicitation/complete"),params:ao}),oo=Z.extend({action:p(["accept","decline","cancel"]),content:I((pt)=>pt===null?void 0:pt,s(e(),c([e(),o(),a(),n(e())])).optional())}),so=t({type:r("ref/resource"),uri:e()}),no=t({type:r("ref/prompt"),name:e()}),io=E.extend({ref:c([no,so]),argument:t({name:e(),value:e()}),context:t({arguments:s(e(),e()).optional()}).optional()}),pr=C.extend({method:r("completion/complete"),params:io}),co=Z.extend({completion:d({values:n(e()).max(100),total:u(o().int()),hasMore:u(a())})}),lo=t({uri:e().startsWith("file://"),name:e().optional(),_meta:s(e(),l()).optional()}),ya=C.extend({method:r("roots/list"),params:E.optional()}),fr=Z.extend({roots:n(lo)}),uo=D.extend({method:r("notifications/roots/list_changed"),params:O.optional()}),mo=d({ttl:o().optional(),pollInterval:o().optional()}),ho=p(["working","input_required","completed","failed","cancelled"]),At=t({taskId:e(),status:ho,ttl:c([o(),T()]),createdAt:e(),lastUpdatedAt:e(),pollInterval:u(o()),statusMessage:u(e())}),_t=Z.extend({task:At}),po=O.merge(At),sa=D.extend({method:r("notifications/tasks/status"),params:po}),va=C.extend({method:r("tasks/get"),params:E.extend({taskId:e()})}),ba=Z.merge(At),Ra=C.extend({method:r("tasks/result"),params:E.extend({taskId:e()})}),vn=Z.loose(),yt=he.extend({method:r("tasks/list")}),st=Re.extend({tasks:n(At)}),na=C.extend({method:r("tasks/cancel"),params:E.extend({taskId:e()})});return{JSONValueSchema:m,JSONObjectSchema:h,ProgressTokenSchema:f,CursorSchema:g,TaskMetadataSchema:S,RelatedTaskMetadataSchema:_,RequestMetaSchema:y,BaseRequestParamsSchema:E,TaskAugmentedRequestParamsSchema:b,RequestSchema:C,NotificationsParamsSchema:O,NotificationSchema:D,ResultSchema:Z,RequestIdSchema:ae,EmptyResultSchema:x,CancelledNotificationParamsSchema:K,CancelledNotificationSchema:V,IconSchema:w,IconsSchema:H,BaseMetadataSchema:q,ImplementationSchema:B,ClientTasksCapabilitySchema:j,ServerTasksCapabilitySchema:ce,ClientCapabilitiesSchema:Pe,InitializeRequestParamsSchema:Ie,InitializeRequestSchema:Te,ServerCapabilitiesSchema:je,InitializeResultSchema:Ae,InitializedNotificationSchema:Me,PingRequestSchema:Ge,ProgressSchema:Qe,ProgressNotificationParamsSchema:Ze,ProgressNotificationSchema:nt,PaginatedRequestParamsSchema:Ye,PaginatedRequestSchema:he,PaginatedResultSchema:Re,ResourceContentsSchema:Ne,TextResourceContentsSchema:W,BlobResourceContentsSchema:pe,RoleSchema:Oe,AnnotationsSchema:Le,ResourceSchema:Je,ResourceTemplateSchema:He,ListResourcesRequestSchema:Xe,ListResourcesResultSchema:St,ListResourceTemplatesRequestSchema:de,ListResourceTemplatesResultSchema:ze,ResourceRequestParamsSchema:Ce,ReadResourceRequestParamsSchema:De,ReadResourceRequestSchema:Ue,ReadResourceResultSchema:xe,ResourceListChangedNotificationSchema:ot,SubscribeRequestParamsSchema:ct,SubscribeRequestSchema:mt,UnsubscribeRequestParamsSchema:it,UnsubscribeRequestSchema:et,ResourceUpdatedNotificationParamsSchema:Rt,ResourceUpdatedNotificationSchema:lt,PromptArgumentSchema:Tt,PromptSchema:$t,ListPromptsRequestSchema:Ct,ListPromptsResultSchema:It,GetPromptRequestParamsSchema:Ot,GetPromptRequestSchema:Zt,TextContentSchema:Xt,ImageContentSchema:Qt,AudioContentSchema:ea,ToolUseContentSchema:Fa,EmbeddedResourceSchema:kt,ResourceLinkSchema:xa,ContentBlockSchema:zt,PromptMessageSchema:ma,GetPromptResultSchema:ha,PromptListChangedNotificationSchema:ta,ToolAnnotationsSchema:Ka,ToolExecutionSchema:pa,ToolSchema:aa,ListToolsRequestSchema:fa,ListToolsResultSchema:ga,CallToolResultSchema:Sa,CallToolRequestParamsSchema:ht,CallToolRequestSchema:Ja,ToolListChangedNotificationSchema:Zr,LoggingLevelSchema:_a,SetLevelRequestParamsSchema:Ga,SetLevelRequestSchema:Ba,LoggingMessageNotificationParamsSchema:Ya,LoggingMessageNotificationSchema:Wa,ModelHintSchema:Za,ModelPreferencesSchema:Xa,ToolChoiceSchema:Qa,ToolResultContentSchema:Xr,SamplingContentSchema:er,SamplingMessageContentBlockSchema:Mt,SamplingMessageSchema:tr,CreateMessageRequestParamsSchema:ar,CreateMessageRequestSchema:rr,CreateMessageResultSchema:or,CreateMessageResultWithToolsSchema:sr,BooleanSchemaSchema:nr,StringSchemaSchema:ir,NumberSchemaSchema:cr,UntitledSingleSelectEnumSchemaSchema:lr,TitledSingleSelectEnumSchemaSchema:ur,LegacyTitledEnumSchemaSchema:dr,SingleSelectEnumSchemaSchema:mr,UntitledMultiSelectEnumSchemaSchema:ra,TitledMultiSelectEnumSchemaSchema:oa,MultiSelectEnumSchemaSchema:Qr,EnumSchemaSchema:eo,PrimitiveSchemaDefinitionSchema:vt,ElicitRequestFormParamsSchema:bt,ElicitRequestURLParamsSchema:hr,ElicitRequestParamsSchema:Pt,ElicitRequestSchema:to,ElicitationCompleteNotificationParamsSchema:ao,ElicitationCompleteNotificationSchema:ro,ElicitResultSchema:oo,ResourceTemplateReferenceSchema:so,PromptReferenceSchema:no,CompleteRequestParamsSchema:io,CompleteRequestSchema:pr,CompleteResultSchema:co,RootSchema:lo,ListRootsRequestSchema:ya,ListRootsResultSchema:fr,RootsListChangedNotificationSchema:uo,TaskCreationParamsSchema:mo,TaskStatusSchema:ho,TaskSchema:At,CreateTaskResultSchema:_t,TaskStatusNotificationParamsSchema:po,TaskStatusNotificationSchema:sa,GetTaskRequestSchema:va,GetTaskResultSchema:ba,GetTaskPayloadRequestSchema:Ra,GetTaskPayloadResultSchema:vn,ListTasksRequestSchema:yt,ListTasksResultSchema:st,CancelTaskRequestSchema:na,CancelTaskResultSchema:Z.merge(At),ClientRequestSchema:c([Ge,Te,pr,Ba,Zt,Ct,Xe,de,Ue,mt,et,Ja,fa,va,Ra,yt,na]),ClientNotificationSchema:c([V,nt,Me,uo,sa]),ClientResultSchema:c([x,or,sr,oo,fr,ba,st,_t]),ServerRequestSchema:c([Ge,rr,to,ya,va,Ra,yt,na]),ServerNotificationSchema:c([V,nt,Wa,lt,ot,Zr,ta,sa,ro]),ServerResultSchema:c([x,Ae,co,ha,It,St,ze,xe,Sa,ga,ba,st,_t]),CallToolResultWireSchema:l().superRefine((pt,ll)=>{if(typeof pt!=="object"||pt===null||Array.isArray(pt)||pt.content!==void 0)return;for(let ji of tc)if(ji in pt){ll.addIssue({code:"custom",message:`content is required when the body carries '${ji}' — another result family cannot default into an empty tools/call success`});return}}).transform(ui).pipe(Sa)}}var Ml;function ac(){return Ml??=kl()}function rc(m){return m.type!=="object"}var Al=new Set(["const","enum","default","examples"]),Ll=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function Vi(m){return m!==void 0&&!(typeof m==="string"&&m.startsWith("#"))}function Vl(m){let h=typeof m.$schema==="string"?m.$schema:void 0;if(Vi(m.$id))return{...h!==void 0&&{$schema:h},type:"object",properties:{result:m},required:["result"]};let f=Oi(m.$schema)&&m.$recursiveAnchor!==!0,g=(S,_)=>{if(Array.isArray(S))return S.map((b)=>g(b,!1));if(S===null||typeof S!=="object")return S;if(!_&&Vi(S.$id))return S;let y={},E=!1;for(let[b,C]of Object.entries(S))if(_)y[b]=g(C,!1);else if((b==="$ref"||b==="$dynamicRef")&&typeof C==="string")y[b]=C==="#"?"#/properties/result":C.startsWith("#/")?`#/properties/result${C.slice(1)}`:C;else if(b==="$recursiveRef"&&C==="#"&&f)E=!0;else if(Al.has(b))y[b]=C;else if(Ll.has(b))y[b]=g(C,!0);else y[b]=g(C,!1);if(E)if("$ref"in y)y.allOf=[...Array.isArray(y.allOf)?y.allOf:[],{$ref:"#/properties/result"}];else y.$ref="#/properties/result";return y};return{...h!==void 0&&{$schema:h},type:"object",properties:{result:g(m,!1)},required:["result"]}}var oc={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},sc={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},Dl={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},on;function di(){if(on)return on;let m=ac();return on={requestSchemas:{ping:m.PingRequestSchema,initialize:m.InitializeRequestSchema,"completion/complete":m.CompleteRequestSchema,"logging/setLevel":m.SetLevelRequestSchema,"prompts/get":m.GetPromptRequestSchema,"prompts/list":m.ListPromptsRequestSchema,"resources/list":m.ListResourcesRequestSchema,"resources/templates/list":m.ListResourceTemplatesRequestSchema,"resources/read":m.ReadResourceRequestSchema,"resources/subscribe":m.SubscribeRequestSchema,"resources/unsubscribe":m.UnsubscribeRequestSchema,"tools/call":m.CallToolRequestSchema,"tools/list":m.ListToolsRequestSchema,"tasks/get":m.GetTaskRequestSchema,"tasks/result":m.GetTaskPayloadRequestSchema,"tasks/list":m.ListTasksRequestSchema,"tasks/cancel":m.CancelTaskRequestSchema,"sampling/createMessage":m.CreateMessageRequestSchema,"elicitation/create":m.ElicitRequestSchema,"roots/list":m.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":m.CancelledNotificationSchema,"notifications/progress":m.ProgressNotificationSchema,"notifications/initialized":m.InitializedNotificationSchema,"notifications/roots/list_changed":m.RootsListChangedNotificationSchema,"notifications/tasks/status":m.TaskStatusNotificationSchema,"notifications/message":m.LoggingMessageNotificationSchema,"notifications/resources/updated":m.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":m.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":m.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":m.PromptListChangedNotificationSchema,"notifications/elicitation/complete":m.ElicitationCompleteNotificationSchema},resultSchemas:{ping:m.EmptyResultSchema,initialize:m.InitializeResultSchema,"completion/complete":m.CompleteResultSchema,"logging/setLevel":m.EmptyResultSchema,"prompts/get":m.GetPromptResultSchema,"prompts/list":m.ListPromptsResultSchema,"resources/list":m.ListResourcesResultSchema,"resources/templates/list":m.ListResourceTemplatesResultSchema,"resources/read":m.ReadResourceResultSchema,"resources/subscribe":m.EmptyResultSchema,"resources/unsubscribe":m.EmptyResultSchema,"tools/call":m.CallToolResultWireSchema,"tools/list":m.ListToolsResultSchema,"sampling/createMessage":m.CreateMessageResultWithToolsSchema,"elicitation/create":m.ElicitResultSchema,"roots/list":m.ListRootsResultSchema}},on}function nc(m){return Object.prototype.hasOwnProperty.call(oc,m)}function ic(m){return Object.prototype.hasOwnProperty.call(sc,m)}function Ul(m){return Object.prototype.hasOwnProperty.call(Dl,m)}function Hl(m){return Ul(m)?di().resultSchemas[m]:void 0}function Fl(m){return nc(m)?di().requestSchemas[m]:void 0}function xl(m){return ic(m)?di().notificationSchemas[m]:void 0}var eh=Object.keys(oc),th=Object.keys(sc);function oi(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function sn(m,h){if(m===void 0)return{ok:!1,reason:"not-in-era"};let f=m.safeParse(h);return f.success?{ok:!0,value:f.data}:{ok:!1,reason:"invalid",message:String(f.error)}}var Di={ok:!1,reason:"not-in-era"};function Ui(m){return oi(m)&&oi(m.outputSchema)&&rc(m.outputSchema)}function Hi(m){return m}var mi={era:"2025-11-25",hasRequestMethod:nc,hasNotificationMethod:ic,validateRequest:(m,h)=>sn(Fl(m),h),validateResult:(m,h)=>sn(Hl(m),h),validateNotification:(m,h)=>sn(xl(m),h),hasInputRequestMethod:()=>!1,validateInputRequest:()=>Di,validateInputResponse:()=>Di,samplingResultVariant:(m,h)=>{let f=ac();return sn(m?f.CreateMessageResultWithToolsSchema:f.CreateMessageResultSchema,h)},outboundEnvelope:(m)=>{return},validateEnvelopeMeta:(m)=>[],projectCallToolResult(m,h){let f=ec(m),g=f.structuredContent;if(g===void 0)return f;let S=typeof g!=="object"||g===null||Array.isArray(g),_=h!==void 0&&rc(h);if(!S&&!_)return f;return{...f,structuredContent:{result:g}}},decodeResult(m,h){if(oi(h)&&"resultType"in h){let f={...h};return delete f.resultType,{kind:"complete",result:Hi(f)}}return{kind:"complete",result:Hi(h)}},encodeResult(m,h){if(m!=="tools/list")return h;let f=h.tools;if(!Array.isArray(f)||!f.some((g)=>Ui(g)))return h;return{...h,tools:f.map((g)=>Ui(g)?{...g,outputSchema:Vl(g.outputSchema)}:g)}},encodeErrorCode:(m)=>m===-32002?-32602:m,checkInboundEnvelope:(m)=>{return}};function Kl(){let m=F(()=>c([e(),o(),a(),T(),s(e(),m),n(m)])),h=s(e(),m),f=c([e(),o().int()]),g=e(),S=c([e(),o().int()]),_=p(["user","assistant"]),y=p(["debug","info","notice","warning","error","critical","alert","emergency"]),E=e().refine((st)=>{try{return atob(st),!0}catch{return!1}},{message:"Invalid Base64 string"}),b=t({ttl:o().optional()}),C=t({taskId:e()}),O=d({progressToken:f.optional(),"io.modelcontextprotocol/related-task":C.optional()}),D=t({_meta:O.optional()}),Z=D.extend({task:b.optional()}),ae=t({_meta:O.optional()}),x=t({method:e(),params:ae.loose().optional()}),K=t({src:e(),mimeType:e().optional(),sizes:n(e()).optional(),theme:p(["light","dark"]).optional()}),V=t({icons:n(K).optional()}),w=t({name:e(),title:e().optional()}),H=w.extend({...w.shape,...V.shape,version:e(),websiteUrl:e().optional(),description:e().optional()}),q=k(t({applyDefaults:a().optional()}),h),B=I((st)=>{if(st&&typeof st==="object"&&!Array.isArray(st)&&Object.keys(st).length===0)return{form:{}};return st},k(t({form:q.optional(),url:h.optional()}),h.optional())),ne=d({list:h.optional(),cancel:h.optional(),requests:d({sampling:d({createMessage:h.optional()}).optional(),elicitation:d({create:h.optional()}).optional()}).optional()}),U=d({list:h.optional(),cancel:h.optional(),requests:d({tools:d({call:h.optional()}).optional()}).optional()}),j=t({experimental:s(e(),h).optional(),sampling:t({context:h.optional(),tools:h.optional()}).optional(),elicitation:B.optional(),roots:t({listChanged:a().optional()}).optional(),tasks:ne.optional(),extensions:s(e(),h).optional()}),ce=t({experimental:s(e(),h).optional(),logging:h.optional(),completions:h.optional(),prompts:t({listChanged:a().optional()}).optional(),resources:t({subscribe:a().optional(),listChanged:a().optional()}).optional(),tools:t({listChanged:a().optional()}).optional(),tasks:U.optional(),extensions:s(e(),h).optional()}),Pe=t({progress:o(),total:u(o()),message:u(e())}),Ie=t({...ae.shape,...Pe.shape,progressToken:f}),Te=x.extend({method:r("notifications/progress"),params:Ie}),je=ae.extend({level:y,logger:e().optional(),data:l()}),Ae=x.extend({method:r("notifications/message"),params:je}),Me=t({uri:e(),mimeType:u(e()),_meta:s(e(),l()).optional()}),Ge=Me.extend({text:e()}),Qe=Me.extend({blob:E}),Ze=t({audience:n(_).optional(),priority:o().min(0).max(1).optional(),lastModified:N({offset:!0}).optional()}),nt=t({...w.shape,...V.shape,uri:e(),description:u(e()),mimeType:u(e()),size:u(o()),annotations:Ze.optional(),_meta:u(d({}))}),Ye=t({...w.shape,...V.shape,uriTemplate:e(),description:u(e()),mimeType:u(e()),annotations:Ze.optional(),_meta:u(d({}))}),he=x.extend({method:r("notifications/resources/list_changed"),params:ae.optional()}),Re=ae.extend({uri:e()}),Ne=x.extend({method:r("notifications/resources/updated"),params:Re}),W=t({name:e(),description:u(e()),required:u(a())}),me=t({...w.shape,...V.shape,description:u(e()),arguments:u(n(W)),_meta:u(d({}))}),pe=x.extend({method:r("notifications/prompts/list_changed"),params:ae.optional()}),Oe=t({type:r("text"),text:e(),annotations:Ze.optional(),_meta:s(e(),l()).optional()}),Le=t({type:r("image"),data:E,mimeType:e(),annotations:Ze.optional(),_meta:s(e(),l()).optional()}),Je=t({type:r("audio"),data:E,mimeType:e(),annotations:Ze.optional(),_meta:s(e(),l()).optional()}),He=t({type:r("tool_use"),name:e(),id:e(),input:s(e(),l()),_meta:s(e(),l()).optional()}),Xe=t({type:r("resource"),resource:c([Ge,Qe]),annotations:Ze.optional(),_meta:s(e(),l()).optional()}),St=nt.extend({type:r("resource_link")}),de=c([Oe,Le,Je,St,Xe]),ze=t({role:_,content:de}),Ce=t({title:e().optional(),readOnlyHint:a().optional(),destructiveHint:a().optional(),idempotentHint:a().optional(),openWorldHint:a().optional()}),De=x.extend({method:r("notifications/tools/list_changed"),params:ae.optional()}),Ue=t({name:e().optional()}),xe=t({hints:n(Ue).optional(),costPriority:o().min(0).max(1).optional(),speedPriority:o().min(0).max(1).optional(),intelligencePriority:o().min(0).max(1).optional()}),ot=t({mode:p(["auto","required","none"]).optional()}),ct=t({type:r("boolean"),title:e().optional(),description:e().optional(),default:a().optional()}),mt=t({type:r("string"),title:e().optional(),description:e().optional(),minLength:o().optional(),maxLength:o().optional(),format:p(["email","uri","date","date-time"]).optional(),default:e().optional()}),it=t({type:p(["number","integer"]),title:e().optional(),description:e().optional(),minimum:o().optional(),maximum:o().optional(),default:o().optional()}),et=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),default:e().optional()}),Rt=t({type:r("string"),title:e().optional(),description:e().optional(),oneOf:n(t({const:e(),title:e()})),default:e().optional()}),lt=t({type:r("string"),title:e().optional(),description:e().optional(),enum:n(e()),enumNames:n(e()).optional(),default:e().optional()}),Tt=c([et,Rt]),$t=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({type:r("string"),enum:n(e())}),default:n(e()).optional()}),Ct=t({type:r("array"),title:e().optional(),description:e().optional(),minItems:o().optional(),maxItems:o().optional(),items:t({anyOf:n(t({const:e(),title:e()}))}),default:n(e()).optional()}),It=c([$t,Ct]),Ot=c([lt,Tt,It]),Zt=c([Ot,ct,mt,it]),Xt=Z.extend({mode:r("form").optional(),message:e(),requestedSchema:t({type:r("object"),properties:s(e(),Zt),required:n(e()).optional()}).catchall(l())}),Qt=t({type:r("ref/resource"),uri:e()}),ea=t({type:r("ref/prompt"),name:e()}),Fa=t({uri:e().startsWith("file://"),name:e().optional(),_meta:s(e(),l()).optional()}),kt=j.shape,xa=t({experimental:kt.experimental,sampling:kt.sampling,elicitation:kt.elicitation,roots:kt.roots,extensions:kt.extensions}),zt=ce.shape,ma=t({experimental:zt.experimental,logging:zt.logging,completions:zt.completions,prompts:zt.prompts,resources:zt.resources,tools:zt.tools,extensions:zt.extensions}),ha=d({progressToken:f.optional(),[Vt]:e(),[gr]:H.optional(),[Dt]:xa,[ca]:y.optional()}),ta=t({...w.shape,...V.shape,description:e().optional(),inputSchema:d({$schema:e().optional(),type:r("object")}),outputSchema:d({$schema:e().optional()}).optional(),annotations:Ce.optional(),_meta:s(e(),l()).optional()}),Ka=t({type:r("tool_result"),toolUseId:e(),content:n(de),structuredContent:l().optional(),isError:a().optional(),_meta:s(e(),l()).optional()}),pa=c([Oe,Le,Je,He,Ka]),aa=t({role:_,content:c([pa,n(pa)]),_meta:s(e(),l()).optional()}),fa=e(),ga=d({[jt]:H.optional().catch(void 0)}),Sa=ga.optional();function ht(st){return d({_meta:Sa,resultType:fa.default("complete"),...st})}let Ja=ht({}),Zr=ht({nextCursor:g.optional()}),_a=ht({content:n(de),structuredContent:l().optional(),isError:a().optional()}),Ga=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),tools:n(ta),nextCursor:g.optional()}),Ba=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),prompts:n(me),nextCursor:g.optional()}),Ya=ht({description:e().optional(),messages:n(ze)}),Wa=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),resources:n(nt),nextCursor:g.optional()}),Za=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),resourceTemplates:n(Ye),nextCursor:g.optional()}),Xa=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),contents:n(c([Ge,Qe]))}),Qa=ht({completion:t({values:n(e()).max(100),total:o().int().optional(),hasMore:a().optional()}).loose()}),Xr=ht({ttlMs:o().int().min(0),cacheScope:p(["public","private"])}),er=ht({ttlMs:o().int().min(0).catch(0),cacheScope:p(["public","private"]).catch("private"),supportedVersions:n(e()),capabilities:ma,instructions:e().optional()}),Mt=t({messages:n(aa),modelPreferences:xe.optional(),systemPrompt:e().optional(),includeContext:p(["none","thisServer","allServers"]).optional(),temperature:o().optional(),maxTokens:o().int(),stopSequences:n(e()).optional(),metadata:h.optional(),tools:n(ta).optional(),toolChoice:ot.optional()}),tr=t({method:r("sampling/createMessage"),params:Mt}),ar=t({method:r("roots/list"),params:t({_meta:s(e(),l()).optional()}).optional()}),rr=t({...aa.shape,model:e(),stopReason:e().optional()}),or=t({roots:n(Fa)}),sr=t({action:p(["accept","decline","cancel"]),content:s(e(),c([e(),o(),a(),n(e())])).optional()}),nr=t({mode:r("url"),message:e(),url:e().url()}),ir=c([Xt,nr]),cr=t({method:r("elicitation/create"),params:ir}),lr=c([tr,ar,cr]),ur=c([rr,or,sr]),dr=s(e(),lr),mr=s(e(),ur),ra=ht({inputRequests:dr.optional(),requestState:e().optional()}),oa={inputResponses:mr.optional(),requestState:e().optional()},Qr=t({_meta:ha,...oa}),eo=d({progressToken:f.optional()});function vt(st,na){return t({method:r(st),params:t({_meta:ha,...na})})}function bt(st,na){return t({method:r(st),params:t({_meta:eo.optional(),...na}).optional()})}let hr={name:e(),arguments:s(e(),l()).optional(),...oa},Pt={cursor:g.optional()},to=vt("tools/call",hr),ao=vt("tools/list",Pt),ro=vt("prompts/list",Pt),oo=vt("prompts/get",{name:e(),arguments:s(e(),e()).optional(),...oa}),so=vt("resources/list",Pt),no=vt("resources/templates/list",Pt),io=vt("resources/read",{uri:e(),...oa}),pr={ref:c([ea,Qt]),argument:t({name:e(),value:e()}),context:t({arguments:s(e(),e()).optional()}).optional()},co=vt("completion/complete",pr),lo=vt("server/discover",{}),ya=t({toolsListChanged:a().optional(),promptsListChanged:a().optional(),resourcesListChanged:a().optional(),resourceSubscriptions:n(e()).optional()}),fr={notifications:ya},uo=vt("subscriptions/listen",fr),mo=ga.extend({"io.modelcontextprotocol/subscriptionId":S}),ho=d({_meta:mo,resultType:fa.default("complete")}),At={"tools/call":bt("tools/call",hr),"tools/list":bt("tools/list",Pt),"prompts/get":bt("prompts/get",{name:e(),arguments:s(e(),e()).optional()}),"prompts/list":bt("prompts/list",Pt),"resources/list":bt("resources/list",Pt),"resources/templates/list":bt("resources/templates/list",Pt),"resources/read":bt("resources/read",{uri:e()}),"completion/complete":bt("completion/complete",pr),"server/discover":bt("server/discover",{}),"subscriptions/listen":bt("subscriptions/listen",fr)};function _t(st){return d({_meta:Sa,...st})}let po={"tools/call":_t({content:n(de),structuredContent:l().optional(),isError:a().optional()}),"tools/list":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),tools:n(ta),nextCursor:g.optional()}),"prompts/get":_t({description:e().optional(),messages:n(ze)}),"prompts/list":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),prompts:n(me),nextCursor:g.optional()}),"resources/list":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),resources:n(nt),nextCursor:g.optional()}),"resources/templates/list":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),resourceTemplates:n(Ye),nextCursor:g.optional()}),"resources/read":_t({ttlMs:o().int().min(0),cacheScope:p(["public","private"]),contents:n(c([Ge,Qe]))}),"completion/complete":_t({completion:t({values:n(e()).max(100),total:o().int().optional(),hasMore:a().optional()}).loose()}),"server/discover":_t({ttlMs:o().int().min(0).catch(0),cacheScope:p(["public","private"]).catch("private"),supportedVersions:n(e()),capabilities:ma,instructions:e().optional()}),"subscriptions/listen":_t({})},sa=d({"io.modelcontextprotocol/subscriptionId":S.optional()}),va=t({method:r("notifications/subscriptions/acknowledged"),params:t({_meta:sa.optional(),notifications:ya})}),ba=t({_meta:sa.optional(),requestId:S,reason:e().optional()}),Ra=t({method:r("notifications/cancelled"),params:ba}),vn={"notifications/cancelled":Ra,"notifications/progress":Te,"notifications/message":Ae,"notifications/resources/updated":Ne,"notifications/resources/list_changed":he,"notifications/tools/list_changed":De,"notifications/prompts/list_changed":pe,"notifications/subscriptions/acknowledged":va},yt=(st)=>t({jsonrpc:r("2.0"),id:c([e(),o().int()]),result:st}).strict();return{JSONValueSchema:m,JSONObjectSchema:h,ProgressTokenSchema:f,CursorSchema:g,RequestIdSchema:S,RoleSchema:_,LoggingLevelSchema:y,TaskMetadataSchema:b,RelatedTaskMetadataSchema:C,RequestMetaSchema:O,BaseRequestParamsSchema:D,TaskAugmentedRequestParamsSchema:Z,NotificationsParamsSchema:ae,NotificationSchema:x,IconSchema:K,IconsSchema:V,BaseMetadataSchema:w,ImplementationSchema:H,ClientTasksCapabilitySchema:ne,ServerTasksCapabilitySchema:U,ClientCapabilitiesSchema:j,ServerCapabilitiesSchema:ce,ProgressSchema:Pe,ProgressNotificationParamsSchema:Ie,ProgressNotificationSchema:Te,LoggingMessageNotificationParamsSchema:je,LoggingMessageNotificationSchema:Ae,ResourceContentsSchema:Me,TextResourceContentsSchema:Ge,BlobResourceContentsSchema:Qe,AnnotationsSchema:Ze,ResourceSchema:nt,ResourceTemplateSchema:Ye,ResourceListChangedNotificationSchema:he,ResourceUpdatedNotificationParamsSchema:Re,ResourceUpdatedNotificationSchema:Ne,PromptArgumentSchema:W,PromptSchema:me,PromptListChangedNotificationSchema:pe,TextContentSchema:Oe,ImageContentSchema:Le,AudioContentSchema:Je,ToolUseContentSchema:He,EmbeddedResourceSchema:Xe,ResourceLinkSchema:St,ContentBlockSchema:de,PromptMessageSchema:ze,ToolAnnotationsSchema:Ce,ToolListChangedNotificationSchema:De,ModelHintSchema:Ue,ModelPreferencesSchema:xe,ToolChoiceSchema:ot,BooleanSchemaSchema:ct,StringSchemaSchema:mt,NumberSchemaSchema:it,UntitledSingleSelectEnumSchemaSchema:et,TitledSingleSelectEnumSchemaSchema:Rt,LegacyTitledEnumSchemaSchema:lt,SingleSelectEnumSchemaSchema:Tt,UntitledMultiSelectEnumSchemaSchema:$t,TitledMultiSelectEnumSchemaSchema:Ct,MultiSelectEnumSchemaSchema:It,EnumSchemaSchema:Ot,PrimitiveSchemaDefinitionSchema:Zt,ElicitRequestFormParamsSchema:Xt,ResourceTemplateReferenceSchema:Qt,PromptReferenceSchema:ea,RootSchema:Fa,ClientCapabilities2026Schema:xa,ServerCapabilities2026Schema:ma,RequestMetaEnvelopeSchema:ha,ToolSchema:ta,ToolResultContentSchema:Ka,SamplingMessageContentBlockSchema:pa,SamplingMessageSchema:aa,ResultTypeSchema:fa,ResultMetaSchema:ga,ResultSchema:Ja,PaginatedResultSchema:Zr,CallToolResultSchema:_a,ListToolsResultSchema:Ga,ListPromptsResultSchema:Ba,GetPromptResultSchema:Ya,ListResourcesResultSchema:Wa,ListResourceTemplatesResultSchema:Za,ReadResourceResultSchema:Xa,CompleteResultSchema:Qa,CacheableResultSchema:Xr,DiscoverResultSchema:er,CreateMessageRequestParamsSchema:Mt,CreateMessageRequestSchema:tr,ListRootsRequestSchema:ar,CreateMessageResultSchema:rr,ListRootsResultSchema:or,ElicitResultSchema:sr,ElicitRequestURLParamsSchema:nr,ElicitRequestParamsSchema:ir,ElicitRequestSchema:cr,InputRequestSchema:lr,InputResponseSchema:ur,InputRequestsSchema:dr,InputResponsesSchema:mr,InputRequiredResultSchema:ra,InputResponseRequestParamsSchema:Qr,CallToolRequestSchema:to,ListToolsRequestSchema:ao,ListPromptsRequestSchema:ro,GetPromptRequestSchema:oo,ListResourcesRequestSchema:so,ListResourceTemplatesRequestSchema:no,ReadResourceRequestSchema:io,CompleteRequestSchema:co,DiscoverRequestSchema:lo,SubscriptionFilterSchema:ya,SubscriptionsListenRequestSchema:uo,SubscriptionsListenResultMetaSchema:mo,SubscriptionsListenResultSchema:ho,dispatchRequestSchemas:At,dispatchResultSchemas:po,NotificationMetaSchema:sa,SubscriptionsAcknowledgedNotificationSchema:va,CancelledNotificationParamsSchema:ba,CancelledNotificationSchema:Ra,notificationSchemas2026:vn,JSONRPCResultResponseSchema:yt(Ja),CallToolResultResponseSchema:yt(c([_a,ra])),ListToolsResultResponseSchema:yt(Ga),ListPromptsResultResponseSchema:yt(Ba),GetPromptResultResponseSchema:yt(c([Ya,ra])),ListResourcesResultResponseSchema:yt(Wa),ListResourceTemplatesResultResponseSchema:yt(Za),ReadResourceResultResponseSchema:yt(c([Xa,ra])),CompleteResultResponseSchema:yt(Qa),DiscoverResultResponseSchema:yt(er)}}var Jl;function da(){return Jl??=Kl()}var Gl=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function Bl(m){return Gl.includes(m)}var Aa=Symbol("modelcontextprotocol.resultCacheHintFallback");function mn(m,h){if(h===void 0)return m;let f=m[Aa];if(f===void 0)return{...m,[Aa]:h};let g={},S=f.ttlMs??h.ttlMs;if(S!==void 0)g.ttlMs=S;let _=f.cacheScope??h.cacheScope;if(_!==void 0)g.cacheScope=_;return{...m,[Aa]:g}}function Yl(m){return m[Aa]}function hi(m){return typeof m==="number"&&Number.isSafeInteger(m)&&m>=0}function pi(m){return m==="public"||m==="private"}function fi(m,h){if(m.ttlMs!==void 0&&!hi(m.ttlMs))throw RangeError(`Invalid cache hint for ${h}: ttlMs must be a non-negative safe integer (got ${String(m.ttlMs)})`);if(m.cacheScope!==void 0&&!pi(m.cacheScope))throw RangeError(`Invalid cache hint for ${h}: cacheScope must be 'public' or 'private' (got ${String(m.cacheScope)})`)}var i=function(m){return m[m.ParseError=-32700]="ParseError",m[m.InvalidRequest=-32600]="InvalidRequest",m[m.MethodNotFound=-32601]="MethodNotFound",m[m.InvalidParams=-32602]="InvalidParams",m[m.InternalError=-32603]="InternalError",m[m.ResourceNotFound=-32002]="ResourceNotFound",m[m.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",m[m.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",m[m.UrlElicitationRequired=-32042]="UrlElicitationRequired",m}({}),Ve=class m extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](h){return La(this,h)}static isInstance(h){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return La(this,h)}constructor(h,f,g){super(f);this.code=h,this.data=g,this.name="ProtocolError",ii(this,new.target)}static fromError(h,f,g){if(h===i.UrlElicitationRequired&&g){let S=g;if(S.elicitations)return new Wl(S.elicitations,f)}if(h===i.UnsupportedProtocolVersion&&g){let S=g;if(Array.isArray(S.supported)&&typeof S.requested==="string")return new L({supported:S.supported,requested:S.requested},f)}if(h===i.InvalidParams||h===i.ResourceNotFound){let S=g;if(typeof S?.uri==="string"&&(h===i.ResourceNotFound||Object.keys(S).length===1))return new gi(S.uri,f)}if(h===i.MissingRequiredClientCapability&&g){let S=g;if(S.requiredCapabilities!==null&&typeof S.requiredCapabilities==="object"&&!Array.isArray(S.requiredCapabilities))return new Si({requiredCapabilities:S.requiredCapabilities},f)}return new m(h,f,g)}},gi=class extends Ve{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(m,h=`Resource not found: ${m}`){super(i.InvalidParams,h,{uri:m})}get uri(){return this.data.uri}},Wl=class extends Ve{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(m,h=`URL elicitation${m.length>1?"s":""} required`){super(i.UrlElicitationRequired,h,{elicitations:m})}get elicitations(){return this.data?.elicitations??[]}},L=class extends Ve{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(m,h=`Unsupported protocol version: ${m.requested}`){super(i.UnsupportedProtocolVersion,h,m)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Si=class extends Ve{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(m,h=`Missing required client capabilities: ${Object.keys(m.requiredCapabilities).join(", ")}`){super(i.MissingRequiredClientCapability,h,m)}get requiredCapabilities(){return this.data.requiredCapabilities}},Zl=0,Xl="private",Ql=["tools/call","prompts/get","resources/read"];function eu(m,h){let f=h.resultType;if(f===void 0)return{...h,resultType:"complete"};if(f==="complete")return h;if(Ql.includes(m))return h;throw new Ve(i.InternalError,`Handler for ${m} returned resultType '${String(f)}', but results of ${m} only support 'complete' on protocol revision 2026-07-28`)}function tu(m,h){let f=Yl(h);if(h.resultType!=="complete"||!Bl(m))return f===void 0?h:nu(h);let g=h,S=hi(g.ttlMs)?g.ttlMs:ou(f),_=pi(g.cacheScope)?g.cacheScope:su(f),y={...g,ttlMs:S,cacheScope:_};return delete y[Aa],y}function au(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function ru(m,h){if(h===void 0)return m;let f=m._meta;if(f===void 0)return{...m,_meta:{[jt]:h}};if(!au(f))return m;if(f[jt]!==void 0)return m;return{...m,_meta:{...f,[jt]:h}}}function ou(m){return m!==void 0&&hi(m.ttlMs)?m.ttlMs:Zl}function su(m){return m!==void 0&&pi(m.cacheScope)?m.cacheScope:Xl}function nu(m){let h={...m};return delete h[Aa],h}var iu=["elicitation/create","sampling/createMessage","roots/list"],nn;function cc(){if(nn)return nn;let m=da();return nn={request:{"elicitation/create":t({method:r("elicitation/create"),params:m.ElicitRequestParamsSchema}),"sampling/createMessage":t({method:r("sampling/createMessage"),params:m.CreateMessageRequestParamsSchema}),"roots/list":t({method:r("roots/list"),params:d({}).optional()})},response:{"elicitation/create":m.ElicitResultSchema,"sampling/createMessage":m.CreateMessageResultSchema,"roots/list":m.ListRootsResultSchema}},nn}function lc(m){return iu.includes(m)}function ei(m){return lc(m)?cc().request[m]:void 0}function cu(m){return lc(m)?cc().response[m]:void 0}var _i={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},uc={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function dc(m){return Object.prototype.hasOwnProperty.call(_i,m)}function mc(m){return Object.prototype.hasOwnProperty.call(uc,m)}function lu(m){return Object.prototype.hasOwnProperty.call(_i,m)}function uu(m){return dc(m)?da().dispatchRequestSchemas[m]:void 0}function du(m){return lu(m)?da().dispatchResultSchemas[m]:void 0}function mu(m){return mc(m)?da().notificationSchemas2026[m]:void 0}var ah=Object.keys(_i),rh=Object.keys(uc);function xr(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function Hr(m,h){if(m===void 0)return{ok:!1,reason:"not-in-era"};let f=m.safeParse(h);return f.success?{ok:!0,value:f.data}:{ok:!1,reason:"invalid",message:String(f.error)}}var hu={ok:!1,reason:"not-in-era"},pu=[Vt,Dt];function fu(m,h){let f=h,g=!1,S=()=>{if(!g)f={...f},g=!0;return f},_=h.tools;if(m==="tools/list"&&Array.isArray(_)&&_.some((E)=>xr(E)&&("execution"in E)))S().tools=_.map((E)=>{if(!xr(E)||!("execution"in E))return E;let b={...E};return delete b.execution,b});let y=h.capabilities;if(xr(y)&&"tasks"in y){let E={...y};delete E.tasks,S().capabilities=E}return f}var yi={era:"2026-07-28",hasRequestMethod:dc,hasNotificationMethod:mc,hasInputRequestMethod:(m)=>ei(m)!==void 0,validateRequest:(m,h)=>Hr(uu(m),h),validateResult:(m,h)=>Hr(du(m),h),validateNotification:(m,h)=>Hr(mu(m),h),validateInputRequest:(m,h)=>Hr(ei(m),h),validateInputResponse:(m,h)=>Hr(cu(m),h),samplingResultVariant:()=>hu,outboundEnvelope(m){return{[Vt]:m.protocolVersion,[gr]:m.clientInfo,[Dt]:m.clientCapabilities,...m.logLevel!==void 0&&{[ca]:m.logLevel}}},validateEnvelopeMeta(m){let h=[];for(let g of pu)if(!(g in m))h.push({key:g,problem:"missing"});let f=da().RequestMetaEnvelopeSchema.safeParse(m);if(!f.success)for(let g of f.error.issues){let S=g.path.map(String),_=S.length>0?S.join("."):"_meta";if(S.length===1&&h.some((y)=>y.key===_&&y.problem==="missing"))continue;h.push({key:_,problem:g.message})}return h},projectCallToolResult:(m)=>ec(m),inputRequestSchema:ei,decodeResult(m,h){if(!xr(h))return{kind:"invalid",error:new Ke(Be.InvalidResult,`Invalid result for ${m}: not an object`,{method:m})};let f=h.resultType;if(f===void 0)return{kind:"invalid",error:new Ke(Be.InvalidResult,`Invalid result for ${m}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:m,violation:"missing-resultType"})};if(typeof f!=="string")return{kind:"invalid",error:new Ke(Be.InvalidResult,`Invalid result for ${m}: non-string resultType`,{method:m,resultType:f})};if(f==="input_required"){let y=h.inputRequests,E=xr(y)?y:{},b=h.requestState;if(Object.keys(E).length===0&&typeof b!=="string")return{kind:"invalid",error:new Ke(Be.InvalidResult,`Invalid result for ${m}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:m,violation:"input-required-missing-both"})};return{kind:"input_required",inputRequests:E,...typeof b==="string"&&{requestState:b}}}if(f!=="complete")return{kind:"invalid",error:new Ke(Be.UnsupportedResultType,`Unsupported result type '${f}' for ${m}`,{resultType:f,method:m})};let g=gu(),S=Object.hasOwn(g,m)?g[m]:void 0;if(S!==void 0){let y=S.safeParse(h);if(!y.success)return{kind:"invalid",error:new Ke(Be.InvalidResult,`Invalid result for ${m}: ${y.error}`,{method:m})}}let _={...h};return delete _.resultType,{kind:"complete",result:_}},encodeResult(m,h,f){return ru(tu(m,eu(m,fu(m,h))),f)},encodeErrorCode:(m)=>m===-32002?-32602:m,checkInboundEnvelope(m){if(m.envelope===void 0)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let h=da().RequestMetaEnvelopeSchema.safeParse(m.envelope);if(!h.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${h.error.issues.map((f)=>f.message).join("; ")}`}},cn;function gu(){if(cn)return cn;let m=da();return cn={"tools/call":m.CallToolResultSchema,"tools/list":m.ListToolsResultSchema,"prompts/get":m.GetPromptResultSchema,"prompts/list":m.ListPromptsResultSchema,"resources/list":m.ListResourcesResultSchema,"resources/templates/list":m.ListResourceTemplatesResultSchema,"resources/read":m.ReadResourceResultSchema,"completion/complete":m.CompleteResultSchema,"server/discover":m.DiscoverResultSchema},cn}var Gr="2026-07-28";function Bt(m){return m!==void 0&&Da(m)?yi:mi}function Fi(m){if(m.revision!==void 0)return Bt(m.revision).era;return m.era==="modern"?yi.era:mi.era}function ti(m){return hc.some((h)=>h.hasRequestMethod(m))}function ai(m){return hc.some((h)=>h.hasNotificationMethod(m))}var hc=[mi,yi];function xi(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function A(m){if(!xi(m))return;let h=m._meta;return xi(h)?h:void 0}function G(m){let h=A(m);return h!==void 0&&Vt in h}function J(m){let h=A(m)?.[Vt];return typeof h==="string"?h:void 0}function Y(m){return Bt(Gr).validateEnvelopeMeta(m)}var Su=Ni({AnnotationsSchema:()=>Nt,AudioContentSchema:()=>Na,BaseMetadataSchema:()=>qt,BaseRequestParamsSchema:()=>dt,BlobResourceContentsSchema:()=>qr,BooleanSchemaSchema:()=>kr,CallToolRequestParamsSchema:()=>Ss,CallToolRequestSchema:()=>_s,CallToolResultSchema:()=>Or,CancelTaskRequestSchema:()=>Ln,CancelTaskResultSchema:()=>Vn,CancelledNotificationParamsSchema:()=>vo,CancelledNotificationSchema:()=>$r,ClientCapabilitiesSchema:()=>$o,ClientNotificationSchema:()=>Un,ClientRequestSchema:()=>Dn,ClientResultSchema:()=>Hn,ClientTasksCapabilitySchema:()=>Ro,CompatibilityCallToolResultSchema:()=>wn,CompleteRequestParamsSchema:()=>Ks,CompleteRequestSchema:()=>Js,CompleteResultSchema:()=>Gs,ContentBlockSchema:()=>Ia,CreateMessageRequestParamsSchema:()=>qs,CreateMessageRequestSchema:()=>js,CreateMessageResultSchema:()=>Ns,CreateMessageResultWithToolsSchema:()=>Is,CreateTaskResultSchema:()=>qn,CursorSchema:()=>_r,DiscoverRequestSchema:()=>Co,DiscoverResultSchema:()=>qo,ElicitRequestFormParamsSchema:()=>Ma,ElicitRequestParamsSchema:()=>Ls,ElicitRequestSchema:()=>Vs,ElicitRequestURLParamsSchema:()=>As,ElicitResultSchema:()=>Hs,ElicitationCompleteNotificationParamsSchema:()=>Ds,ElicitationCompleteNotificationSchema:()=>Us,EmbeddedResourceSchema:()=>cs,EmptyResultSchema:()=>zr,EnumSchemaSchema:()=>Ms,GetPromptRequestParamsSchema:()=>ss,GetPromptRequestSchema:()=>ns,GetPromptResultSchema:()=>ds,GetTaskPayloadRequestSchema:()=>On,GetTaskPayloadResultSchema:()=>kn,GetTaskRequestSchema:()=>Nn,GetTaskResultSchema:()=>In,IconSchema:()=>bo,IconsSchema:()=>Ht,ImageContentSchema:()=>ja,ImplementationSchema:()=>Ta,InitializeRequestParamsSchema:()=>Po,InitializeRequestSchema:()=>Eo,InitializeResultSchema:()=>wo,InitializedNotificationSchema:()=>To,JSONArraySchema:()=>$n,JSONObjectSchema:()=>tt,JSONRPCErrorResponseSchema:()=>wa,JSONRPCMessageSchema:()=>yo,JSONRPCNotificationSchema:()=>Rr,JSONRPCRequestSchema:()=>br,JSONRPCResponseSchema:()=>Pn,JSONRPCResultResponseSchema:()=>Ea,JSONValueSchema:()=>Lt,LegacyTitledEnumSchemaSchema:()=>Lr,ListChangedOptionsBaseSchema:()=>Tn,ListPromptsRequestSchema:()=>rs,ListPromptsResultSchema:()=>os,ListResourceTemplatesRequestSchema:()=>Ao,ListResourceTemplatesResultSchema:()=>Lo,ListResourcesRequestSchema:()=>ko,ListResourcesResultSchema:()=>Mo,ListRootsRequestSchema:()=>Ys,ListRootsResultSchema:()=>Ws,ListTasksRequestSchema:()=>Mn,ListTasksResultSchema:()=>An,ListToolsRequestSchema:()=>fs,ListToolsResultSchema:()=>gs,LoggingLevelSchema:()=>Jt,LoggingMessageNotificationParamsSchema:()=>Rs,LoggingMessageNotificationSchema:()=>zs,ModelHintSchema:()=>$s,ModelPreferencesSchema:()=>Ps,MultiSelectEnumSchemaSchema:()=>ks,NotificationSchema:()=>gt,NotificationsParamsSchema:()=>ft,NumberSchemaSchema:()=>ka,PaginatedRequestParamsSchema:()=>Io,PaginatedRequestSchema:()=>Ft,PaginatedResultSchema:()=>xt,PingRequestSchema:()=>Er,PrimitiveSchemaDefinitionSchema:()=>Ur,ProgressNotificationParamsSchema:()=>No,ProgressNotificationSchema:()=>wr,ProgressSchema:()=>jo,ProgressTokenSchema:()=>Sr,PromptArgumentSchema:()=>ts,PromptListChangedNotificationSchema:()=>ms,PromptMessageSchema:()=>us,PromptReferenceSchema:()=>xs,PromptSchema:()=>as,ReadResourceRequestParamsSchema:()=>Vo,ReadResourceRequestSchema:()=>Do,ReadResourceResultSchema:()=>Uo,RelatedTaskMetadataSchema:()=>_o,RequestIdSchema:()=>Ut,RequestMetaSchema:()=>yr,RequestSchema:()=>at,ResourceContentsSchema:()=>Tr,ResourceLinkSchema:()=>ls,ResourceListChangedNotificationSchema:()=>Ho,ResourceRequestParamsSchema:()=>Ca,ResourceSchema:()=>jr,ResourceTemplateReferenceSchema:()=>Fs,ResourceTemplateSchema:()=>Oo,ResourceUpdatedNotificationParamsSchema:()=>Qo,ResourceUpdatedNotificationSchema:()=>es,ResultMetaObjectSchema:()=>vr,ResultSchema:()=>rt,RoleSchema:()=>Kt,RootSchema:()=>Bs,RootsListChangedNotificationSchema:()=>Zs,SamplingContentSchema:()=>Ts,SamplingMessageContentBlockSchema:()=>ia,SamplingMessageSchema:()=>Cs,ServerCapabilitiesSchema:()=>Pr,ServerNotificationSchema:()=>xn,ServerRequestSchema:()=>Fn,ServerResultSchema:()=>Kn,ServerTasksCapabilitySchema:()=>zo,SetLevelRequestParamsSchema:()=>vs,SetLevelRequestSchema:()=>bs,SingleSelectEnumSchemaSchema:()=>Os,StringSchemaSchema:()=>Oa,SubscribeRequestParamsSchema:()=>Fo,SubscribeRequestSchema:()=>xo,SubscriptionFilterSchema:()=>Nr,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Yo,SubscriptionsAcknowledgedNotificationSchema:()=>Wo,SubscriptionsListenRequestParamsSchema:()=>Go,SubscriptionsListenRequestSchema:()=>Bo,SubscriptionsListenResultMetaSchema:()=>Zo,SubscriptionsListenResultSchema:()=>Xo,TaskAugmentedRequestParamsSchema:()=>la,TaskCreationParamsSchema:()=>Cn,TaskMetadataSchema:()=>So,TaskSchema:()=>Gt,TaskStatusNotificationParamsSchema:()=>Qs,TaskStatusNotificationSchema:()=>jn,TaskStatusSchema:()=>Xs,TextContentSchema:()=>qa,TextResourceContentsSchema:()=>Cr,TitledMultiSelectEnumSchemaSchema:()=>Dr,TitledSingleSelectEnumSchemaSchema:()=>Ar,ToolAnnotationsSchema:()=>hs,ToolChoiceSchema:()=>Es,ToolExecutionSchema:()=>ps,ToolListChangedNotificationSchema:()=>ys,ToolResultContentSchema:()=>ws,ToolSchema:()=>Ir,ToolUseContentSchema:()=>is,UnsubscribeRequestParamsSchema:()=>Ko,UnsubscribeRequestSchema:()=>Jo,UntitledMultiSelectEnumSchemaSchema:()=>Vr,UntitledSingleSelectEnumSchemaSchema:()=>Mr});var v=(m)=>br.safeParse(m).success,P=(m)=>Rr.safeParse(m).success,X=(m)=>Ea.safeParse(m).success,re=(m)=>wa.safeParse(m).success;var Yt=(m)=>typeof m==="object"&&m!==null&&!Array.isArray(m)&&m.resultType==="input_required";function pc(m){if(m.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${m.params.ref.type}`)}function fc(m){if(m.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${m.params.ref.type}`)}var Ki="x-mcp-header",_u=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,yu=new Set(["string","integer","boolean","number"]);function gc(m){let h=[],f=new Map,g=(_,y,E)=>{if(_===null||typeof _!=="object")return;let b=_;if(Ki in b){if(!E||y.length===0)return`${ln(y)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let O=b[Ki];if(typeof O!=="string"||O.length===0)return`${ln(y)}: x-mcp-header MUST be a non-empty string`;if(!_u.test(O))return`${ln(y)}: x-mcp-header '${O}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let D=typeof b.type==="string"?b.type:void 0;if(D===void 0||!yu.has(D))return`${ln(y)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${D??"<none>"}`;let Z=O.toLowerCase(),ae=f.get(Z);if(ae!==void 0)return`x-mcp-header '${O}' is not case-insensitively unique (also declared as '${ae}')`;f.set(Z,O),h.push({path:y,headerName:O,type:D})}let C=b.properties;if(C!==null&&typeof C==="object")for(let[O,D]of Object.entries(C)){let Z=g(D,[...y,O],E);if(Z!==void 0)return Z}for(let O of vu){let D=b[O];if(D===void 0)continue;let Z=Array.isArray(D)?D:D!==null&&typeof D==="object"&&bu.has(O)?Object.values(D):[D];for(let ae of Z){let x=g(ae,[...y,`<${O}>`],!1);if(x!==void 0)return x}}},S=g(m,[],!0);return S===void 0?{valid:!0,declarations:h}:{valid:!1,reason:S}}var vu=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],bu=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function ln(m){return m.length===0?"<root>":m.join(".")}var dn=-32020,oh=[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32000],conformance:[],rationale:"The modern era is POST-only; GET/DELETE are body-less 2025-era session operations and are method-routed to legacy serving (405 when legacy serving is not configured), before any body is read."},{rung:"jsonrpc-shape",order:2,evaluatedAt:"edge",codes:[i.InvalidRequest],conformance:["server-stateless"],rationale:"The body must be a JSON-RPC request or notification: posted responses and batch arrays containing a modern or invalid element are rejected before classification (element-wise batch rule); all-legacy arrays stay legacy traffic."},{rung:"era-classification",order:3,evaluatedAt:"edge",codes:[dn,i.UnsupportedProtocolVersion],conformance:["server-stateless","http-header-validation","http-custom-header-server-validation"],rationale:"Body-primary era classification with the protocol-version header as a cross-check; a header/body disagreement is rejected with -32020 (HeaderMismatch), and an envelope-less request on a modern-only endpoint is answered with the unsupported-protocol-version error naming the supported revisions."},{rung:"envelope",order:4,evaluatedAt:"edge",codes:[i.InvalidParams],conformance:["server-stateless"],rationale:"A present envelope claim with a malformed envelope — and a missing envelope on a request whose protocol-version header names a modern revision — is an invalid-params rejection naming the offending or missing key(s); never a silent fall back to legacy handling. This is the only place an invalid-params rejection maps to HTTP 400."},{rung:"method-registry",order:5,evaluatedAt:"dispatch",codes:[i.MethodNotFound],conformance:["server-stateless"],rationale:"Method existence outranks parameter validity: a method absent from the negotiated revision’s registry (or with no handler installed) answers method-not-found before params or capabilities are looked at."},{rung:"request-params",order:6,evaluatedAt:"dispatch",codes:[i.InvalidParams],conformance:[],rationale:"Per-method params validation; emitted in-band by the dispatch layer (HTTP 200), never via the ladder status table."},{rung:"standard-header-validation",order:7,evaluatedAt:"pre-dispatch",codes:[dn],conformance:["http-header-validation"],rationale:"SEP-2243 standard `Mcp-Method` / `Mcp-Name` headers — presence, sentinel decoding, and `Mcp-Name` ↔ body cross-check — are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The classifier’s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5–6) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[i.MissingRequiredClientCapability],conformance:["server-stateless"],rationale:"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced — pinning the spec-mandated HTTP 400 independently of how dispatch- and handler-produced errors are mapped. The documented order (after method resolution and params validation) is preserved observably only while the requirement table is empty: once a served method gains a requirement entry, a request that is missing the capability and would also fail a dispatch rung is answered by this gate first, so the entry must consult the method registry before the gate if the documented precedence is to stay observable."},{rung:"param-header-validation",order:9,evaluatedAt:"pre-dispatch",codes:[dn],conformance:["http-custom-header-server-validation"],rationale:"SEP-2243 `Mcp-Param-*` headers are validated against the named tool’s `x-mcp-header` declarations and the body `arguments` after the tool registry is known and before dispatch reaches the handler; a missing/disagreeing/malformed header is rejected 400 / -32020 with the same shape as the standard-header cross-checks. The documented order (after method resolution and params validation) is preserved observably only when the body `arguments` would otherwise validate: the check runs pre-dispatch, so a `tools/call` that fails BOTH this rung and a dispatch-time rung (e.g. order-6 `request-params`, -32602) is answered by this gate first with 400 / -32020, not by the earlier-ordered rung."}],sh={[i.ParseError]:400,[i.InvalidRequest]:400,[i.MethodNotFound]:404,[i.UnsupportedProtocolVersion]:400,[i.MissingRequiredClientCapability]:400,[dn]:400};function un(m,h,f,g,S){return{kind:"reject",rung:m,cell:h,httpStatus:f,code:g.code,message:g.message,...g.data!==void 0&&{data:g.data},settled:S}}function oe(m){if(!G(m))return!1;let h=J(m);if(h===void 0||!Da(h))return!1;let f=A(m);return f!==void 0&&Y(f).length===0}function fe(m,h){switch(m.reason){case"http-method":return un("http-method","modern-only-method-not-allowed",405,new Ve(-32000,"Method not allowed."),!0);case"batch":return un("jsonrpc-shape","modern-only-batch-not-supported",400,new Ve(i.InvalidRequest,"Bad Request: JSON-RPC batches are not supported by this endpoint"),!0);case"response":return un("jsonrpc-shape","modern-only-response-post",400,new Ve(i.InvalidRequest,"Bad Request: JSON-RPC responses cannot be posted to this endpoint"),!0);case"notification":return;case"initialize":case"no-claim":{let f=m.requestedVersion;return un("era-classification","modern-only-missing-envelope",400,f===void 0?new Ve(i.UnsupportedProtocolVersion,"Unsupported protocol version: the request did not name a protocol version",{supported:[...h]}):new L({supported:[...h],requested:f}),!0)}}}function hn(m,h){return Q(m,h)}function Fr(m){return new Set(m.flatMap((h)=>Object.keys(h.shape)))}function Va(m){if(m==null)return!1;let h=typeof m;if(h!=="object"&&h!=="function")return!1;if(!("~standard"in m))return!1;return typeof m["~standard"]?.validate==="function"}var Ji=!1,si="draft-2020-12";function Wt(m,h="input"){let f=m["~standard"],g;if(f.jsonSchema)g=f.jsonSchema[h]({target:si});else if(f.vendor==="zod"){if(!("_zod"in m))throw Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");if(!Ji)Ji=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.");g=le(m,{target:si,io:h})}else throw Error(`Schema library "${f.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(h==="output"){if(g.type!==void 0)return g;return Sc(g)?{type:"object",...g}:g}if(g.type!==void 0&&g.type!=="object")throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(g.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...g}}function Sc(m){if("properties"in m||"patternProperties"in m||"additionalProperties"in m||"required"in m)return!0;for(let h of["oneOf","anyOf","allOf"]){let f=m[h];if(Array.isArray(f)&&f.length>0)return f.every((g)=>g!==null&&typeof g==="object"&&(g.type==="object"||Sc(g)))}return!1}function Ru(m){if(!m.path?.length)return m.message;return`${m.path.map((h)=>String(typeof h==="object"?h.key:h)).join(".")}: ${m.message}`}async function ua(m,h){let f=await m["~standard"].validate(h);if(f.issues&&f.issues.length>0)return{success:!1,error:f.issues.map((g)=>Ru(g)).join(", ")};return{success:!0,data:f.value}}function zu(m){let h=le(m,{target:si,io:"input"});return typeof h.pattern==="string"?h.pattern:void 0}var $u=/\\\.\\d\{(\d+)\}/;function Pu(m){let h=$u.exec(m),f=[void 0,-1,0];if(h)f.push(Number(h[1]));return[!1,!0].flatMap((g)=>[!1,!0].flatMap((S)=>f.map((_)=>N({local:g,offset:S,precision:_}))))}function Eu(m,h){let f;switch(m){case"email":f=[ke()];break;case"uri":f=[ee()];break;case"date":f=[ue()];break;case"date-time":f=Pu(h);break}return new Set(f.map((g)=>zu(g)).filter((g)=>g!==void 0))}function wu(m,h,f){if(f!=="zod")return!0;return Eu(m,h).has(h)}function _c(m){let h=Wt(m,"input"),f=h.properties||{},g=h.required||[];return Object.entries(f).map(([S,_])=>({name:S,description:_?.description,required:g.includes(S)}))}function Jr(m){return typeof m==="object"&&m!==null&&!Array.isArray(m)}function Tu(m){try{return Wt(m,"input")}catch(h){let f=h instanceof Error?h.message:String(h);throw new Ve(i.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${f}`)}}var Cu=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function vi(m){return Cu.has(m)||m.startsWith("x-")}var qu=new Set(["$schema",...Object.keys(Ma.shape.requestedSchema.shape)]),Gi={string:Fr([Oa,Mr,Ar,Lr]),number:Fr([ka]),integer:Fr([ka]),boolean:Fr([kr]),array:Fr([Vr,Dr])},ju=new Set(Oa.shape.format.unwrap().options);function Nu(m,h,f,g){if(!Jr(m))return m;let S=typeof m.type==="string"&&Object.hasOwn(Gi,m.type)?Gi[m.type]:void 0;if(S===void 0)return m;let _={};for(let[y,E]of Object.entries(m))if(S.has(y)||vi(y))_[y]=E;else if(y==="pattern"&&m.type==="string"&&typeof m.format==="string"){if(!ju.has(m.format))_[y]=E;else if(typeof E!=="string"||!wu(m.format,E,f))g.push(`${h}.${y}`)}else g.push(`${h}.${y}`);return _}function Iu(m,h){let f={},g=[];for(let[S,_]of Object.entries(m))if(S==="properties"&&Jr(_))f[S]=Object.fromEntries(Object.entries(_).map(([y,E])=>[y,Nu(E,`properties.${y}`,h,g)]));else if(qu.has(S))f[S]=_;else if(!vi(S))g.push(S);if(g.length>0)throw new Ve(i.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${g.join(", ")}`);return f}function Ou(m,h){if(!Jr(m.properties))return h;let f=Object.entries(m.properties).filter(([,g])=>!hn(Ur,g).success).map(([g])=>`properties.${g}`);return f.length>0?f.join(", "):h}function ni(m,h,f=""){if(Array.isArray(m)&&Array.isArray(h))return m.flatMap((g,S)=>ni(g,h[S],`${f}[${S}]`));if(!Jr(m)||!Jr(h))return[];return Object.entries(m).flatMap(([g,S])=>{let _=f?`${f}.${g}`:g;if(!Object.prototype.hasOwnProperty.call(h,g))return vi(g)?[]:[_];return ni(S,h[g],_)})}function ku(m){if(!Va(m.requestedSchema))return{...m,mode:"form",requestedSchema:m.requestedSchema};let h=m.requestedSchema["~standard"].vendor,f=Iu(Tu(m.requestedSchema),h),g=hn(Ma.shape.requestedSchema,f);if(!g.success)throw new Ve(i.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Ou(f,g.error.message)}`);let S=ni(f,g.data);if(S.length>0)throw new Ve(i.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${S.join(", ")}`);let _=(g.data.required??[]).filter((y)=>!Object.prototype.hasOwnProperty.call(g.data.properties,y));if(_.length>0)throw new Ve(i.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${_.join(", ")}`);return{...m,mode:"form",requestedSchema:g.data}}function Mu(m){let h=m.inputRequests!==void 0&&Object.keys(m.inputRequests).length>0,f=typeof m.requestState==="string";if(!h&&!f)throw TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...m.inputRequests!==void 0&&{inputRequests:m.inputRequests},...m.requestState!==void 0&&{requestState:m.requestState}}}var nh=Object.assign(Mu,{elicit(m){try{return{method:"elicitation/create",params:ku(m)}}catch(h){throw h instanceof Ve?TypeError(h.message,{cause:h}):h}},elicitUrl(m){return{method:"elicitation/create",params:{...m,mode:"url"}}},createMessage(m){return{method:"sampling/createMessage",params:m}},listRoots(){return{method:"roots/list"}}});var yc=250;function vc(m,h){return`Multi-round-trip request '${m}' still required input after ${h} rounds (inputRequired.maxRounds)`}function bc(m,h){return new Promise((f,g)=>{if(h?.aborted){g(h.reason instanceof Ke?h.reason:new Ke(Be.RequestTimeout,String(h.reason)));return}let S=setTimeout(()=>{h?.removeEventListener("abort",_),f()},m),_=()=>{clearTimeout(S),g(h?.reason instanceof Ke?h.reason:new Ke(Be.RequestTimeout,String(h?.reason)))};h?.addEventListener("abort",_,{once:!0})})}function Rc(m){let h=new AbortController,f=()=>h.abort(m?.reason);if(m?.addEventListener("abort",f,{once:!0}),m?.aborted)h.abort(m.reason);return{signal:h.signal,abort:(g)=>h.abort(g),dispose:()=>m?.removeEventListener("abort",f)}}var Au=["AnnotationsSchema","AudioContentSchema","BaseMetadataSchema","BlobResourceContentsSchema","BooleanSchemaSchema","CallToolRequestSchema","CallToolRequestParamsSchema","CallToolResultSchema","CancelledNotificationSchema","CancelledNotificationParamsSchema","CancelTaskRequestSchema","CancelTaskResultSchema","ClientCapabilitiesSchema","ClientNotificationSchema","ClientRequestSchema","ClientResultSchema","CompatibilityCallToolResultSchema","CompleteRequestSchema","CompleteRequestParamsSchema","CompleteResultSchema","ContentBlockSchema","CreateMessageRequestSchema","CreateMessageRequestParamsSchema","CreateMessageResultSchema","CreateMessageResultWithToolsSchema","CreateTaskResultSchema","CursorSchema","DiscoverRequestSchema","DiscoverResultSchema","ElicitationCompleteNotificationSchema","ElicitationCompleteNotificationParamsSchema","ElicitRequestSchema","ElicitRequestFormParamsSchema","ElicitRequestParamsSchema","ElicitRequestURLParamsSchema","ElicitResultSchema","EmbeddedResourceSchema","EmptyResultSchema","EnumSchemaSchema","GetPromptRequestSchema","GetPromptRequestParamsSchema","GetPromptResultSchema","GetTaskPayloadRequestSchema","GetTaskPayloadResultSchema","GetTaskRequestSchema","GetTaskResultSchema","IconSchema","IconsSchema","ImageContentSchema","ImplementationSchema","InitializedNotificationSchema","InitializeRequestSchema","InitializeRequestParamsSchema","InitializeResultSchema","JSONArraySchema","JSONObjectSchema","JSONRPCErrorResponseSchema","JSONRPCMessageSchema","JSONRPCNotificationSchema","JSONRPCRequestSchema","JSONRPCResponseSchema","JSONRPCResultResponseSchema","JSONValueSchema","LegacyTitledEnumSchemaSchema","ListPromptsRequestSchema","ListPromptsResultSchema","ListResourcesRequestSchema","ListResourcesResultSchema","ListResourceTemplatesRequestSchema","ListResourceTemplatesResultSchema","ListRootsRequestSchema","ListRootsResultSchema","ListTasksRequestSchema","ListTasksResultSchema","ListToolsRequestSchema","ListToolsResultSchema","LoggingLevelSchema","LoggingMessageNotificationSchema","LoggingMessageNotificationParamsSchema","ModelHintSchema","ModelPreferencesSchema","MultiSelectEnumSchemaSchema","NotificationSchema","NumberSchemaSchema","PaginatedRequestSchema","PaginatedRequestParamsSchema","PaginatedResultSchema","PingRequestSchema","PrimitiveSchemaDefinitionSchema","ProgressSchema","ProgressNotificationSchema","ProgressNotificationParamsSchema","ProgressTokenSchema","PromptSchema","PromptArgumentSchema","PromptListChangedNotificationSchema","PromptMessageSchema","PromptReferenceSchema","ReadResourceRequestSchema","ReadResourceRequestParamsSchema","ReadResourceResultSchema","RelatedTaskMetadataSchema","RequestSchema","RequestIdSchema","RequestMetaSchema","ResourceSchema","ResourceContentsSchema","ResourceLinkSchema","ResourceListChangedNotificationSchema","ResourceRequestParamsSchema","ResourceTemplateSchema","ResourceTemplateReferenceSchema","ResourceUpdatedNotificationSchema","ResourceUpdatedNotificationParamsSchema","ResultMetaObjectSchema","ResultSchema","RoleSchema","RootSchema","RootsListChangedNotificationSchema","SamplingContentSchema","SamplingMessageSchema","SamplingMessageContentBlockSchema","ServerCapabilitiesSchema","ServerNotificationSchema","ServerRequestSchema","ServerResultSchema","SetLevelRequestSchema","SetLevelRequestParamsSchema","SingleSelectEnumSchemaSchema","StringSchemaSchema","SubscribeRequestSchema","SubscribeRequestParamsSchema","SubscriptionFilterSchema","SubscriptionsAcknowledgedNotificationSchema","SubscriptionsAcknowledgedNotificationParamsSchema","SubscriptionsListenRequestSchema","SubscriptionsListenRequestParamsSchema","SubscriptionsListenResultSchema","SubscriptionsListenResultMetaSchema","TaskAugmentedRequestParamsSchema","TaskCreationParamsSchema","TaskMetadataSchema","TaskSchema","TaskStatusSchema","TaskStatusNotificationSchema","TaskStatusNotificationParamsSchema","TextContentSchema","TextResourceContentsSchema","TitledMultiSelectEnumSchemaSchema","TitledSingleSelectEnumSchemaSchema","ToolSchema","ToolAnnotationsSchema","ToolChoiceSchema","ToolExecutionSchema","ToolListChangedNotificationSchema","ToolResultContentSchema","ToolUseContentSchema","UnsubscribeRequestSchema","UnsubscribeRequestParamsSchema","UntitledMultiSelectEnumSchemaSchema","UntitledSingleSelectEnumSchemaSchema"],Lu={IdJagTokenExchangeResponseSchema:Yn,OAuthClientInformationFullSchema:Zn,OAuthClientInformationSchema:rn,OAuthClientMetadataSchema:an,OAuthClientRegistrationErrorSchema:Xn,OAuthErrorResponseSchema:Wn,OAuthMetadataSchema:en,OAuthProtectedResourceMetadataSchema:Jn,OAuthTokenRevocationRequestSchema:Qn,OAuthTokensSchema:Bn,OpenIdProviderDiscoveryMetadataSchema:Gn,OpenIdProviderMetadataSchema:tn},zc={},$c={};function Pc(m,h){let f=m.slice(0,-6);zc[f]=h,$c[f]=(g)=>h.safeParse(g).success}for(let m of Au)Pc(m,Su[m]);for(let[m,h]of Object.entries(Lu))Pc(m,h);var ih=Object.freeze(zc),ch=Object.freeze($c);function Vu(m){switch(m){case"initialize":case"notifications/initialized":return Bt(void 0);case"server/discover":return Bt(Gr);default:return}}var Du=60000,Uu=[Vt,gr,Dt,ca],Hu=["inputResponses","requestState"];function Bi(m,h){let f=m.params;if(!Kr(f))return{message:m,lifted:{}};let g=f._meta,S=Kr(g)?Uu.filter((b)=>(b in g)):[],_=h==="request"?Hu.filter((b)=>(b in f)):[];if(S.length===0&&_.length===0)return{message:m,lifted:{}};let y={},E={...f};if(S.length>0&&Kr(g)){let b={},C={...g};for(let O of S)b[O]=g[O],delete C[O];if(y.envelope=b,Object.keys(C).length>0)E._meta=C;else delete E._meta}for(let b of _){if(b==="inputResponses")y.inputResponses=E[b];if(b==="requestState")y.requestState=E[b];delete E[b]}return{message:{...m,params:E},lifted:y}}function Yi(m,h){let f=m.validateResult(h,void 0);if(!f.ok&&f.reason==="not-in-era")return;return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(g){let S=m.validateResult(h,g);if(S.ok)return{value:S.value};return{issues:[{message:S.reason==="invalid"?S.message:`not-in-era: ${h}`}]}}}}}function Br(m){return()=>m}var Fu=Br(void 0);function bi(m,h){return{...m,mcpReq:{...m.mcpReq,requestState:Br(h)}}}var Ec;function ge(m,h){Ec(m,h)}var wc=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;static{Ec=(m,h)=>{m._negotiatedProtocolVersion=h}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(m){this._options=m,this._supportedProtocolVersions=m?.supportedProtocolVersions??Rn,this.setNotificationHandler("notifications/cancelled",(h)=>{this._oncancel(h)}),this.setNotificationHandler("notifications/progress",(h)=>{this._onprogress(h)}),this.setRequestHandler("ping",(h)=>({}))}_shouldDropInbound(m){}_outboundMetaEnvelope(){}_envelopeOutbound(m){let h=this._outboundMetaEnvelope();if(h===void 0)return m;let f=m.params??{};return{...m,params:{...f,_meta:{...h,...f._meta}}}}_resolveNonCompleteResult(m,h){return Promise.reject(new Ke(Be.UnsupportedResultType,`Unsupported result type '${m.kind}' for ${h.request.method}`,{resultType:m.kind,method:h.request.method}))}_getRequestHandler(m){return this._requestHandlers.get(m)}async _oncancel(m){if(!m.params.requestId)return;this._requestHandlerAbortControllers.get(m.params.requestId)?.abort(m.params.reason)}_setupTimeout(m,h,f,g,S=!1){this._timeoutInfo.set(m,{timeoutId:setTimeout(g,h),startTime:Date.now(),timeout:h,maxTotalTimeout:f,resetTimeoutOnProgress:S,onTimeout:g})}_resetTimeout(m){let h=this._timeoutInfo.get(m);if(!h)return!1;let f=Date.now()-h.startTime;if(h.maxTotalTimeout&&f>=h.maxTotalTimeout)throw this._timeoutInfo.delete(m),new Ke(Be.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:h.maxTotalTimeout,totalElapsed:f});return clearTimeout(h.timeoutId),h.timeoutId=setTimeout(h.onTimeout,h.timeout),!0}_cleanupTimeout(m){let h=this._timeoutInfo.get(m);if(h)clearTimeout(h.timeoutId),this._timeoutInfo.delete(m)}async connect(m){this._transport=m;let h=this.transport?.onclose;this._transport.onclose=()=>{try{h?.()}finally{this._onclose()}};let f=this.transport?.onerror;this._transport.onerror=(S)=>{f?.(S),this._onerror(S)};let g=this._transport?.onmessage;this._transport.onmessage=(S,_)=>{if(g?.(S,_),X(S)||re(S))this._onresponse(S);else if(v(S))this._onrequest(S,_);else if(P(S))this._onnotification(S,_);else this._onerror(Error(`Unknown message type: ${JSON.stringify(S)}`))},m.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let m=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let g of this._timeoutInfo.values())clearTimeout(g.timeoutId);this._timeoutInfo.clear();let h=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let f=new Ke(Be.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let g of m.values())g(f);for(let g of h.values())g.abort(f)}}_onerror(m){this.onerror?.(m)}_onnotification(m,h){let{message:f}=Bi(m,"notification"),g=this._negotiatedWireCodec();if(h?.classification===void 0&&this._shouldDropInbound(m)==="drop")return;if(h?.classification!==void 0){let y=Fi(h.classification);if(y!==g.era){this._onerror(Error(`Era mismatch on inbound notification '${f.method}': classified as ${y} but this instance serves ${g.era}`));return}}if(ai(f.method)&&!g.hasNotificationMethod(f.method))return;let S=this._notificationHandlers.get(f.method),_=this.fallbackNotificationHandler;if(S===void 0&&_===void 0)return;Promise.resolve().then(()=>S===void 0?_(f):S(f,g)).catch((y)=>this._onerror(Error(`Uncaught error in notification handler: ${y}`)))}_onrequest(m,h){let{message:f,lifted:g}=Bi(m,"request"),S=this._negotiatedWireCodec();if(h?.classification===void 0&&this._shouldDropInbound(m)==="drop"){this._onerror(Error(`Dropped inbound request '${m.method}': not servable on this connection's protocol era`));return}let _=this._transport,y=(K,V,w)=>{let H={jsonrpc:"2.0",id:f.id,error:{code:K,message:V,...w!==void 0&&{data:w}}};_?.send(H).catch((q)=>this._onerror(Error(`Failed to send an error response: ${q}`)))};if(h?.classification!==void 0){let K=Fi(h.classification);if(K!==S.era){this._onerror(Error(`Era mismatch on inbound request '${f.method}': classified as ${K} but this instance serves ${S.era}`));let V=h.classification.revision??K;y(i.UnsupportedProtocolVersion,`Unsupported protocol version: ${V}`,{supported:this._supportedProtocolVersions,requested:V});return}}if(ti(f.method)&&!S.hasRequestMethod(f.method)){y(i.MethodNotFound,"Method not found");return}let E=this._requestHandlers.get(f.method)??this.fallbackRequestHandler;if(E===void 0){y(i.MethodNotFound,"Method not found");return}let b=S.checkInboundEnvelope(g);if(b!==void 0){y(i.InvalidParams,b);return}let C=(K,V)=>this._notificationViaCodec(this._resolveOutboundCodec(K.method),K,{...V,relatedRequestId:f.id}),O=(K,V,w)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(K.method),K,V,{...w,relatedRequestId:f.id}),D=new AbortController;this._requestHandlerAbortControllers.set(f.id,D);let Z=g.inputResponses===void 0?void 0:xu(g.inputResponses),ae={sessionId:_?.sessionId,mcpReq:{id:f.id,method:f.method,_meta:f.params?._meta,...g.envelope!==void 0&&{envelope:g.envelope},...Z!==void 0&&{inputResponses:Z.accepted},...Z!==void 0&&Z.droppedKeys.length>0&&{droppedInputResponseKeys:Z.droppedKeys},requestState:g.requestState===void 0?Fu:Br(g.requestState),signal:D.signal,send:(K,V,w)=>{let H=this._resolveOutboundCodec(K.method);if(this._assertOutboundRequestInEra(H,K.method),Va(V))return O(K,V,w);let q=Yi(H,K.method);if(q===void 0)throw TypeError(`'${K.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return O(K,q,V)},notify:C},http:h?.authInfo?{authInfo:h.authInfo}:void 0},x=this.buildContext(ae,h);Promise.resolve().then(()=>E(f,x)).then(async(K)=>{if(D.signal.aborted)return;let V;try{V=S.encodeResult(f.method,K,this._outboundServerInfo())}catch(H){this._onerror(Error(`Failed to encode result for ${f.method}: ${H}`)),y(i.InternalError,"Internal error");return}let w={result:V,jsonrpc:"2.0",id:f.id};await _?.send(w)},async(K)=>{if(D.signal.aborted)return;let V=Number.isSafeInteger(K.code)?K.code:i.InternalError,w={jsonrpc:"2.0",id:f.id,error:{code:S.encodeErrorCode(V),message:K.message??"Internal error",...K.data!==void 0&&{data:K.data}}};await _?.send(w)}).catch((K)=>this._onerror(Error(`Failed to send response: ${K}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(f.id)===D)this._requestHandlerAbortControllers.delete(f.id)})}_onprogress(m){let{progressToken:h,...f}=m.params,g=Number(h),S=this._progressHandlers.get(g);if(!S){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(m)}`));return}let _=this._responseHandlers.get(g),y=this._timeoutInfo.get(g);if(y&&_&&y.resetTimeoutOnProgress)try{this._resetTimeout(g)}catch(E){this._responseHandlers.delete(g),this._progressHandlers.delete(g),this._cleanupTimeout(g),_(E);return}S(f)}_onresponse(m){let h=Number(m.id),f=this._responseHandlers.get(h);if(f===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(m)}`));return}if(this._responseHandlers.delete(h),this._cleanupTimeout(h),this._progressHandlers.delete(h),X(m))f(m);else f(Ve.fromError(m.error.code,m.error.message,m.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(m,h,f){let g=this._resolveOutboundCodec(m.method);if(this._assertOutboundRequestInEra(g,m.method),Va(h))return this._requestWithSchemaViaCodec(g,m,h,f);let S=Yi(g,m.method);if(S===void 0)throw TypeError(`'${m.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(g,m,S,h)}_negotiatedWireCodec(){return Bt(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(m){if(this._negotiatedProtocolVersion===void 0){let h=Vu(m);if(h)return h}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(m,h){if(ti(h)&&!m.hasRequestMethod(h))throw new Ke(Be.MethodNotSupportedByProtocolVersion,`Method '${h}' is not supported by the negotiated protocol version (wire era ${m.era})`,{method:h,era:m.era})}_requestWithSchema(m,h,f){let g=this._resolveOutboundCodec(m.method);return this._assertOutboundRequestInEra(g,m.method),this._requestWithSchemaViaCodec(g,m,h,f)}_requestWithSchemaViaCodec(m,h,f,g){let{relatedRequestId:S,resumptionToken:_,onresumptiontoken:y,headers:E}=g??{},b=Date.now(),C,O;return new Promise((D,Z)=>{let ae=(U)=>{Z(U)};if(!this._transport){ae(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(h.method)}catch(U){ae(U);return}if(g?.signal?.aborted){let U=g.signal.reason;throw U instanceof Ke?U:new Ke(Be.RequestTimeout,String(U))}let x=m.era===Gr&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,K=this._requestMessageId++;O=K;let V={...h,jsonrpc:"2.0",id:K};if(g?.onprogress)this._progressHandlers.set(K,g.onprogress),V.params={...h.params,_meta:{...h.params?._meta,progressToken:K}};let w=this._envelopeOutbound(V),H=!1,q=(U)=>{if(H)return;if(this._progressHandlers.delete(K),x===void 0)this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:K,reason:String(U)}}),{relatedRequestId:S,resumptionToken:_,onresumptiontoken:y}).catch((j)=>this._onerror(Error(`Failed to send cancellation: ${j}`)));else x.abort();Z(U instanceof Ke?U:new Ke(Be.RequestTimeout,String(U)))};this._responseHandlers.set(K,(U)=>{if(g?.signal?.aborted)return;if(H=!0,U instanceof Error)return Z(U);let j;try{j=m.decodeResult(h.method,U.result)}catch(Pe){return Z(Pe instanceof Error?Pe:Error(String(Pe)))}if(j.kind==="invalid")return Z(j.error);if(j.kind==="input_required"){if(g?.allowInputRequired===!0)return D(Ku(j));let Pe={codec:m,request:h,resultSchema:f,options:g,flowStartedAt:b,retry:(Ie,Te)=>this._requestWithSchemaViaCodec(m,Ie===void 0?{method:h.method}:{method:h.method,params:Ie},f,Te)};return D(this._resolveNonCompleteResult(j,Pe))}let ce=j.result;ua(f,ce).then((Pe)=>{if(Pe.success)D(Pe.data);else Z(new Ke(Be.InvalidResult,`Invalid result for ${h.method}: ${Pe.error}`))},Z)}),C=()=>q(g?.signal?.reason),g?.signal?.addEventListener("abort",C,{once:!0});let B=g?.timeout??Du,ne=()=>q(new Ke(Be.RequestTimeout,"Request timed out",{timeout:B}));this._setupTimeout(K,B,g?.maxTotalTimeout,ne,g?.resetTimeoutOnProgress??!1),this._transport.send(w,{relatedRequestId:S,resumptionToken:_,onresumptiontoken:y,headers:E,requestSignal:x?.signal}).catch((U)=>{this._progressHandlers.delete(K),Z(U)})}).finally(()=>{if(C)g?.signal?.removeEventListener("abort",C);if(O!==void 0)this._responseHandlers.delete(O),this._cleanupTimeout(O)})}async notification(m,h){return this._notificationViaCodec(this._resolveOutboundCodec(m.method),m,h)}async _notificationViaCodec(m,h,f){if(!this._transport)throw new Ke(Be.NotConnected,"Not connected");if(ai(h.method)&&!m.hasNotificationMethod(h.method))throw new Ke(Be.MethodNotSupportedByProtocolVersion,`Notification '${h.method}' is not supported by the negotiated protocol version (wire era ${m.era})`,{method:h.method,era:m.era});this.assertNotificationCapability(h.method);let g=this._envelopeOutbound({jsonrpc:"2.0",...h});if((this._options?.debouncedNotificationMethods??[]).includes(h.method)&&!h.params&&!f?.relatedRequestId){if(this._pendingDebouncedNotifications.has(h.method))return;this._pendingDebouncedNotifications.add(h.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(h.method),!this._transport)return;this._transport?.send(g,f).catch((S)=>this._onerror(S))});return}await this._transport.send(g,f)}setRequestHandler(m,h,f){this.assertRequestHandlerCapability(m);let g;if(typeof h==="function"){if(!ti(m))throw TypeError(`'${m}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);g=(S,_)=>{let y=this._negotiatedWireCodec(),E=y.validateRequest(m,S);if(!E.ok&&E.reason==="not-in-era")E=y.validateInputRequest(m,S);if(!E.ok){if(E.reason==="not-in-era")throw new Ve(i.InternalError,`No wire schema for ${m} in the resolved era`);throw Error(E.message)}return Promise.resolve(h(E.value,_))}}else if(f)g=async(S,_)=>{let y=await ua(h.params,{...S.params});if(!y.success)throw new Ve(i.InvalidParams,`Invalid params for ${m}: ${y.error}`);return f(y.data,_)};else throw TypeError("setRequestHandler: handler is required");this._requestHandlers.set(m,this._wrapHandler(m,g))}_wrapHandler(m,h){return h}_outboundServerInfo(){}removeRequestHandler(m){this._requestHandlers.delete(m)}assertCanSetRequestHandler(m){if(this._requestHandlers.has(m))throw Error(`A request handler for ${m} already exists, which would be overridden`)}setNotificationHandler(m,h,f){if(typeof h==="function"){if(!ai(m))throw TypeError(`'${m}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(m,(g,S)=>{let _=S.validateNotification(m,g);if(!_.ok){if(_.reason==="not-in-era")throw new Ve(i.InternalError,`No wire schema for ${m} in the resolved era`);throw Error(_.message)}return Promise.resolve(h(_.value))});return}if(!f)throw TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(m,async(g)=>{let S=await ua(h.params,{...g.params});if(!S.success)throw new Ve(i.InvalidParams,`Invalid params for notification ${m}: ${S.error}`);await f(S.data,g)})}removeNotificationHandler(m){this._notificationHandlers.delete(m)}};function Kr(m){return m!==null&&typeof m==="object"&&!Array.isArray(m)}function Tc(m,h){let f={...m};for(let g in h){let S=g,_=h[S];if(_===void 0)continue;let y=f[S];f[S]=Kr(y)&&Kr(_)?{...y,..._}:_}return f}function Wi(m){return typeof m==="object"&&m!==null&&!Array.isArray(m)}function xu(m){let h={},f=[];if(!Wi(m))return{accepted:h,droppedKeys:f};for(let[g,S]of Object.entries(m)){if(!Wi(S)||"method"in S||"result"in S){f.push(g);continue}h[g]=S}return{accepted:h,droppedKeys:f}}function Ku(m){return{resultType:"input_required",inputRequests:m.inputRequests,...m.requestState!==void 0&&{requestState:m.requestState}}}/*!
|
|
2
|
-
* content-type
|
|
3
|
-
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
4
|
-
* MIT Licensed
|
|
5
|
-
*/var Ju=qe((m)=>{var h=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,f=/\\([\u000b\u0020-\u00ff])/g,g=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;m.parse=S;function S(E){if(!E)throw TypeError("argument string is required");var b=typeof E==="object"?_(E):E;if(typeof b!=="string")throw TypeError("argument string is required to be a string");var C=b.indexOf(";"),O=C!==-1?b.slice(0,C).trim():b.trim();if(!g.test(O))throw TypeError("invalid media type");var D=new y(O.toLowerCase());if(C!==-1){var Z,ae,x;h.lastIndex=C;while(ae=h.exec(b)){if(ae.index!==C)throw TypeError("invalid parameter format");if(C+=ae[0].length,Z=ae[1].toLowerCase(),x=ae[2],x.charCodeAt(0)===34){if(x=x.slice(1,-1),x.indexOf("\\")!==-1)x=x.replace(f,"$1")}D.parameters[Z]=x}if(C!==b.length)throw TypeError("invalid parameter format")}return D}function _(E){var b;if(typeof E.getHeader==="function")b=E.getHeader("content-type");else if(typeof E.headers==="object")b=E.headers&&E.headers["content-type"];if(typeof b!=="string")throw TypeError("content-type header is missing from object");return b}function y(E){this.parameters=Object.create(null),this.type=E}}),lh=go(Ju(),1);var Gu=10485760,ye=class{_buffer;_maxBufferSize;constructor(m){this._maxBufferSize=m?.maxBufferSize??Gu}append(m){if((this._buffer?.length??0)+m.length>this._maxBufferSize)throw this.clear(),Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,m]):m}readMessage(){while(this._buffer){let m=this._buffer.indexOf(`
|
|
6
|
-
`);if(m===-1)return null;let h=this._buffer.toString("utf8",0,m).replace(/\r$/,"");this._buffer=this._buffer.subarray(m+1);try{return Bu(h)}catch(f){if(f instanceof SyntaxError)continue;throw f}}return null}clear(){this._buffer=void 0}};function Bu(m){return yo.parse(JSON.parse(m))}function Se(m){return JSON.stringify(m)+`
|
|
7
|
-
`}var Yu=/^[A-Za-z0-9._-]{1,128}$/;function Wu(m){let h=[];if(m.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(m.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${m.length})`]};if(m.includes(" "))h.push("Tool name contains spaces, which may cause parsing issues");if(m.includes(","))h.push("Tool name contains commas, which may cause parsing issues");if(m.startsWith("-")||m.endsWith("-"))h.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if(m.startsWith(".")||m.endsWith("."))h.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!Yu.test(m)){let f=[...m].filter((g)=>!/[A-Za-z0-9._-]/.test(g)).filter((g,S,_)=>_.indexOf(g)===S);return h.push(`Tool name contains invalid characters: ${f.map((g)=>`"${g}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:h}}return{isValid:!0,warnings:h}}function Zu(m,h){if(h.length>0){console.warn(`Tool name validation warning for "${m}":`);for(let f of h)console.warn(` - ${f}`);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 Ri(m){let h=Wu(m);return Zu(m,h.warnings),h.isValid}function Xu(m){return typeof m==="object"&&m!==null&&"_zod"in m}function Qu(m){return typeof m==="object"&&m!==null&&!("_zod"in m)&&"_def"in m&&typeof m._def?.typeName==="string"}function ed(m){if(typeof m!=="object"||m===null)return!1;if(Va(m))return!1;let h=Object.getPrototypeOf(m);if(h!==Object.prototype&&h!==null)return!1;return Object.values(m).every((f)=>Xu(f))}function pn(m){if(m===void 0)return;if(ed(m))return t(m);if(typeof m==="object"&&m!==null&&!Va(m)&&Object.values(m).some((h)=>Qu(h)))throw TypeError("Raw-shape inputSchema/outputSchema/argsSchema fields must be Zod v4 schemas. Got a Zod v3 field schema. Import from `zod/v4` (or upgrade your zod import), or wrap with `z.object({...})` yourself.");if(!Va(m))throw TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return m}var fn=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.regexpCode=m.getEsmExportName=m.getProperty=m.safeStringify=m.stringify=m.strConcat=m.addCodeArg=m.str=m._=m.nil=m._Code=m.Name=m.IDENTIFIER=m._CodeOrName=void 0;var h=class{};m._CodeOrName=h,m.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var f=class extends h{constructor(w){super();if(!m.IDENTIFIER.test(w))throw Error("CodeGen: name must be a valid identifier");this.str=w}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};m.Name=f;var g=class extends h{constructor(w){super();this._items=typeof w==="string"?[w]:w}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let w=this._items[0];return w===""||w==='""'}get str(){var w;return(w=this._str)!==null&&w!==void 0?w:this._str=this._items.reduce((H,q)=>`${H}${q}`,"")}get names(){var w;return(w=this._names)!==null&&w!==void 0?w:this._names=this._items.reduce((H,q)=>{if(q instanceof f)H[q.str]=(H[q.str]||0)+1;return H},{})}};m._Code=g,m.nil=new g("");function S(w,...H){let q=[w[0]],B=0;while(B<H.length)E(q,H[B]),q.push(w[++B]);return new g(q)}m._=S;let _=new g("+");function y(w,...H){let q=[ae(w[0])],B=0;while(B<H.length)q.push(_),E(q,H[B]),q.push(_,ae(w[++B]));return b(q),new g(q)}m.str=y;function E(w,H){if(H instanceof g)w.push(...H._items);else if(H instanceof f)w.push(H);else w.push(D(H))}m.addCodeArg=E;function b(w){let H=1;while(H<w.length-1){if(w[H]===_){let q=C(w[H-1],w[H+1]);if(q!==void 0){w.splice(H-1,3,q);continue}w[H++]="+"}H++}}function C(w,H){if(H==='""')return w;if(w==='""')return H;if(typeof w=="string"){if(H instanceof f||w[w.length-1]!=='"')return;if(typeof H!="string")return`${w.slice(0,-1)}${H}"`;if(H[0]==='"')return w.slice(0,-1)+H.slice(1);return}if(typeof H=="string"&&H[0]==='"'&&!(w instanceof f))return`"${w}${H.slice(1)}`}function O(w,H){return H.emptyStr()?w:w.emptyStr()?H:y`${w}${H}`}m.strConcat=O;function D(w){return typeof w=="number"||typeof w=="boolean"||w===null?w:ae(Array.isArray(w)?w.join(","):w)}function Z(w){return new g(ae(w))}m.stringify=Z;function ae(w){return JSON.stringify(w).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}m.safeStringify=ae;function x(w){return typeof w=="string"&&m.IDENTIFIER.test(w)?new g(`.${w}`):S`[${w}]`}m.getProperty=x;function K(w){if(typeof w=="string"&&m.IDENTIFIER.test(w))return new g(`${w}`);throw Error(`CodeGen: invalid export name: ${w}, use explicit $id name mapping`)}m.getEsmExportName=K;function V(w){return new g(w.toString())}m.regexpCode=V}),Cc=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.ValueScope=m.ValueScopeName=m.Scope=m.varKinds=m.UsedValueState=void 0;let h=fn();var f=class extends Error{constructor(b){super(`CodeGen: "code" for ${b} not defined`);this.value=b.value}},g;(function(b){b[b.Started=0]="Started",b[b.Completed=1]="Completed"})(g||(m.UsedValueState=g={})),m.varKinds={const:new h.Name("const"),let:new h.Name("let"),var:new h.Name("var")};var S=class{constructor({prefixes:b,parent:C}={}){this._names={},this._prefixes=b,this._parent=C}toName(b){return b instanceof h.Name?b:this.name(b)}name(b){return new h.Name(this._newName(b))}_newName(b){let C=this._names[b]||this._nameGroup(b);return`${b}${C.index++}`}_nameGroup(b){var C,O;if(((O=(C=this._parent)===null||C===void 0?void 0:C._prefixes)===null||O===void 0?void 0:O.has(b))||this._prefixes&&!this._prefixes.has(b))throw Error(`CodeGen: prefix "${b}" is not allowed in this scope`);return this._names[b]={prefix:b,index:0}}};m.Scope=S;var _=class extends h.Name{constructor(b,C){super(C);this.prefix=b}setValue(b,{property:C,itemIndex:O}){this.value=b,this.scopePath=h._`.${new h.Name(C)}[${O}]`}};m.ValueScopeName=_;let y=h._`\n`;var E=class extends S{constructor(b){super(b);this._values={},this._scope=b.scope,this.opts={...b,_n:b.lines?y:h.nil}}get(){return this._scope}name(b){return new _(b,this._newName(b))}value(b,C){var O;if(C.ref===void 0)throw Error("CodeGen: ref must be passed in value");let D=this.toName(b),{prefix:Z}=D,ae=(O=C.key)!==null&&O!==void 0?O:C.ref,x=this._values[Z];if(x){let w=x.get(ae);if(w)return w}else x=this._values[Z]=new Map;x.set(ae,D);let K=this._scope[Z]||(this._scope[Z]=[]),V=K.length;return K[V]=C.ref,D.setValue(C,{property:Z,itemIndex:V}),D}getValue(b,C){let O=this._values[b];if(!O)return;return O.get(C)}scopeRefs(b,C=this._values){return this._reduceValues(C,(O)=>{if(O.scopePath===void 0)throw Error(`CodeGen: name "${O}" has no value`);return h._`${b}${O.scopePath}`})}scopeCode(b=this._values,C,O){return this._reduceValues(b,(D)=>{if(D.value===void 0)throw Error(`CodeGen: name "${D}" has no value`);return D.value.code},C,O)}_reduceValues(b,C,O={},D){let Z=h.nil;for(let ae in b){let x=b[ae];if(!x)continue;let K=O[ae]=O[ae]||new Map;x.forEach((V)=>{if(K.has(V))return;K.set(V,g.Started);let w=C(V);if(w){let H=this.opts.es5?m.varKinds.var:m.varKinds.const;Z=h._`${Z}${H} ${V} = ${w};${this.opts._n}`}else if(w=D===null||D===void 0?void 0:D(V))Z=h._`${Z}${w}${this.opts._n}`;else throw new f(V);K.set(V,g.Completed)})}return Z}};m.ValueScope=E}),Fe=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.or=m.and=m.not=m.CodeGen=m.operators=m.varKinds=m.ValueScopeName=m.ValueScope=m.Scope=m.Name=m.regexpCode=m.stringify=m.getProperty=m.nil=m.strConcat=m.str=m._=void 0;let h=fn(),f=Cc();var g=fn();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return g._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return g.str}}),Object.defineProperty(m,"strConcat",{enumerable:!0,get:function(){return g.strConcat}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return g.nil}}),Object.defineProperty(m,"getProperty",{enumerable:!0,get:function(){return g.getProperty}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return g.stringify}}),Object.defineProperty(m,"regexpCode",{enumerable:!0,get:function(){return g.regexpCode}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return g.Name}});var S=Cc();Object.defineProperty(m,"Scope",{enumerable:!0,get:function(){return S.Scope}}),Object.defineProperty(m,"ValueScope",{enumerable:!0,get:function(){return S.ValueScope}}),Object.defineProperty(m,"ValueScopeName",{enumerable:!0,get:function(){return S.ValueScopeName}}),Object.defineProperty(m,"varKinds",{enumerable:!0,get:function(){return S.varKinds}}),m.operators={GT:new h._Code(">"),GTE:new h._Code(">="),LT:new h._Code("<"),LTE:new h._Code("<="),EQ:new h._Code("==="),NEQ:new h._Code("!=="),NOT:new h._Code("!"),OR:new h._Code("||"),AND:new h._Code("&&"),ADD:new h._Code("+")};var _=class{optimizeNodes(){return this}optimizeNames(W,me){return this}},y=class extends _{constructor(W,me,pe){super();this.varKind=W,this.name=me,this.rhs=pe}render({es5:W,_n:me}){let pe=W?f.varKinds.var:this.varKind,Oe=this.rhs===void 0?"":` = ${this.rhs}`;return`${pe} ${this.name}${Oe};`+me}optimizeNames(W,me){if(!W[this.name.str])return;if(this.rhs)this.rhs=Me(this.rhs,W,me);return this}get names(){return this.rhs instanceof h._CodeOrName?this.rhs.names:{}}},E=class extends _{constructor(W,me,pe){super();this.lhs=W,this.rhs=me,this.sideEffects=pe}render({_n:W}){return`${this.lhs} = ${this.rhs};`+W}optimizeNames(W,me){if(this.lhs instanceof h.Name&&!W[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Me(this.rhs,W,me),this}get names(){return Ae(this.lhs instanceof h.Name?{}:{...this.lhs.names},this.rhs)}},b=class extends E{constructor(W,me,pe,Oe){super(W,pe,Oe);this.op=me}render({_n:W}){return`${this.lhs} ${this.op}= ${this.rhs};`+W}},C=class extends _{constructor(W){super();this.label=W,this.names={}}render({_n:W}){return`${this.label}:`+W}},O=class extends _{constructor(W){super();this.label=W,this.names={}}render({_n:W}){return`break${this.label?` ${this.label}`:""};`+W}},D=class extends _{constructor(W){super();this.error=W}render({_n:W}){return`throw ${this.error};`+W}get names(){return this.error.names}},Z=class extends _{constructor(W){super();this.code=W}render({_n:W}){return`${this.code};`+W}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(W,me){return this.code=Me(this.code,W,me),this}get names(){return this.code instanceof h._CodeOrName?this.code.names:{}}},ae=class extends _{constructor(W=[]){super();this.nodes=W}render(W){return this.nodes.reduce((me,pe)=>me+pe.render(W),"")}optimizeNodes(){let{nodes:W}=this,me=W.length;while(me--){let pe=W[me].optimizeNodes();if(Array.isArray(pe))W.splice(me,1,...pe);else if(pe)W[me]=pe;else W.splice(me,1)}return W.length>0?this:void 0}optimizeNames(W,me){let{nodes:pe}=this,Oe=pe.length;while(Oe--){let Le=pe[Oe];if(Le.optimizeNames(W,me))continue;Ge(W,Le.names),pe.splice(Oe,1)}return pe.length>0?this:void 0}get names(){return this.nodes.reduce((W,me)=>je(W,me.names),{})}},x=class extends ae{render(W){return"{"+W._n+super.render(W)+"}"+W._n}},K=class extends ae{},V=class extends x{};V.kind="else";var w=class W extends x{constructor(me,pe){super(pe);this.condition=me}render(me){let pe=`if(${this.condition})`+super.render(me);if(this.else)pe+="else "+this.else.render(me);return pe}optimizeNodes(){super.optimizeNodes();let me=this.condition;if(me===!0)return this.nodes;let pe=this.else;if(pe){let Oe=pe.optimizeNodes();pe=this.else=Array.isArray(Oe)?new V(Oe):Oe}if(pe){if(me===!1)return pe instanceof W?pe:pe.nodes;if(this.nodes.length)return this;return new W(Qe(me),pe instanceof W?[pe]:pe.nodes)}if(me===!1||!this.nodes.length)return;return this}optimizeNames(me,pe){var Oe;if(this.else=(Oe=this.else)===null||Oe===void 0?void 0:Oe.optimizeNames(me,pe),!(super.optimizeNames(me,pe)||this.else))return;return this.condition=Me(this.condition,me,pe),this}get names(){let me=super.names;if(Ae(me,this.condition),this.else)je(me,this.else.names);return me}};w.kind="if";var H=class extends x{};H.kind="for";var q=class extends H{constructor(W){super();this.iteration=W}render(W){return`for(${this.iteration})`+super.render(W)}optimizeNames(W,me){if(!super.optimizeNames(W,me))return;return this.iteration=Me(this.iteration,W,me),this}get names(){return je(super.names,this.iteration.names)}},B=class extends H{constructor(W,me,pe,Oe){super();this.varKind=W,this.name=me,this.from=pe,this.to=Oe}render(W){let me=W.es5?f.varKinds.var:this.varKind,{name:pe,from:Oe,to:Le}=this;return`for(${me} ${pe}=${Oe}; ${pe}<${Le}; ${pe}++)`+super.render(W)}get names(){return Ae(Ae(super.names,this.from),this.to)}},ne=class extends H{constructor(W,me,pe,Oe){super();this.loop=W,this.varKind=me,this.name=pe,this.iterable=Oe}render(W){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(W)}optimizeNames(W,me){if(!super.optimizeNames(W,me))return;return this.iterable=Me(this.iterable,W,me),this}get names(){return je(super.names,this.iterable.names)}},U=class extends x{constructor(W,me,pe){super();this.name=W,this.args=me,this.async=pe}render(W){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(W)}};U.kind="func";var j=class extends ae{render(W){return"return "+super.render(W)}};j.kind="return";var ce=class extends x{render(W){let me="try"+super.render(W);if(this.catch)me+=this.catch.render(W);if(this.finally)me+=this.finally.render(W);return me}optimizeNodes(){var W,me;return super.optimizeNodes(),(W=this.catch)===null||W===void 0||W.optimizeNodes(),(me=this.finally)===null||me===void 0||me.optimizeNodes(),this}optimizeNames(W,me){var pe,Oe;return super.optimizeNames(W,me),(pe=this.catch)===null||pe===void 0||pe.optimizeNames(W,me),(Oe=this.finally)===null||Oe===void 0||Oe.optimizeNames(W,me),this}get names(){let W=super.names;if(this.catch)je(W,this.catch.names);if(this.finally)je(W,this.finally.names);return W}},Pe=class extends x{constructor(W){super();this.error=W}render(W){return`catch(${this.error})`+super.render(W)}};Pe.kind="catch";var Ie=class extends x{render(W){return"finally"+super.render(W)}};Ie.kind="finally";var Te=class{constructor(W,me={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...me,_n:me.lines?`
|
|
8
|
-
`:""},this._extScope=W,this._scope=new f.Scope({parent:W}),this._nodes=[new K]}toString(){return this._root.render(this.opts)}name(W){return this._scope.name(W)}scopeName(W){return this._extScope.name(W)}scopeValue(W,me){let pe=this._extScope.value(W,me);return(this._values[pe.prefix]||(this._values[pe.prefix]=new Set)).add(pe),pe}getScopeValue(W,me){return this._extScope.getValue(W,me)}scopeRefs(W){return this._extScope.scopeRefs(W,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(W,me,pe,Oe){let Le=this._scope.toName(me);if(pe!==void 0&&Oe)this._constants[Le.str]=pe;return this._leafNode(new y(W,Le,pe)),Le}const(W,me,pe){return this._def(f.varKinds.const,W,me,pe)}let(W,me,pe){return this._def(f.varKinds.let,W,me,pe)}var(W,me,pe){return this._def(f.varKinds.var,W,me,pe)}assign(W,me,pe){return this._leafNode(new E(W,me,pe))}add(W,me){return this._leafNode(new b(W,m.operators.ADD,me))}code(W){if(typeof W=="function")W();else if(W!==h.nil)this._leafNode(new Z(W));return this}object(...W){let me=["{"];for(let[pe,Oe]of W){if(me.length>1)me.push(",");if(me.push(pe),pe!==Oe||this.opts.es5)me.push(":"),(0,h.addCodeArg)(me,Oe)}return me.push("}"),new h._Code(me)}if(W,me,pe){if(this._blockNode(new w(W)),me&&pe)this.code(me).else().code(pe).endIf();else if(me)this.code(me).endIf();else if(pe)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(W){return this._elseNode(new w(W))}else(){return this._elseNode(new V)}endIf(){return this._endBlockNode(w,V)}_for(W,me){if(this._blockNode(W),me)this.code(me).endFor();return this}for(W,me){return this._for(new q(W),me)}forRange(W,me,pe,Oe,Le=this.opts.es5?f.varKinds.var:f.varKinds.let){let Je=this._scope.toName(W);return this._for(new B(Le,Je,me,pe),()=>Oe(Je))}forOf(W,me,pe,Oe=f.varKinds.const){let Le=this._scope.toName(W);if(this.opts.es5){let Je=me instanceof h.Name?me:this.var("_arr",me);return this.forRange("_i",0,h._`${Je}.length`,(He)=>{this.var(Le,h._`${Je}[${He}]`),pe(Le)})}return this._for(new ne("of",Oe,Le,me),()=>pe(Le))}forIn(W,me,pe,Oe=this.opts.es5?f.varKinds.var:f.varKinds.const){if(this.opts.ownProperties)return this.forOf(W,h._`Object.keys(${me})`,pe);let Le=this._scope.toName(W);return this._for(new ne("in",Oe,Le,me),()=>pe(Le))}endFor(){return this._endBlockNode(H)}label(W){return this._leafNode(new C(W))}break(W){return this._leafNode(new O(W))}return(W){let me=new j;if(this._blockNode(me),this.code(W),me.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(j)}try(W,me,pe){if(!me&&!pe)throw Error('CodeGen: "try" without "catch" and "finally"');let Oe=new ce;if(this._blockNode(Oe),this.code(W),me){let Le=this.name("e");this._currNode=Oe.catch=new Pe(Le),me(Le)}if(pe)this._currNode=Oe.finally=new Ie,this.code(pe);return this._endBlockNode(Pe,Ie)}throw(W){return this._leafNode(new D(W))}block(W,me){if(this._blockStarts.push(this._nodes.length),W)this.code(W).endBlock(me);return this}endBlock(W){let me=this._blockStarts.pop();if(me===void 0)throw Error("CodeGen: not in self-balancing block");let pe=this._nodes.length-me;if(pe<0||W!==void 0&&pe!==W)throw Error(`CodeGen: wrong number of nodes: ${pe} vs ${W} expected`);return this._nodes.length=me,this}func(W,me=h.nil,pe,Oe){if(this._blockNode(new U(W,me,pe)),Oe)this.code(Oe).endFunc();return this}endFunc(){return this._endBlockNode(U)}optimize(W=1){while(W-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(W){return this._currNode.nodes.push(W),this}_blockNode(W){this._currNode.nodes.push(W),this._nodes.push(W)}_endBlockNode(W,me){let pe=this._currNode;if(pe instanceof W||me&&pe instanceof me)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${me?`${W.kind}/${me.kind}`:W.kind}"`)}_elseNode(W){let me=this._currNode;if(!(me instanceof w))throw Error('CodeGen: "else" without "if"');return this._currNode=me.else=W,this}get _root(){return this._nodes[0]}get _currNode(){let W=this._nodes;return W[W.length-1]}set _currNode(W){let me=this._nodes;me[me.length-1]=W}};m.CodeGen=Te;function je(W,me){for(let pe in me)W[pe]=(W[pe]||0)+(me[pe]||0);return W}function Ae(W,me){return me instanceof h._CodeOrName?je(W,me.names):W}function Me(W,me,pe){if(W instanceof h.Name)return Oe(W);if(!Le(W))return W;return new h._Code(W._items.reduce((Je,He)=>{if(He instanceof h.Name)He=Oe(He);if(He instanceof h._Code)Je.push(...He._items);else Je.push(He);return Je},[]));function Oe(Je){let He=pe[Je.str];if(He===void 0||me[Je.str]!==1)return Je;return delete me[Je.str],He}function Le(Je){return Je instanceof h._Code&&Je._items.some((He)=>He instanceof h.Name&&me[He.str]===1&&pe[He.str]!==void 0)}}function Ge(W,me){for(let pe in me)W[pe]=(W[pe]||0)-(me[pe]||0)}function Qe(W){return typeof W=="boolean"||typeof W=="number"||W===null?!W:h._`!${Ne(W)}`}m.not=Qe;let Ze=Re(m.operators.AND);function nt(...W){return W.reduce(Ze)}m.and=nt;let Ye=Re(m.operators.OR);function he(...W){return W.reduce(Ye)}m.or=he;function Re(W){return(me,pe)=>me===h.nil?pe:pe===h.nil?me:h._`${Ne(me)} ${W} ${Ne(pe)}`}function Ne(W){return W instanceof h.Name?W:h._`(${W})`}}),We=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.checkStrictMode=m.getErrorPath=m.Type=m.useFunc=m.setEvaluated=m.evaluatedPropsToName=m.mergeEvaluated=m.eachItem=m.unescapeJsonPointer=m.escapeJsonPointer=m.escapeFragment=m.unescapeFragment=m.schemaRefOrVal=m.schemaHasRulesButRef=m.schemaHasRules=m.checkUnknownRules=m.alwaysValidSchema=m.toHash=void 0;let h=Fe(),f=fn();function g(U){let j={};for(let ce of U)j[ce]=!0;return j}m.toHash=g;function S(U,j){if(typeof j=="boolean")return j;if(Object.keys(j).length===0)return!0;return _(U,j),!y(j,U.self.RULES.all)}m.alwaysValidSchema=S;function _(U,j=U.schema){let{opts:ce,self:Pe}=U;if(!ce.strictSchema)return;if(typeof j==="boolean")return;let Ie=Pe.RULES.keywords;for(let Te in j)if(!Ie[Te])ne(U,`unknown keyword: "${Te}"`)}m.checkUnknownRules=_;function y(U,j){if(typeof U=="boolean")return!U;for(let ce in U)if(j[ce])return!0;return!1}m.schemaHasRules=y;function E(U,j){if(typeof U=="boolean")return!U;for(let ce in U)if(ce!=="$ref"&&j.all[ce])return!0;return!1}m.schemaHasRulesButRef=E;function b({topSchemaRef:U,schemaPath:j},ce,Pe,Ie){if(!Ie){if(typeof ce=="number"||typeof ce=="boolean")return ce;if(typeof ce=="string")return h._`${ce}`}return h._`${U}${j}${(0,h.getProperty)(Pe)}`}m.schemaRefOrVal=b;function C(U){return Z(decodeURIComponent(U))}m.unescapeFragment=C;function O(U){return encodeURIComponent(D(U))}m.escapeFragment=O;function D(U){if(typeof U=="number")return`${U}`;return U.replace(/~/g,"~0").replace(/\//g,"~1")}m.escapeJsonPointer=D;function Z(U){return U.replace(/~1/g,"/").replace(/~0/g,"~")}m.unescapeJsonPointer=Z;function ae(U,j){if(Array.isArray(U))for(let ce of U)j(ce);else j(U)}m.eachItem=ae;function x({mergeNames:U,mergeToName:j,mergeValues:ce,resultToName:Pe}){return(Ie,Te,je,Ae)=>{let Me=je===void 0?Te:je instanceof h.Name?(Te instanceof h.Name?U(Ie,Te,je):j(Ie,Te,je),je):Te instanceof h.Name?(j(Ie,je,Te),Te):ce(Te,je);return Ae===h.Name&&!(Me instanceof h.Name)?Pe(Ie,Me):Me}}m.mergeEvaluated={props:x({mergeNames:(U,j,ce)=>U.if(h._`${ce} !== true && ${j} !== undefined`,()=>{U.if(h._`${j} === true`,()=>U.assign(ce,!0),()=>U.assign(ce,h._`${ce} || {}`).code(h._`Object.assign(${ce}, ${j})`))}),mergeToName:(U,j,ce)=>U.if(h._`${ce} !== true`,()=>{if(j===!0)U.assign(ce,!0);else U.assign(ce,h._`${ce} || {}`),V(U,ce,j)}),mergeValues:(U,j)=>U===!0?!0:{...U,...j},resultToName:K}),items:x({mergeNames:(U,j,ce)=>U.if(h._`${ce} !== true && ${j} !== undefined`,()=>U.assign(ce,h._`${j} === true ? true : ${ce} > ${j} ? ${ce} : ${j}`)),mergeToName:(U,j,ce)=>U.if(h._`${ce} !== true`,()=>U.assign(ce,j===!0?!0:h._`${ce} > ${j} ? ${ce} : ${j}`)),mergeValues:(U,j)=>U===!0?!0:Math.max(U,j),resultToName:(U,j)=>U.var("items",j)})};function K(U,j){if(j===!0)return U.var("props",!0);let ce=U.var("props",h._`{}`);if(j!==void 0)V(U,ce,j);return ce}m.evaluatedPropsToName=K;function V(U,j,ce){Object.keys(ce).forEach((Pe)=>U.assign(h._`${j}${(0,h.getProperty)(Pe)}`,!0))}m.setEvaluated=V;let w={};function H(U,j){return U.scopeValue("func",{ref:j,code:w[j.code]||(w[j.code]=new f._Code(j.code))})}m.useFunc=H;var q;(function(U){U[U.Num=0]="Num",U[U.Str=1]="Str"})(q||(m.Type=q={}));function B(U,j,ce){if(U instanceof h.Name){let Pe=j===q.Num;return ce?Pe?h._`"[" + ${U} + "]"`:h._`"['" + ${U} + "']"`:Pe?h._`"/" + ${U}`:h._`"/" + ${U}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return ce?(0,h.getProperty)(U).toString():"/"+D(U)}m.getErrorPath=B;function ne(U,j,ce=U.opts.strictSchema){if(!ce)return;if(j=`strict mode: ${j}`,ce===!0)throw Error(j);U.self.logger.warn(j)}m.checkStrictMode=ne}),Et=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f={data:new h.Name("data"),valCxt:new h.Name("valCxt"),instancePath:new h.Name("instancePath"),parentData:new h.Name("parentData"),parentDataProperty:new h.Name("parentDataProperty"),rootData:new h.Name("rootData"),dynamicAnchors:new h.Name("dynamicAnchors"),vErrors:new h.Name("vErrors"),errors:new h.Name("errors"),this:new h.Name("this"),self:new h.Name("self"),scope:new h.Name("scope"),json:new h.Name("json"),jsonPos:new h.Name("jsonPos"),jsonLen:new h.Name("jsonLen"),jsonPart:new h.Name("jsonPart")};m.default=f}),Sn=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.extendErrors=m.resetErrorsCount=m.reportExtraError=m.reportError=m.keyword$DataError=m.keywordError=void 0;let h=Fe(),f=We(),g=Et();m.keywordError={message:({keyword:V})=>h.str`must pass "${V}" keyword validation`},m.keyword$DataError={message:({keyword:V,schemaType:w})=>w?h.str`"${V}" keyword must be ${w} ($data)`:h.str`"${V}" keyword is invalid ($data)`};function S(V,w=m.keywordError,H,q){let{it:B}=V,{gen:ne,compositeRule:U,allErrors:j}=B,ce=D(V,w,H);if(q!==null&&q!==void 0?q:U||j)b(ne,ce);else C(B,h._`[${ce}]`)}m.reportError=S;function _(V,w=m.keywordError,H){let{it:q}=V,{gen:B,compositeRule:ne,allErrors:U}=q;if(b(B,D(V,w,H)),!(ne||U))C(q,g.default.vErrors)}m.reportExtraError=_;function y(V,w){V.assign(g.default.errors,w),V.if(h._`${g.default.vErrors} !== null`,()=>V.if(w,()=>V.assign(h._`${g.default.vErrors}.length`,w),()=>V.assign(g.default.vErrors,null)))}m.resetErrorsCount=y;function E({gen:V,keyword:w,schemaValue:H,data:q,errsCount:B,it:ne}){if(B===void 0)throw Error("ajv implementation error");let U=V.name("err");V.forRange("i",B,g.default.errors,(j)=>{if(V.const(U,h._`${g.default.vErrors}[${j}]`),V.if(h._`${U}.instancePath === undefined`,()=>V.assign(h._`${U}.instancePath`,(0,h.strConcat)(g.default.instancePath,ne.errorPath))),V.assign(h._`${U}.schemaPath`,h.str`${ne.errSchemaPath}/${w}`),ne.opts.verbose)V.assign(h._`${U}.schema`,H),V.assign(h._`${U}.data`,q)})}m.extendErrors=E;function b(V,w){let H=V.const("err",w);V.if(h._`${g.default.vErrors} === null`,()=>V.assign(g.default.vErrors,h._`[${H}]`),h._`${g.default.vErrors}.push(${H})`),V.code(h._`${g.default.errors}++`)}function C(V,w){let{gen:H,validateName:q,schemaEnv:B}=V;if(B.$async)H.throw(h._`new ${V.ValidationError}(${w})`);else H.assign(h._`${q}.errors`,w),H.return(!1)}let O={keyword:new h.Name("keyword"),schemaPath:new h.Name("schemaPath"),params:new h.Name("params"),propertyName:new h.Name("propertyName"),message:new h.Name("message"),schema:new h.Name("schema"),parentSchema:new h.Name("parentSchema")};function D(V,w,H){let{createErrors:q}=V.it;if(q===!1)return h._`{}`;return Z(V,w,H)}function Z(V,w,H={}){let{gen:q,it:B}=V,ne=[ae(B,H),x(V,H)];return K(V,w,ne),q.object(...ne)}function ae({errorPath:V},{instancePath:w}){let H=w?h.str`${V}${(0,f.getErrorPath)(w,f.Type.Str)}`:V;return[g.default.instancePath,(0,h.strConcat)(g.default.instancePath,H)]}function x({keyword:V,it:{errSchemaPath:w}},{schemaPath:H,parentSchema:q}){let B=q?w:h.str`${w}/${V}`;if(H)B=h.str`${B}${(0,f.getErrorPath)(H,f.Type.Str)}`;return[O.schemaPath,B]}function K(V,{params:w,message:H},q){let{keyword:B,data:ne,schemaValue:U,it:j}=V,{opts:ce,propertyName:Pe,topSchemaRef:Ie,schemaPath:Te}=j;if(q.push([O.keyword,B],[O.params,typeof w=="function"?w(V):w||h._`{}`]),ce.messages)q.push([O.message,typeof H=="function"?H(V):H]);if(ce.verbose)q.push([O.schema,U],[O.parentSchema,h._`${Ie}${Te}`],[g.default.data,ne]);if(Pe)q.push([O.propertyName,Pe])}}),td=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.boolOrEmptySchema=m.topBoolOrEmptySchema=void 0;let h=Sn(),f=Fe(),g=Et(),S={message:"boolean schema is false"};function _(b){let{gen:C,schema:O,validateName:D}=b;if(O===!1)E(b,!1);else if(typeof O=="object"&&O.$async===!0)C.return(g.default.data);else C.assign(f._`${D}.errors`,null),C.return(!0)}m.topBoolOrEmptySchema=_;function y(b,C){let{gen:O,schema:D}=b;if(D===!1)O.var(C,!1),E(b);else O.var(C,!0)}m.boolOrEmptySchema=y;function E(b,C){let{gen:O,data:D}=b,Z={gen:O,keyword:"false schema",data:D,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:b};(0,h.reportError)(Z,S,void 0,C)}}),qc=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.getRules=m.isJSONType=void 0;let h=new Set(["string","number","integer","boolean","null","object","array"]);function f(S){return typeof S=="string"&&h.has(S)}m.isJSONType=f;function g(){let S={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...S,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},S.number,S.string,S.array,S.object],post:{rules:[]},all:{},keywords:{}}}m.getRules=g}),jc=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.shouldUseRule=m.shouldUseGroup=m.schemaHasRulesForType=void 0;function h({schema:S,self:_},y){let E=_.RULES.types[y];return E&&E!==!0&&f(S,E)}m.schemaHasRulesForType=h;function f(S,_){return _.rules.some((y)=>g(S,y))}m.shouldUseGroup=f;function g(S,_){var y;return S[_.keyword]!==void 0||((y=_.definition.implements)===null||y===void 0?void 0:y.some((E)=>S[E]!==void 0))}m.shouldUseRule=g}),gn=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.reportTypeError=m.checkDataTypes=m.checkDataType=m.coerceAndCheckDataType=m.getJSONTypes=m.getSchemaTypes=m.DataType=void 0;let h=qc(),f=jc(),g=Sn(),S=Fe(),_=We();var y;(function(q){q[q.Correct=0]="Correct",q[q.Wrong=1]="Wrong"})(y||(m.DataType=y={}));function E(q){let B=b(q.type);if(B.includes("null")){if(q.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!B.length&&q.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(q.nullable===!0)B.push("null")}return B}m.getSchemaTypes=E;function b(q){let B=Array.isArray(q)?q:q?[q]:[];if(B.every(h.isJSONType))return B;throw Error("type must be JSONType or JSONType[]: "+B.join(","))}m.getJSONTypes=b;function C(q,B){let{gen:ne,data:U,opts:j}=q,ce=D(B,j.coerceTypes),Pe=B.length>0&&!(ce.length===0&&B.length===1&&(0,f.schemaHasRulesForType)(q,B[0]));if(Pe){let Ie=K(B,U,j.strictNumbers,y.Wrong);ne.if(Ie,()=>{if(ce.length)Z(q,B,ce);else w(q)})}return Pe}m.coerceAndCheckDataType=C;let O=new Set(["string","number","integer","boolean","null"]);function D(q,B){return B?q.filter((ne)=>O.has(ne)||B==="array"&&ne==="array"):[]}function Z(q,B,ne){let{gen:U,data:j,opts:ce}=q,Pe=U.let("dataType",S._`typeof ${j}`),Ie=U.let("coerced",S._`undefined`);if(ce.coerceTypes==="array")U.if(S._`${Pe} == 'object' && Array.isArray(${j}) && ${j}.length == 1`,()=>U.assign(j,S._`${j}[0]`).assign(Pe,S._`typeof ${j}`).if(K(B,j,ce.strictNumbers),()=>U.assign(Ie,j)));U.if(S._`${Ie} !== undefined`);for(let je of ne)if(O.has(je)||je==="array"&&ce.coerceTypes==="array")Te(je);U.else(),w(q),U.endIf(),U.if(S._`${Ie} !== undefined`,()=>{U.assign(j,Ie),ae(q,Ie)});function Te(je){switch(je){case"string":U.elseIf(S._`${Pe} == "number" || ${Pe} == "boolean"`).assign(Ie,S._`"" + ${j}`).elseIf(S._`${j} === null`).assign(Ie,S._`""`);return;case"number":U.elseIf(S._`${Pe} == "boolean" || ${j} === null
|
|
9
|
-
|| (${Pe} == "string" && ${j} && ${j} == +${j})`).assign(Ie,S._`+${j}`);return;case"integer":U.elseIf(S._`${Pe} === "boolean" || ${j} === null
|
|
10
|
-
|| (${Pe} === "string" && ${j} && ${j} == +${j} && !(${j} % 1))`).assign(Ie,S._`+${j}`);return;case"boolean":U.elseIf(S._`${j} === "false" || ${j} === 0 || ${j} === null`).assign(Ie,!1).elseIf(S._`${j} === "true" || ${j} === 1`).assign(Ie,!0);return;case"null":U.elseIf(S._`${j} === "" || ${j} === 0 || ${j} === false`),U.assign(Ie,null);return;case"array":U.elseIf(S._`${Pe} === "string" || ${Pe} === "number"
|
|
11
|
-
|| ${Pe} === "boolean" || ${j} === null`).assign(Ie,S._`[${j}]`)}}}function ae({gen:q,parentData:B,parentDataProperty:ne},U){q.if(S._`${B} !== undefined`,()=>q.assign(S._`${B}[${ne}]`,U))}function x(q,B,ne,U=y.Correct){let j=U===y.Correct?S.operators.EQ:S.operators.NEQ,ce;switch(q){case"null":return S._`${B} ${j} null`;case"array":ce=S._`Array.isArray(${B})`;break;case"object":ce=S._`${B} && typeof ${B} == "object" && !Array.isArray(${B})`;break;case"integer":ce=Pe(S._`!(${B} % 1) && !isNaN(${B})`);break;case"number":ce=Pe();break;default:return S._`typeof ${B} ${j} ${q}`}return U===y.Correct?ce:(0,S.not)(ce);function Pe(Ie=S.nil){return(0,S.and)(S._`typeof ${B} == "number"`,Ie,ne?S._`isFinite(${B})`:S.nil)}}m.checkDataType=x;function K(q,B,ne,U){if(q.length===1)return x(q[0],B,ne,U);let j,ce=(0,_.toHash)(q);if(ce.array&&ce.object){let Pe=S._`typeof ${B} != "object"`;j=ce.null?Pe:S._`!${B} || ${Pe}`,delete ce.null,delete ce.array,delete ce.object}else j=S.nil;if(ce.number)delete ce.integer;for(let Pe in ce)j=(0,S.and)(j,x(Pe,B,ne,U));return j}m.checkDataTypes=K;let V={message:({schema:q})=>`must be ${q}`,params:({schema:q,schemaValue:B})=>typeof q=="string"?S._`{type: ${q}}`:S._`{type: ${B}}`};function w(q){let B=H(q);(0,g.reportError)(B,V)}m.reportTypeError=w;function H(q){let{gen:B,data:ne,schema:U}=q,j=(0,_.schemaRefOrVal)(q,U,"type");return{gen:B,keyword:"type",data:ne,schema:U.type,schemaCode:j,schemaValue:j,parentSchema:U,params:{},it:q}}}),ad=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.assignDefaults=void 0;let h=Fe(),f=We();function g(_,y){let{properties:E,items:b}=_.schema;if(y==="object"&&E)for(let C in E)S(_,C,E[C].default);else if(y==="array"&&Array.isArray(b))b.forEach((C,O)=>S(_,O,C.default))}m.assignDefaults=g;function S(_,y,E){let{gen:b,compositeRule:C,data:O,opts:D}=_;if(E===void 0)return;let Z=h._`${O}${(0,h.getProperty)(y)}`;if(C){(0,f.checkStrictMode)(_,`default is ignored for: ${Z}`);return}let ae=h._`${Z} === undefined`;if(D.useDefaults==="empty")ae=h._`${ae} || ${Z} === null || ${Z} === ""`;b.if(ae,h._`${Z} = ${(0,h.stringify)(E)}`)}}),wt=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateUnion=m.validateArray=m.usePattern=m.callValidateCode=m.schemaProperties=m.allSchemaProperties=m.noPropertyInData=m.propertyInData=m.isOwnProperty=m.hasPropFunc=m.reportMissingProp=m.checkMissingProp=m.checkReportMissingProp=void 0;let h=Fe(),f=We(),g=Et(),S=We();function _(q,B){let{gen:ne,data:U,it:j}=q;ne.if(D(ne,U,B,j.opts.ownProperties),()=>{q.setParams({missingProperty:h._`${B}`},!0),q.error()})}m.checkReportMissingProp=_;function y({gen:q,data:B,it:{opts:ne}},U,j){return(0,h.or)(...U.map((ce)=>(0,h.and)(D(q,B,ce,ne.ownProperties),h._`${j} = ${ce}`)))}m.checkMissingProp=y;function E(q,B){q.setParams({missingProperty:B},!0),q.error()}m.reportMissingProp=E;function b(q){return q.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:h._`Object.prototype.hasOwnProperty`})}m.hasPropFunc=b;function C(q,B,ne){return h._`${b(q)}.call(${B}, ${ne})`}m.isOwnProperty=C;function O(q,B,ne,U){let j=h._`${B}${(0,h.getProperty)(ne)} !== undefined`;return U?h._`${j} && ${C(q,B,ne)}`:j}m.propertyInData=O;function D(q,B,ne,U){let j=h._`${B}${(0,h.getProperty)(ne)} === undefined`;return U?(0,h.or)(j,(0,h.not)(C(q,B,ne))):j}m.noPropertyInData=D;function Z(q){return q?Object.keys(q).filter((B)=>B!=="__proto__"):[]}m.allSchemaProperties=Z;function ae(q,B){return Z(B).filter((ne)=>!(0,f.alwaysValidSchema)(q,B[ne]))}m.schemaProperties=ae;function x({schemaCode:q,data:B,it:{gen:ne,topSchemaRef:U,schemaPath:j,errorPath:ce},it:Pe},Ie,Te,je){let Ae=je?h._`${q}, ${B}, ${U}${j}`:B,Me=[[g.default.instancePath,(0,h.strConcat)(g.default.instancePath,ce)],[g.default.parentData,Pe.parentData],[g.default.parentDataProperty,Pe.parentDataProperty],[g.default.rootData,g.default.rootData]];if(Pe.opts.dynamicRef)Me.push([g.default.dynamicAnchors,g.default.dynamicAnchors]);let Ge=h._`${Ae}, ${ne.object(...Me)}`;return Te!==h.nil?h._`${Ie}.call(${Te}, ${Ge})`:h._`${Ie}(${Ge})`}m.callValidateCode=x;let K=h._`new RegExp`;function V({gen:q,it:{opts:B}},ne){let U=B.unicodeRegExp?"u":"",{regExp:j}=B.code,ce=j(ne,U);return q.scopeValue("pattern",{key:ce.toString(),ref:ce,code:h._`${j.code==="new RegExp"?K:(0,S.useFunc)(q,j)}(${ne}, ${U})`})}m.usePattern=V;function w(q){let{gen:B,data:ne,keyword:U,it:j}=q,ce=B.name("valid");if(j.allErrors){let Ie=B.let("valid",!0);return Pe(()=>B.assign(Ie,!1)),Ie}return B.var(ce,!0),Pe(()=>B.break()),ce;function Pe(Ie){let Te=B.const("len",h._`${ne}.length`);B.forRange("i",0,Te,(je)=>{q.subschema({keyword:U,dataProp:je,dataPropType:f.Type.Num},ce),B.if((0,h.not)(ce),Ie)})}}m.validateArray=w;function H(q){let{gen:B,schema:ne,keyword:U,it:j}=q;if(!Array.isArray(ne))throw Error("ajv implementation error");if(ne.some((Ie)=>(0,f.alwaysValidSchema)(j,Ie))&&!j.opts.unevaluated)return;let ce=B.let("valid",!1),Pe=B.name("_valid");B.block(()=>ne.forEach((Ie,Te)=>{let je=q.subschema({keyword:U,schemaProp:Te,compositeRule:!0},Pe);if(B.assign(ce,h._`${ce} || ${Pe}`),!q.mergeValidEvaluated(je,Pe))B.if((0,h.not)(ce))})),q.result(ce,()=>q.reset(),()=>q.error(!0))}m.validateUnion=H}),rd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateKeywordUsage=m.validSchemaType=m.funcKeywordCode=m.macroKeywordCode=void 0;let h=Fe(),f=Et(),g=wt(),S=Sn();function _(ae,x){let{gen:K,keyword:V,schema:w,parentSchema:H,it:q}=ae,B=x.macro.call(q.self,w,H,q),ne=O(K,V,B);if(q.opts.validateSchema!==!1)q.self.validateSchema(B,!0);let U=K.name("valid");ae.subschema({schema:B,schemaPath:h.nil,errSchemaPath:`${q.errSchemaPath}/${V}`,topSchemaRef:ne,compositeRule:!0},U),ae.pass(U,()=>ae.error(!0))}m.macroKeywordCode=_;function y(ae,x){var K;let{gen:V,keyword:w,schema:H,parentSchema:q,$data:B,it:ne}=ae;C(ne,x);let U=O(V,w,!B&&x.compile?x.compile.call(ne.self,H,q,ne):x.validate),j=V.let("valid");ae.block$data(j,ce),ae.ok((K=x.valid)!==null&&K!==void 0?K:j);function ce(){if(x.errors===!1){if(Te(),x.modifying)E(ae);je(()=>ae.error())}else{let Ae=x.async?Pe():Ie();if(x.modifying)E(ae);je(()=>b(ae,Ae))}}function Pe(){let Ae=V.let("ruleErrs",null);return V.try(()=>Te(h._`await `),(Me)=>V.assign(j,!1).if(h._`${Me} instanceof ${ne.ValidationError}`,()=>V.assign(Ae,h._`${Me}.errors`),()=>V.throw(Me))),Ae}function Ie(){let Ae=h._`${U}.errors`;return V.assign(Ae,null),Te(h.nil),Ae}function Te(Ae=x.async?h._`await `:h.nil){let Me=ne.opts.passContext?f.default.this:f.default.self,Ge=!(("compile"in x)&&!B||x.schema===!1);V.assign(j,h._`${Ae}${(0,g.callValidateCode)(ae,U,Me,Ge)}`,x.modifying)}function je(Ae){var Me;V.if((0,h.not)((Me=x.valid)!==null&&Me!==void 0?Me:j),Ae)}}m.funcKeywordCode=y;function E(ae){let{gen:x,data:K,it:V}=ae;x.if(V.parentData,()=>x.assign(K,h._`${V.parentData}[${V.parentDataProperty}]`))}function b(ae,x){let{gen:K}=ae;K.if(h._`Array.isArray(${x})`,()=>{K.assign(f.default.vErrors,h._`${f.default.vErrors} === null ? ${x} : ${f.default.vErrors}.concat(${x})`).assign(f.default.errors,h._`${f.default.vErrors}.length`),(0,S.extendErrors)(ae)},()=>ae.error())}function C({schemaEnv:ae},x){if(x.async&&!ae.$async)throw Error("async keyword in sync schema")}function O(ae,x,K){if(K===void 0)throw Error(`keyword "${x}" failed to compile`);return ae.scopeValue("keyword",typeof K=="function"?{ref:K}:{ref:K,code:(0,h.stringify)(K)})}function D(ae,x,K=!1){return!x.length||x.some((V)=>V==="array"?Array.isArray(ae):V==="object"?ae&&typeof ae=="object"&&!Array.isArray(ae):typeof ae==V||K&&typeof ae>"u")}m.validSchemaType=D;function Z({schema:ae,opts:x,self:K,errSchemaPath:V},w,H){if(Array.isArray(w.keyword)?!w.keyword.includes(H):w.keyword!==H)throw Error("ajv implementation error");let q=w.dependencies;if(q===null||q===void 0?void 0:q.some((B)=>!Object.prototype.hasOwnProperty.call(ae,B)))throw Error(`parent schema must have dependencies of ${H}: ${q.join(",")}`);if(w.validateSchema){if(!w.validateSchema(ae[H])){let B=`keyword "${H}" value is invalid at path "${V}": `+K.errorsText(w.validateSchema.errors);if(x.validateSchema==="log")K.logger.error(B);else throw Error(B)}}}m.validateKeywordUsage=Z}),od=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.extendSubschemaMode=m.extendSubschemaData=m.getSubschema=void 0;let h=Fe(),f=We();function g(y,{keyword:E,schemaProp:b,schema:C,schemaPath:O,errSchemaPath:D,topSchemaRef:Z}){if(E!==void 0&&C!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(E!==void 0){let ae=y.schema[E];return b===void 0?{schema:ae,schemaPath:h._`${y.schemaPath}${(0,h.getProperty)(E)}`,errSchemaPath:`${y.errSchemaPath}/${E}`}:{schema:ae[b],schemaPath:h._`${y.schemaPath}${(0,h.getProperty)(E)}${(0,h.getProperty)(b)}`,errSchemaPath:`${y.errSchemaPath}/${E}/${(0,f.escapeFragment)(b)}`}}if(C!==void 0){if(O===void 0||D===void 0||Z===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:C,schemaPath:O,topSchemaRef:Z,errSchemaPath:D}}throw Error('either "keyword" or "schema" must be passed')}m.getSubschema=g;function S(y,E,{dataProp:b,dataPropType:C,data:O,dataTypes:D,propertyName:Z}){if(O!==void 0&&b!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:ae}=E;if(b!==void 0){let{errorPath:K,dataPathArr:V,opts:w}=E;x(ae.let("data",h._`${E.data}${(0,h.getProperty)(b)}`,!0)),y.errorPath=h.str`${K}${(0,f.getErrorPath)(b,C,w.jsPropertySyntax)}`,y.parentDataProperty=h._`${b}`,y.dataPathArr=[...V,y.parentDataProperty]}if(O!==void 0){if(x(O instanceof h.Name?O:ae.let("data",O,!0)),Z!==void 0)y.propertyName=Z}if(D)y.dataTypes=D;function x(K){y.data=K,y.dataLevel=E.dataLevel+1,y.dataTypes=[],E.definedProperties=new Set,y.parentData=E.data,y.dataNames=[...E.dataNames,K]}}m.extendSubschemaData=S;function _(y,{jtdDiscriminator:E,jtdMetadata:b,compositeRule:C,createErrors:O,allErrors:D}){if(C!==void 0)y.compositeRule=C;if(O!==void 0)y.createErrors=O;if(D!==void 0)y.allErrors=D;y.jtdDiscriminator=E,y.jtdMetadata=b}m.extendSubschemaMode=_}),Nc=qe((m,h)=>{h.exports=function f(g,S){if(g===S)return!0;if(g&&S&&typeof g=="object"&&typeof S=="object"){if(g.constructor!==S.constructor)return!1;var _,y,E;if(Array.isArray(g)){if(_=g.length,_!=S.length)return!1;for(y=_;y--!==0;)if(!f(g[y],S[y]))return!1;return!0}if(g.constructor===RegExp)return g.source===S.source&&g.flags===S.flags;if(g.valueOf!==Object.prototype.valueOf)return g.valueOf()===S.valueOf();if(g.toString!==Object.prototype.toString)return g.toString()===S.toString();if(E=Object.keys(g),_=E.length,_!==Object.keys(S).length)return!1;for(y=_;y--!==0;)if(!Object.prototype.hasOwnProperty.call(S,E[y]))return!1;for(y=_;y--!==0;){var b=E[y];if(!f(g[b],S[b]))return!1}return!0}return g!==g&&S!==S}}),sd=qe((m,h)=>{var f=h.exports=function(_,y,E){if(typeof y=="function")E=y,y={};E=y.cb||E;var b=typeof E=="function"?E:E.pre||function(){},C=E.post||function(){};g(y,b,C,_,"",_)};f.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},f.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},f.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},f.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 g(_,y,E,b,C,O,D,Z,ae,x){if(b&&typeof b=="object"&&!Array.isArray(b)){y(b,C,O,D,Z,ae,x);for(var K in b){var V=b[K];if(Array.isArray(V)){if(K in f.arrayKeywords)for(var w=0;w<V.length;w++)g(_,y,E,V[w],C+"/"+K+"/"+w,O,C,K,b,w)}else if(K in f.propsKeywords){if(V&&typeof V=="object")for(var H in V)g(_,y,E,V[H],C+"/"+K+"/"+S(H),O,C,K,b,H)}else if(K in f.keywords||_.allKeys&&!(K in f.skipKeywords))g(_,y,E,V,C+"/"+K,O,C,K,b)}E(b,C,O,D,Z,ae,x)}}function S(_){return _.replace(/~/g,"~0").replace(/\//g,"~1")}}),_n=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.getSchemaRefs=m.resolveUrl=m.normalizeId=m._getFullPath=m.getFullPath=m.inlineRef=void 0;let h=We(),f=Nc(),g=sd(),S=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function _(V,w=!0){if(typeof V=="boolean")return!0;if(w===!0)return!E(V);if(!w)return!1;return b(V)<=w}m.inlineRef=_;let y=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function E(V){for(let w in V){if(y.has(w))return!0;let H=V[w];if(Array.isArray(H)&&H.some(E))return!0;if(typeof H=="object"&&E(H))return!0}return!1}function b(V){let w=0;for(let H in V){if(H==="$ref")return 1/0;if(w++,S.has(H))continue;if(typeof V[H]=="object")(0,h.eachItem)(V[H],(q)=>w+=b(q));if(w===1/0)return 1/0}return w}function C(V,w="",H){if(H!==!1)w=Z(w);return O(V,V.parse(w))}m.getFullPath=C;function O(V,w){return V.serialize(w).split("#")[0]+"#"}m._getFullPath=O;let D=/#\/?$/;function Z(V){return V?V.replace(D,""):""}m.normalizeId=Z;function ae(V,w,H){return H=Z(H),V.resolve(w,H)}m.resolveUrl=ae;let x=/^[a-z_][-a-z0-9._]*$/i;function K(V,w){if(typeof V=="boolean")return{};let{schemaId:H,uriResolver:q}=this.opts,B=Z(V[H]||w),ne={"":B},U=C(q,B,!1),j={},ce=new Set;return g(V,{allKeys:!0},(Te,je,Ae,Me)=>{if(Me===void 0)return;let Ge=U+je,Qe=ne[Me];if(typeof Te[H]=="string")Qe=Ze.call(this,Te[H]);nt.call(this,Te.$anchor),nt.call(this,Te.$dynamicAnchor),ne[je]=Qe;function Ze(Ye){let he=this.opts.uriResolver.resolve;if(Ye=Z(Qe?he(Qe,Ye):Ye),ce.has(Ye))throw Ie(Ye);ce.add(Ye);let Re=this.refs[Ye];if(typeof Re=="string")Re=this.refs[Re];if(typeof Re=="object")Pe(Te,Re.schema,Ye);else if(Ye!==Z(Ge))if(Ye[0]==="#")Pe(Te,j[Ye],Ye),j[Ye]=Te;else this.refs[Ye]=Ge;return Ye}function nt(Ye){if(typeof Ye=="string"){if(!x.test(Ye))throw Error(`invalid anchor "${Ye}"`);Ze.call(this,`#${Ye}`)}}}),j;function Pe(Te,je,Ae){if(je!==void 0&&!f(Te,je))throw Ie(Ae)}function Ie(Te){return Error(`reference "${Te}" resolves to more than one schema`)}}m.getSchemaRefs=K}),Ua=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.getData=m.KeywordCxt=m.validateFunctionCode=void 0;let h=td(),f=gn(),g=jc(),S=gn(),_=ad(),y=rd(),E=od(),b=Fe(),C=Et(),O=_n(),D=We(),Z=Sn();function ae(de){if(U(de)){if(ce(de),ne(de)){w(de);return}}x(de,()=>(0,h.topBoolOrEmptySchema)(de))}m.validateFunctionCode=ae;function x({gen:de,validateName:ze,schema:Ce,schemaEnv:De,opts:Ue},xe){if(Ue.code.es5)de.func(ze,b._`${C.default.data}, ${C.default.valCxt}`,De.$async,()=>{de.code(b._`"use strict"; ${q(Ce,Ue)}`),V(de,Ue),de.code(xe)});else de.func(ze,b._`${C.default.data}, ${K(Ue)}`,De.$async,()=>de.code(q(Ce,Ue)).code(xe))}function K(de){return b._`{${C.default.instancePath}="", ${C.default.parentData}, ${C.default.parentDataProperty}, ${C.default.rootData}=${C.default.data}${de.dynamicRef?b._`, ${C.default.dynamicAnchors}={}`:b.nil}}={}`}function V(de,ze){de.if(C.default.valCxt,()=>{if(de.var(C.default.instancePath,b._`${C.default.valCxt}.${C.default.instancePath}`),de.var(C.default.parentData,b._`${C.default.valCxt}.${C.default.parentData}`),de.var(C.default.parentDataProperty,b._`${C.default.valCxt}.${C.default.parentDataProperty}`),de.var(C.default.rootData,b._`${C.default.valCxt}.${C.default.rootData}`),ze.dynamicRef)de.var(C.default.dynamicAnchors,b._`${C.default.valCxt}.${C.default.dynamicAnchors}`)},()=>{if(de.var(C.default.instancePath,b._`""`),de.var(C.default.parentData,b._`undefined`),de.var(C.default.parentDataProperty,b._`undefined`),de.var(C.default.rootData,C.default.data),ze.dynamicRef)de.var(C.default.dynamicAnchors,b._`{}`)})}function w(de){let{schema:ze,opts:Ce,gen:De}=de;x(de,()=>{if(Ce.$comment&&ze.$comment)Me(de);if(Te(de),De.let(C.default.vErrors,null),De.let(C.default.errors,0),Ce.unevaluated)H(de);Pe(de),Ge(de)})}function H(de){let{gen:ze,validateName:Ce}=de;de.evaluated=ze.const("evaluated",b._`${Ce}.evaluated`),ze.if(b._`${de.evaluated}.dynamicProps`,()=>ze.assign(b._`${de.evaluated}.props`,b._`undefined`)),ze.if(b._`${de.evaluated}.dynamicItems`,()=>ze.assign(b._`${de.evaluated}.items`,b._`undefined`))}function q(de,ze){let Ce=typeof de=="object"&&de[ze.schemaId];return Ce&&(ze.code.source||ze.code.process)?b._`/*# sourceURL=${Ce} */`:b.nil}function B(de,ze){if(U(de)){if(ce(de),ne(de)){j(de,ze);return}}(0,h.boolOrEmptySchema)(de,ze)}function ne({schema:de,self:ze}){if(typeof de=="boolean")return!de;for(let Ce in de)if(ze.RULES.all[Ce])return!0;return!1}function U(de){return typeof de.schema!="boolean"}function j(de,ze){let{schema:Ce,gen:De,opts:Ue}=de;if(Ue.$comment&&Ce.$comment)Me(de);je(de),Ae(de);let xe=De.const("_errs",C.default.errors);Pe(de,xe),De.var(ze,b._`${xe} === ${C.default.errors}`)}function ce(de){(0,D.checkUnknownRules)(de),Ie(de)}function Pe(de,ze){if(de.opts.jtd)return Ze(de,[],!1,ze);let Ce=(0,f.getSchemaTypes)(de.schema);Ze(de,Ce,!(0,f.coerceAndCheckDataType)(de,Ce),ze)}function Ie(de){let{schema:ze,errSchemaPath:Ce,opts:De,self:Ue}=de;if(ze.$ref&&De.ignoreKeywordsWithRef&&(0,D.schemaHasRulesButRef)(ze,Ue.RULES))Ue.logger.warn(`$ref: keywords ignored in schema at path "${Ce}"`)}function Te(de){let{schema:ze,opts:Ce}=de;if(ze.default!==void 0&&Ce.useDefaults&&Ce.strictSchema)(0,D.checkStrictMode)(de,"default is ignored in the schema root")}function je(de){let ze=de.schema[de.opts.schemaId];if(ze)de.baseId=(0,O.resolveUrl)(de.opts.uriResolver,de.baseId,ze)}function Ae(de){if(de.schema.$async&&!de.schemaEnv.$async)throw Error("async schema in sync schema")}function Me({gen:de,schemaEnv:ze,schema:Ce,errSchemaPath:De,opts:Ue}){let xe=Ce.$comment;if(Ue.$comment===!0)de.code(b._`${C.default.self}.logger.log(${xe})`);else if(typeof Ue.$comment=="function"){let ot=b.str`${De}/$comment`,ct=de.scopeValue("root",{ref:ze.root});de.code(b._`${C.default.self}.opts.$comment(${xe}, ${ot}, ${ct}.schema)`)}}function Ge(de){let{gen:ze,schemaEnv:Ce,validateName:De,ValidationError:Ue,opts:xe}=de;if(Ce.$async)ze.if(b._`${C.default.errors} === 0`,()=>ze.return(C.default.data),()=>ze.throw(b._`new ${Ue}(${C.default.vErrors})`));else{if(ze.assign(b._`${De}.errors`,C.default.vErrors),xe.unevaluated)Qe(de);ze.return(b._`${C.default.errors} === 0`)}}function Qe({gen:de,evaluated:ze,props:Ce,items:De}){if(Ce instanceof b.Name)de.assign(b._`${ze}.props`,Ce);if(De instanceof b.Name)de.assign(b._`${ze}.items`,De)}function Ze(de,ze,Ce,De){let{gen:Ue,schema:xe,data:ot,allErrors:ct,opts:mt,self:it}=de,{RULES:et}=it;if(xe.$ref&&(mt.ignoreKeywordsWithRef||!(0,D.schemaHasRulesButRef)(xe,et))){Ue.block(()=>Je(de,"$ref",et.all.$ref.definition));return}if(!mt.jtd)Ye(de,ze);Ue.block(()=>{for(let lt of et.rules)Rt(lt);Rt(et.post)});function Rt(lt){if(!(0,g.shouldUseGroup)(xe,lt))return;if(lt.type){if(Ue.if((0,S.checkDataType)(lt.type,ot,mt.strictNumbers)),nt(de,lt),ze.length===1&&ze[0]===lt.type&&Ce)Ue.else(),(0,S.reportTypeError)(de);Ue.endIf()}else nt(de,lt);if(!ct)Ue.if(b._`${C.default.errors} === ${De||0}`)}}function nt(de,ze){let{gen:Ce,schema:De,opts:{useDefaults:Ue}}=de;if(Ue)(0,_.assignDefaults)(de,ze.type);Ce.block(()=>{for(let xe of ze.rules)if((0,g.shouldUseRule)(De,xe))Je(de,xe.keyword,xe.definition,ze.type)})}function Ye(de,ze){if(de.schemaEnv.meta||!de.opts.strictTypes)return;if(he(de,ze),!de.opts.allowUnionTypes)Re(de,ze);Ne(de,de.dataTypes)}function he(de,ze){if(!ze.length)return;if(!de.dataTypes.length){de.dataTypes=ze;return}ze.forEach((Ce)=>{if(!me(de.dataTypes,Ce))Oe(de,`type "${Ce}" not allowed by context "${de.dataTypes.join(",")}"`)}),pe(de,ze)}function Re(de,ze){if(ze.length>1&&!(ze.length===2&&ze.includes("null")))Oe(de,"use allowUnionTypes to allow union type keyword")}function Ne(de,ze){let Ce=de.self.RULES.all;for(let De in Ce){let Ue=Ce[De];if(typeof Ue=="object"&&(0,g.shouldUseRule)(de.schema,Ue)){let{type:xe}=Ue.definition;if(xe.length&&!xe.some((ot)=>W(ze,ot)))Oe(de,`missing type "${xe.join(",")}" for keyword "${De}"`)}}}function W(de,ze){return de.includes(ze)||ze==="number"&&de.includes("integer")}function me(de,ze){return de.includes(ze)||ze==="integer"&&de.includes("number")}function pe(de,ze){let Ce=[];for(let De of de.dataTypes)if(me(ze,De))Ce.push(De);else if(ze.includes("integer")&&De==="number")Ce.push("integer");de.dataTypes=Ce}function Oe(de,ze){let Ce=de.schemaEnv.baseId+de.errSchemaPath;ze+=` at "${Ce}" (strictTypes)`,(0,D.checkStrictMode)(de,ze,de.opts.strictTypes)}var Le=class{constructor(de,ze,Ce){if((0,y.validateKeywordUsage)(de,ze,Ce),this.gen=de.gen,this.allErrors=de.allErrors,this.keyword=Ce,this.data=de.data,this.schema=de.schema[Ce],this.$data=ze.$data&&de.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,D.schemaRefOrVal)(de,this.schema,Ce,this.$data),this.schemaType=ze.schemaType,this.parentSchema=de.schema,this.params={},this.it=de,this.def=ze,this.$data)this.schemaCode=de.gen.const("vSchema",St(this.$data,de));else if(this.schemaCode=this.schemaValue,!(0,y.validSchemaType)(this.schema,ze.schemaType,ze.allowUndefined))throw Error(`${Ce} value must be ${JSON.stringify(ze.schemaType)}`);if("code"in ze?ze.trackErrors:ze.errors!==!1)this.errsCount=de.gen.const("_errs",C.default.errors)}result(de,ze,Ce){this.failResult((0,b.not)(de),ze,Ce)}failResult(de,ze,Ce){if(this.gen.if(de),Ce)Ce();else this.error();if(ze){if(this.gen.else(),ze(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(de,ze){this.failResult((0,b.not)(de),void 0,ze)}fail(de){if(de===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(de),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(de){if(!this.$data)return this.fail(de);let{schemaCode:ze}=this;this.fail(b._`${ze} !== undefined && (${(0,b.or)(this.invalid$data(),de)})`)}error(de,ze,Ce){if(ze){this.setParams(ze),this._error(de,Ce),this.setParams({});return}this._error(de,Ce)}_error(de,ze){(de?Z.reportExtraError:Z.reportError)(this,this.def.error,ze)}$dataError(){(0,Z.reportError)(this,this.def.$dataError||Z.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,Z.resetErrorsCount)(this.gen,this.errsCount)}ok(de){if(!this.allErrors)this.gen.if(de)}setParams(de,ze){if(ze)Object.assign(this.params,de);else this.params=de}block$data(de,ze,Ce=b.nil){this.gen.block(()=>{this.check$data(de,Ce),ze()})}check$data(de=b.nil,ze=b.nil){if(!this.$data)return;let{gen:Ce,schemaCode:De,schemaType:Ue,def:xe}=this;if(Ce.if((0,b.or)(b._`${De} === undefined`,ze)),de!==b.nil)Ce.assign(de,!0);if(Ue.length||xe.validateSchema){if(Ce.elseIf(this.invalid$data()),this.$dataError(),de!==b.nil)Ce.assign(de,!1)}Ce.else()}invalid$data(){let{gen:de,schemaCode:ze,schemaType:Ce,def:De,it:Ue}=this;return(0,b.or)(xe(),ot());function xe(){if(Ce.length){if(!(ze instanceof b.Name))throw Error("ajv implementation error");let ct=Array.isArray(Ce)?Ce:[Ce];return b._`${(0,S.checkDataTypes)(ct,ze,Ue.opts.strictNumbers,S.DataType.Wrong)}`}return b.nil}function ot(){if(De.validateSchema){let ct=de.scopeValue("validate$data",{ref:De.validateSchema});return b._`!${ct}(${ze})`}return b.nil}}subschema(de,ze){let Ce=(0,E.getSubschema)(this.it,de);(0,E.extendSubschemaData)(Ce,this.it,de),(0,E.extendSubschemaMode)(Ce,de);let De={...this.it,...Ce,items:void 0,props:void 0};return B(De,ze),De}mergeEvaluated(de,ze){let{it:Ce,gen:De}=this;if(!Ce.opts.unevaluated)return;if(Ce.props!==!0&&de.props!==void 0)Ce.props=D.mergeEvaluated.props(De,de.props,Ce.props,ze);if(Ce.items!==!0&&de.items!==void 0)Ce.items=D.mergeEvaluated.items(De,de.items,Ce.items,ze)}mergeValidEvaluated(de,ze){let{it:Ce,gen:De}=this;if(Ce.opts.unevaluated&&(Ce.props!==!0||Ce.items!==!0))return De.if(ze,()=>this.mergeEvaluated(de,b.Name)),!0}};m.KeywordCxt=Le;function Je(de,ze,Ce,De){let Ue=new Le(de,Ce,ze);if("code"in Ce)Ce.code(Ue,De);else if(Ue.$data&&Ce.validate)(0,y.funcKeywordCode)(Ue,Ce);else if("macro"in Ce)(0,y.macroKeywordCode)(Ue,Ce);else if(Ce.compile||Ce.validate)(0,y.funcKeywordCode)(Ue,Ce)}let He=/^\/(?:[^~]|~0|~1)*$/,Xe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function St(de,{dataLevel:ze,dataNames:Ce,dataPathArr:De}){let Ue,xe;if(de==="")return C.default.rootData;if(de[0]==="/"){if(!He.test(de))throw Error(`Invalid JSON-pointer: ${de}`);Ue=de,xe=C.default.rootData}else{let it=Xe.exec(de);if(!it)throw Error(`Invalid JSON-pointer: ${de}`);let et=+it[1];if(Ue=it[2],Ue==="#"){if(et>=ze)throw Error(mt("property/index",et));return De[ze-et]}if(et>ze)throw Error(mt("data",et));if(xe=Ce[ze-et],!Ue)return xe}let ot=xe,ct=Ue.split("/");for(let it of ct)if(it)xe=b._`${xe}${(0,b.getProperty)((0,D.unescapeJsonPointer)(it))}`,ot=b._`${ot} && ${xe}`;return ot;function mt(it,et){return`Cannot access ${it} ${et} levels up, current level is ${ze}`}}m.getData=St}),Yr=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});var h=class extends Error{constructor(f){super("validation failed");this.errors=f,this.ajv=this.validation=!0}};m.default=h}),Ha=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=_n();var f=class extends Error{constructor(g,S,_,y){super(y||`can't resolve reference ${_} from id ${S}`);this.missingRef=(0,h.resolveUrl)(g,S,_),this.missingSchema=(0,h.normalizeId)((0,h.getFullPath)(g,this.missingRef))}};m.default=f}),yn=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.resolveSchema=m.getCompilingSchema=m.resolveRef=m.compileSchema=m.SchemaEnv=void 0;let h=Fe(),f=Yr(),g=Et(),S=_n(),_=We(),y=Ua();var E=class{constructor(w){var H;this.refs={},this.dynamicAnchors={};let q;if(typeof w.schema=="object")q=w.schema;this.schema=w.schema,this.schemaId=w.schemaId,this.root=w.root||this,this.baseId=(H=w.baseId)!==null&&H!==void 0?H:(0,S.normalizeId)(q===null||q===void 0?void 0:q[w.schemaId||"$id"]),this.schemaPath=w.schemaPath,this.localRefs=w.localRefs,this.meta=w.meta,this.$async=q===null||q===void 0?void 0:q.$async,this.refs={}}};m.SchemaEnv=E;function b(w){let H=D.call(this,w);if(H)return H;let q=(0,S.getFullPath)(this.opts.uriResolver,w.root.baseId),{es5:B,lines:ne}=this.opts.code,{ownProperties:U}=this.opts,j=new h.CodeGen(this.scope,{es5:B,lines:ne,ownProperties:U}),ce;if(w.$async)ce=j.scopeValue("Error",{ref:f.default,code:h._`require("ajv/dist/runtime/validation_error").default`});let Pe=j.scopeName("validate");w.validateName=Pe;let Ie={gen:j,allErrors:this.opts.allErrors,data:g.default.data,parentData:g.default.parentData,parentDataProperty:g.default.parentDataProperty,dataNames:[g.default.data],dataPathArr:[h.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:j.scopeValue("schema",this.opts.code.source===!0?{ref:w.schema,code:(0,h.stringify)(w.schema)}:{ref:w.schema}),validateName:Pe,ValidationError:ce,schema:w.schema,schemaEnv:w,rootId:q,baseId:w.baseId||q,schemaPath:h.nil,errSchemaPath:w.schemaPath||(this.opts.jtd?"":"#"),errorPath:h._`""`,opts:this.opts,self:this},Te;try{this._compilations.add(w),(0,y.validateFunctionCode)(Ie),j.optimize(this.opts.code.optimize);let je=j.toString();if(Te=`${j.scopeRefs(g.default.scope)}return ${je}`,this.opts.code.process)Te=this.opts.code.process(Te,w);let Ae=Function(`${g.default.self}`,`${g.default.scope}`,Te)(this,this.scope.get());if(this.scope.value(Pe,{ref:Ae}),Ae.errors=null,Ae.schema=w.schema,Ae.schemaEnv=w,w.$async)Ae.$async=!0;if(this.opts.code.source===!0)Ae.source={validateName:Pe,validateCode:je,scopeValues:j._values};if(this.opts.unevaluated){let{props:Me,items:Ge}=Ie;if(Ae.evaluated={props:Me instanceof h.Name?void 0:Me,items:Ge instanceof h.Name?void 0:Ge,dynamicProps:Me instanceof h.Name,dynamicItems:Ge instanceof h.Name},Ae.source)Ae.source.evaluated=(0,h.stringify)(Ae.evaluated)}return w.validate=Ae,w}catch(je){if(delete w.validate,delete w.validateName,Te)this.logger.error("Error compiling schema, function code:",Te);throw je}finally{this._compilations.delete(w)}}m.compileSchema=b;function C(w,H,q){var B;q=(0,S.resolveUrl)(this.opts.uriResolver,H,q);let ne=w.refs[q];if(ne)return ne;let U=ae.call(this,w,q);if(U===void 0){let j=(B=w.localRefs)===null||B===void 0?void 0:B[q],{schemaId:ce}=this.opts;if(j)U=new E({schema:j,schemaId:ce,root:w,baseId:H})}if(U===void 0)return;return w.refs[q]=O.call(this,U)}m.resolveRef=C;function O(w){if((0,S.inlineRef)(w.schema,this.opts.inlineRefs))return w.schema;return w.validate?w:b.call(this,w)}function D(w){for(let H of this._compilations)if(Z(H,w))return H}m.getCompilingSchema=D;function Z(w,H){return w.schema===H.schema&&w.root===H.root&&w.baseId===H.baseId}function ae(w,H){let q;while(typeof(q=this.refs[H])=="string")H=q;return q||this.schemas[H]||x.call(this,w,H)}function x(w,H){let q=this.opts.uriResolver.parse(H),B=(0,S._getFullPath)(this.opts.uriResolver,q),ne=(0,S.getFullPath)(this.opts.uriResolver,w.baseId,void 0);if(Object.keys(w.schema).length>0&&B===ne)return V.call(this,q,w);let U=(0,S.normalizeId)(B),j=this.refs[U]||this.schemas[U];if(typeof j=="string"){let ce=x.call(this,w,j);if(typeof(ce===null||ce===void 0?void 0:ce.schema)!=="object")return;return V.call(this,q,ce)}if(typeof(j===null||j===void 0?void 0:j.schema)!=="object")return;if(!j.validate)b.call(this,j);if(U===(0,S.normalizeId)(H)){let{schema:ce}=j,{schemaId:Pe}=this.opts,Ie=ce[Pe];if(Ie)ne=(0,S.resolveUrl)(this.opts.uriResolver,ne,Ie);return new E({schema:ce,schemaId:Pe,root:w,baseId:ne})}return V.call(this,q,j)}m.resolveSchema=x;let K=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function V(w,{baseId:H,schema:q,root:B}){var ne;if(((ne=w.fragment)===null||ne===void 0?void 0:ne[0])!=="/")return;for(let ce of w.fragment.slice(1).split("/")){if(typeof q==="boolean")return;let Pe=q[(0,_.unescapeFragment)(ce)];if(Pe===void 0)return;q=Pe;let Ie=typeof q==="object"&&q[this.opts.schemaId];if(!K.has(ce)&&Ie)H=(0,S.resolveUrl)(this.opts.uriResolver,H,Ie)}let U;if(typeof q!="boolean"&&q.$ref&&!(0,_.schemaHasRulesButRef)(q,this.RULES)){let ce=(0,S.resolveUrl)(this.opts.uriResolver,H,q.$ref);U=x.call(this,B,ce)}let{schemaId:j}=this.opts;if(U=U||new E({schema:q,schemaId:j,root:B,baseId:H}),U.schema!==U.root.schema)return U}}),nd=qe((m,h)=>{h.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}}),Ic=qe((m,h)=>{let f=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),g=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);function S(x){let K="",V=0,w=0;for(w=0;w<x.length;w++){if(V=x[w].charCodeAt(0),V===48)continue;if(!(V>=48&&V<=57||V>=65&&V<=70||V>=97&&V<=102))return"";K+=x[w];break}for(w+=1;w<x.length;w++){if(V=x[w].charCodeAt(0),!(V>=48&&V<=57||V>=65&&V<=70||V>=97&&V<=102))return"";K+=x[w]}return K}let _=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function y(x){return x.length=0,!0}function E(x,K,V){if(x.length){let w=S(x);if(w!=="")K.push(w);else return V.error=!0,!1;x.length=0}return!0}function b(x){let K=0,V={error:!1,address:"",zone:""},w=[],H=[],q=!1,B=!1,ne=E;for(let U=0;U<x.length;U++){let j=x[U];if(j==="["||j==="]")continue;if(j===":"){if(q===!0)B=!0;if(!ne(H,w,V))break;if(++K>7){V.error=!0;break}if(U>0&&x[U-1]===":")q=!0;w.push(":");continue}else if(j==="%"){if(!ne(H,w,V))break;ne=y}else{H.push(j);continue}}if(H.length)if(ne===y)V.zone=H.join("");else if(B)w.push(H.join(""));else w.push(S(H));return V.address=w.join(""),V}function C(x){if(O(x,":")<2)return{host:x,isIPV6:!1};let K=b(x);if(!K.error){let{address:V,address:w}=K;if(K.zone)V+="%"+K.zone,w+="%25"+K.zone;return{host:V,isIPV6:!0,escapedHost:w}}else return{host:x,isIPV6:!1}}function O(x,K){let V=0;for(let w=0;w<x.length;w++)if(x[w]===K)V++;return V}function D(x){let K=x,V=[],w=-1,H=0;while(H=K.length){if(H===1)if(K===".")break;else if(K==="/"){V.push("/");break}else{V.push(K);break}else if(H===2){if(K[0]==="."){if(K[1]===".")break;else if(K[1]==="/"){K=K.slice(2);continue}}else if(K[0]==="/"){if(K[1]==="."||K[1]==="/"){V.push("/");break}}}else if(H===3){if(K==="/.."){if(V.length!==0)V.pop();V.push("/");break}}if(K[0]==="."){if(K[1]==="."){if(K[2]==="/"){K=K.slice(3);continue}}else if(K[1]==="/"){K=K.slice(2);continue}}else if(K[0]==="/"){if(K[1]==="."){if(K[2]==="/"){K=K.slice(2);continue}else if(K[2]==="."){if(K[3]==="/"){if(K=K.slice(3),V.length!==0)V.pop();continue}}}}if((w=K.indexOf("/",1))===-1){V.push(K);break}else V.push(K.slice(0,w)),K=K.slice(w)}return V.join("")}function Z(x,K){let V=K!==!0?escape:unescape;if(x.scheme!==void 0)x.scheme=V(x.scheme);if(x.userinfo!==void 0)x.userinfo=V(x.userinfo);if(x.host!==void 0)x.host=V(x.host);if(x.path!==void 0)x.path=V(x.path);if(x.query!==void 0)x.query=V(x.query);if(x.fragment!==void 0)x.fragment=V(x.fragment);return x}function ae(x){let K=[];if(x.userinfo!==void 0)K.push(x.userinfo),K.push("@");if(x.host!==void 0){let V=unescape(x.host);if(!g(V)){let w=C(V);if(w.isIPV6===!0)V=`[${w.escapedHost}]`;else V=x.host}K.push(V)}if(typeof x.port==="number"||typeof x.port==="string")K.push(":"),K.push(String(x.port));return K.length?K.join(""):void 0}h.exports={nonSimpleDomain:_,recomposeAuthority:ae,normalizeComponentEncoding:Z,removeDotSegments:D,isIPv4:g,isUUID:f,normalizeIPv6:C,stringArrayToHexStripped:S}}),id=qe((m,h)=>{let{isUUID:f}=Ic(),g=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,S=["http","https","ws","wss","urn","urn:uuid"];function _(j){return S.indexOf(j)!==-1}function y(j){if(j.secure===!0)return!0;else if(j.secure===!1)return!1;else if(j.scheme)return j.scheme.length===3&&(j.scheme[0]==="w"||j.scheme[0]==="W")&&(j.scheme[1]==="s"||j.scheme[1]==="S")&&(j.scheme[2]==="s"||j.scheme[2]==="S");else return!1}function E(j){if(!j.host)j.error=j.error||"HTTP URIs must have a host.";return j}function b(j){let ce=String(j.scheme).toLowerCase()==="https";if(j.port===(ce?443:80)||j.port==="")j.port=void 0;if(!j.path)j.path="/";return j}function C(j){return j.secure=y(j),j.resourceName=(j.path||"/")+(j.query?"?"+j.query:""),j.path=void 0,j.query=void 0,j}function O(j){if(j.port===(y(j)?443:80)||j.port==="")j.port=void 0;if(typeof j.secure==="boolean")j.scheme=j.secure?"wss":"ws",j.secure=void 0;if(j.resourceName){let[ce,Pe]=j.resourceName.split("?");j.path=ce&&ce!=="/"?ce:void 0,j.query=Pe,j.resourceName=void 0}return j.fragment=void 0,j}function D(j,ce){if(!j.path)return j.error="URN can not be parsed",j;let Pe=j.path.match(g);if(Pe){let Ie=ce.scheme||j.scheme||"urn";j.nid=Pe[1].toLowerCase(),j.nss=Pe[2];let Te=U(`${Ie}:${ce.nid||j.nid}`);if(j.path=void 0,Te)j=Te.parse(j,ce)}else j.error=j.error||"URN can not be parsed.";return j}function Z(j,ce){if(j.nid===void 0)throw Error("URN without nid cannot be serialized");let Pe=ce.scheme||j.scheme||"urn",Ie=j.nid.toLowerCase(),Te=U(`${Pe}:${ce.nid||Ie}`);if(Te)j=Te.serialize(j,ce);let je=j,Ae=j.nss;return je.path=`${Ie||ce.nid}:${Ae}`,ce.skipEscape=!0,je}function ae(j,ce){let Pe=j;if(Pe.uuid=Pe.nss,Pe.nss=void 0,!ce.tolerant&&(!Pe.uuid||!f(Pe.uuid)))Pe.error=Pe.error||"UUID is not valid.";return Pe}function x(j){let ce=j;return ce.nss=(j.uuid||"").toLowerCase(),ce}let K={scheme:"http",domainHost:!0,parse:E,serialize:b},V={scheme:"https",domainHost:K.domainHost,parse:E,serialize:b},w={scheme:"ws",domainHost:!0,parse:C,serialize:O},H={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},ne={http:K,https:V,ws:w,wss:H,urn:{scheme:"urn",parse:D,serialize:Z,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:ae,serialize:x,skipNormalize:!0}};Object.setPrototypeOf(ne,null);function U(j){return j&&(ne[j]||ne[j.toLowerCase()])||void 0}h.exports={wsIsSecure:y,SCHEMES:ne,isValidSchemeName:_,getSchemeHandler:U}}),cd=qe((m,h)=>{let{normalizeIPv6:f,removeDotSegments:g,recomposeAuthority:S,normalizeComponentEncoding:_,isIPv4:y,nonSimpleDomain:E}=Ic(),{SCHEMES:b,getSchemeHandler:C}=id();function O(H,q){if(typeof H==="string")H=x(V(H,q),q);else if(typeof H==="object")H=V(x(H,q),q);return H}function D(H,q,B){let ne=B?Object.assign({scheme:"null"},B):{scheme:"null"},U=Z(V(H,ne),V(q,ne),ne,!0);return ne.skipEscape=!0,x(U,ne)}function Z(H,q,B,ne){let U={};if(!ne)H=V(x(H,B),B),q=V(x(q,B),B);if(B=B||{},!B.tolerant&&q.scheme)U.scheme=q.scheme,U.userinfo=q.userinfo,U.host=q.host,U.port=q.port,U.path=g(q.path||""),U.query=q.query;else{if(q.userinfo!==void 0||q.host!==void 0||q.port!==void 0)U.userinfo=q.userinfo,U.host=q.host,U.port=q.port,U.path=g(q.path||""),U.query=q.query;else{if(!q.path)if(U.path=H.path,q.query!==void 0)U.query=q.query;else U.query=H.query;else{if(q.path[0]==="/")U.path=g(q.path);else{if((H.userinfo!==void 0||H.host!==void 0||H.port!==void 0)&&!H.path)U.path="/"+q.path;else if(!H.path)U.path=q.path;else U.path=H.path.slice(0,H.path.lastIndexOf("/")+1)+q.path;U.path=g(U.path)}U.query=q.query}U.userinfo=H.userinfo,U.host=H.host,U.port=H.port}U.scheme=H.scheme}return U.fragment=q.fragment,U}function ae(H,q,B){if(typeof H==="string")H=unescape(H),H=x(_(V(H,B),!0),{...B,skipEscape:!0});else if(typeof H==="object")H=x(_(H,!0),{...B,skipEscape:!0});if(typeof q==="string")q=unescape(q),q=x(_(V(q,B),!0),{...B,skipEscape:!0});else if(typeof q==="object")q=x(_(q,!0),{...B,skipEscape:!0});return H.toLowerCase()===q.toLowerCase()}function x(H,q){let B={host:H.host,scheme:H.scheme,userinfo:H.userinfo,port:H.port,path:H.path,query:H.query,nid:H.nid,nss:H.nss,uuid:H.uuid,fragment:H.fragment,reference:H.reference,resourceName:H.resourceName,secure:H.secure,error:""},ne=Object.assign({},q),U=[],j=C(ne.scheme||B.scheme);if(j&&j.serialize)j.serialize(B,ne);if(B.path!==void 0)if(!ne.skipEscape){if(B.path=escape(B.path),B.scheme!==void 0)B.path=B.path.split("%3A").join(":")}else B.path=unescape(B.path);if(ne.reference!=="suffix"&&B.scheme)U.push(B.scheme,":");let ce=S(B);if(ce!==void 0){if(ne.reference!=="suffix")U.push("//");if(U.push(ce),B.path&&B.path[0]!=="/")U.push("/")}if(B.path!==void 0){let Pe=B.path;if(!ne.absolutePath&&(!j||!j.absolutePath))Pe=g(Pe);if(ce===void 0&&Pe[0]==="/"&&Pe[1]==="/")Pe="/%2F"+Pe.slice(2);U.push(Pe)}if(B.query!==void 0)U.push("?",B.query);if(B.fragment!==void 0)U.push("#",B.fragment);return U.join("")}let K=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function V(H,q){let B=Object.assign({},q),ne={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},U=!1;if(B.reference==="suffix")if(B.scheme)H=B.scheme+":"+H;else H="//"+H;let j=H.match(K);if(j){if(ne.scheme=j[1],ne.userinfo=j[3],ne.host=j[4],ne.port=parseInt(j[5],10),ne.path=j[6]||"",ne.query=j[7],ne.fragment=j[8],isNaN(ne.port))ne.port=j[5];if(ne.host)if(y(ne.host)===!1){let Pe=f(ne.host);ne.host=Pe.host.toLowerCase(),U=Pe.isIPV6}else U=!0;if(ne.scheme===void 0&&ne.userinfo===void 0&&ne.host===void 0&&ne.port===void 0&&ne.query===void 0&&!ne.path)ne.reference="same-document";else if(ne.scheme===void 0)ne.reference="relative";else if(ne.fragment===void 0)ne.reference="absolute";else ne.reference="uri";if(B.reference&&B.reference!=="suffix"&&B.reference!==ne.reference)ne.error=ne.error||"URI is not a "+B.reference+" reference.";let ce=C(B.scheme||ne.scheme);if(!B.unicodeSupport&&(!ce||!ce.unicodeSupport)){if(ne.host&&(B.domainHost||ce&&ce.domainHost)&&U===!1&&E(ne.host))try{ne.host=URL.domainToASCII(ne.host.toLowerCase())}catch(Pe){ne.error=ne.error||"Host's domain name can not be converted to ASCII: "+Pe}}if(!ce||ce&&!ce.skipNormalize){if(H.indexOf("%")!==-1){if(ne.scheme!==void 0)ne.scheme=unescape(ne.scheme);if(ne.host!==void 0)ne.host=unescape(ne.host)}if(ne.path)ne.path=escape(unescape(ne.path));if(ne.fragment)ne.fragment=encodeURI(decodeURIComponent(ne.fragment))}if(ce&&ce.parse)ce.parse(ne,B)}else ne.error=ne.error||"URI can not be parsed.";return ne}let w={SCHEMES:b,normalize:O,resolve:D,resolveComponent:Z,equal:ae,serialize:x,parse:V};h.exports=w,h.exports.default=w,h.exports.fastUri=w}),ld=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=cd();h.code='require("ajv/dist/runtime/uri").default',m.default=h}),$i=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.CodeGen=m.Name=m.nil=m.stringify=m.str=m._=m.KeywordCxt=void 0;var h=Ua();Object.defineProperty(m,"KeywordCxt",{enumerable:!0,get:function(){return h.KeywordCxt}});var f=Fe();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(m,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});let g=Yr(),S=Ha(),_=qc(),y=yn(),E=Fe(),b=_n(),C=gn(),O=We(),D=nd(),Z=ld(),ae=(he,Re)=>new RegExp(he,Re);ae.code="new RegExp";let x=["removeAdditional","useDefaults","coerceTypes"],K=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),V={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."},w={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},H=200;function q(he){var Re,Ne,W,me,pe,Oe,Le,Je,He,Xe,St,de,ze,Ce,De,Ue,xe,ot,ct,mt,it,et,Rt,lt,Tt;let $t=he.strict,Ct=(Re=he.code)===null||Re===void 0?void 0:Re.optimize,It=Ct===!0||Ct===void 0?1:Ct||0,Ot=(W=(Ne=he.code)===null||Ne===void 0?void 0:Ne.regExp)!==null&&W!==void 0?W:ae,Zt=(me=he.uriResolver)!==null&&me!==void 0?me:Z.default;return{strictSchema:(Oe=(pe=he.strictSchema)!==null&&pe!==void 0?pe:$t)!==null&&Oe!==void 0?Oe:!0,strictNumbers:(Je=(Le=he.strictNumbers)!==null&&Le!==void 0?Le:$t)!==null&&Je!==void 0?Je:!0,strictTypes:(Xe=(He=he.strictTypes)!==null&&He!==void 0?He:$t)!==null&&Xe!==void 0?Xe:"log",strictTuples:(de=(St=he.strictTuples)!==null&&St!==void 0?St:$t)!==null&&de!==void 0?de:"log",strictRequired:(Ce=(ze=he.strictRequired)!==null&&ze!==void 0?ze:$t)!==null&&Ce!==void 0?Ce:!1,code:he.code?{...he.code,optimize:It,regExp:Ot}:{optimize:It,regExp:Ot},loopRequired:(De=he.loopRequired)!==null&&De!==void 0?De:H,loopEnum:(Ue=he.loopEnum)!==null&&Ue!==void 0?Ue:H,meta:(xe=he.meta)!==null&&xe!==void 0?xe:!0,messages:(ot=he.messages)!==null&&ot!==void 0?ot:!0,inlineRefs:(ct=he.inlineRefs)!==null&&ct!==void 0?ct:!0,schemaId:(mt=he.schemaId)!==null&&mt!==void 0?mt:"$id",addUsedSchema:(it=he.addUsedSchema)!==null&&it!==void 0?it:!0,validateSchema:(et=he.validateSchema)!==null&&et!==void 0?et:!0,validateFormats:(Rt=he.validateFormats)!==null&&Rt!==void 0?Rt:!0,unicodeRegExp:(lt=he.unicodeRegExp)!==null&<!==void 0?lt:!0,int32range:(Tt=he.int32range)!==null&&Tt!==void 0?Tt:!0,uriResolver:Zt}}var B=class{constructor(he={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,he=this.opts={...he,...q(he)};let{es5:Re,lines:Ne}=this.opts.code;this.scope=new E.ValueScope({scope:{},prefixes:K,es5:Re,lines:Ne}),this.logger=je(he.logger);let W=he.validateFormats;if(he.validateFormats=!1,this.RULES=(0,_.getRules)(),ne.call(this,V,he,"NOT SUPPORTED"),ne.call(this,w,he,"DEPRECATED","warn"),this._metaOpts=Ie.call(this),he.formats)ce.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),he.keywords)Pe.call(this,he.keywords);if(typeof he.meta=="object")this.addMetaSchema(he.meta);j.call(this),he.validateFormats=W}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:he,meta:Re,schemaId:Ne}=this.opts,W=D;if(Ne==="id")W={...D},W.id=W.$id,delete W.$id;if(Re&&he)this.addMetaSchema(W,W[Ne],!1)}defaultMeta(){let{meta:he,schemaId:Re}=this.opts;return this.opts.defaultMeta=typeof he=="object"?he[Re]||he:void 0}validate(he,Re){let Ne;if(typeof he=="string"){if(Ne=this.getSchema(he),!Ne)throw Error(`no schema with key or ref "${he}"`)}else Ne=this.compile(he);let W=Ne(Re);if(!("$async"in Ne))this.errors=Ne.errors;return W}compile(he,Re){let Ne=this._addSchema(he,Re);return Ne.validate||this._compileSchemaEnv(Ne)}compileAsync(he,Re){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:Ne}=this.opts;return W.call(this,he,Re);async function W(He,Xe){await me.call(this,He.$schema);let St=this._addSchema(He,Xe);return St.validate||pe.call(this,St)}async function me(He){if(He&&!this.getSchema(He))await W.call(this,{$ref:He},!0)}async function pe(He){try{return this._compileSchemaEnv(He)}catch(Xe){if(!(Xe instanceof S.default))throw Xe;return Oe.call(this,Xe),await Le.call(this,Xe.missingSchema),pe.call(this,He)}}function Oe({missingSchema:He,missingRef:Xe}){if(this.refs[He])throw Error(`AnySchema ${He} is loaded but ${Xe} cannot be resolved`)}async function Le(He){let Xe=await Je.call(this,He);if(!this.refs[He])await me.call(this,Xe.$schema);if(!this.refs[He])this.addSchema(Xe,He,Re)}async function Je(He){let Xe=this._loading[He];if(Xe)return Xe;try{return await(this._loading[He]=Ne(He))}finally{delete this._loading[He]}}}addSchema(he,Re,Ne,W=this.opts.validateSchema){if(Array.isArray(he)){for(let pe of he)this.addSchema(pe,void 0,Ne,W);return this}let me;if(typeof he==="object"){let{schemaId:pe}=this.opts;if(me=he[pe],me!==void 0&&typeof me!="string")throw Error(`schema ${pe} must be string`)}return Re=(0,b.normalizeId)(Re||me),this._checkUnique(Re),this.schemas[Re]=this._addSchema(he,Ne,Re,W,!0),this}addMetaSchema(he,Re,Ne=this.opts.validateSchema){return this.addSchema(he,Re,!0,Ne),this}validateSchema(he,Re){if(typeof he=="boolean")return!0;let Ne;if(Ne=he.$schema,Ne!==void 0&&typeof Ne!="string")throw Error("$schema must be a string");if(Ne=Ne||this.opts.defaultMeta||this.defaultMeta(),!Ne)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let W=this.validate(Ne,he);if(!W&&Re){let me="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(me);else throw Error(me)}return W}getSchema(he){let Re;while(typeof(Re=U.call(this,he))=="string")he=Re;if(Re===void 0){let{schemaId:Ne}=this.opts,W=new y.SchemaEnv({schema:{},schemaId:Ne});if(Re=y.resolveSchema.call(this,W,he),!Re)return;this.refs[he]=Re}return Re.validate||this._compileSchemaEnv(Re)}removeSchema(he){if(he instanceof RegExp)return this._removeAllSchemas(this.schemas,he),this._removeAllSchemas(this.refs,he),this;switch(typeof he){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let Re=U.call(this,he);if(typeof Re=="object")this._cache.delete(Re.schema);return delete this.schemas[he],delete this.refs[he],this}case"object":{let Re=he;this._cache.delete(Re);let Ne=he[this.opts.schemaId];if(Ne)Ne=(0,b.normalizeId)(Ne),delete this.schemas[Ne],delete this.refs[Ne];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(he){for(let Re of he)this.addKeyword(Re);return this}addKeyword(he,Re){let Ne;if(typeof he=="string"){if(Ne=he,typeof Re=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),Re.keyword=Ne}else if(typeof he=="object"&&Re===void 0){if(Re=he,Ne=Re.keyword,Array.isArray(Ne)&&!Ne.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(Me.call(this,Ne,Re),!Re)return(0,O.eachItem)(Ne,(me)=>Ge.call(this,me)),this;Ze.call(this,Re);let W={...Re,type:(0,C.getJSONTypes)(Re.type),schemaType:(0,C.getJSONTypes)(Re.schemaType)};return(0,O.eachItem)(Ne,W.type.length===0?(me)=>Ge.call(this,me,W):(me)=>W.type.forEach((pe)=>Ge.call(this,me,W,pe))),this}getKeyword(he){let Re=this.RULES.all[he];return typeof Re=="object"?Re.definition:!!Re}removeKeyword(he){let{RULES:Re}=this;delete Re.keywords[he],delete Re.all[he];for(let Ne of Re.rules){let W=Ne.rules.findIndex((me)=>me.keyword===he);if(W>=0)Ne.rules.splice(W,1)}return this}addFormat(he,Re){if(typeof Re=="string")Re=new RegExp(Re);return this.formats[he]=Re,this}errorsText(he=this.errors,{separator:Re=", ",dataVar:Ne="data"}={}){if(!he||he.length===0)return"No errors";return he.map((W)=>`${Ne}${W.instancePath} ${W.message}`).reduce((W,me)=>W+Re+me)}$dataMetaSchema(he,Re){let Ne=this.RULES.all;he=JSON.parse(JSON.stringify(he));for(let W of Re){let me=W.split("/").slice(1),pe=he;for(let Oe of me)pe=pe[Oe];for(let Oe in Ne){let Le=Ne[Oe];if(typeof Le!="object")continue;let{$data:Je}=Le.definition,He=pe[Oe];if(Je&&He)pe[Oe]=Ye(He)}}return he}_removeAllSchemas(he,Re){for(let Ne in he){let W=he[Ne];if(!Re||Re.test(Ne)){if(typeof W=="string")delete he[Ne];else if(W&&!W.meta)this._cache.delete(W.schema),delete he[Ne]}}}_addSchema(he,Re,Ne,W=this.opts.validateSchema,me=this.opts.addUsedSchema){let pe,{schemaId:Oe}=this.opts;if(typeof he=="object")pe=he[Oe];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof he!="boolean")throw Error("schema must be object or boolean");let Le=this._cache.get(he);if(Le!==void 0)return Le;Ne=(0,b.normalizeId)(pe||Ne);let Je=b.getSchemaRefs.call(this,he,Ne);if(Le=new y.SchemaEnv({schema:he,schemaId:Oe,meta:Re,baseId:Ne,localRefs:Je}),this._cache.set(Le.schema,Le),me&&!Ne.startsWith("#")){if(Ne)this._checkUnique(Ne);this.refs[Ne]=Le}if(W)this.validateSchema(he,!0);return Le}_checkUnique(he){if(this.schemas[he]||this.refs[he])throw Error(`schema with key or id "${he}" already exists`)}_compileSchemaEnv(he){if(he.meta)this._compileMetaSchema(he);else y.compileSchema.call(this,he);if(!he.validate)throw Error("ajv implementation error");return he.validate}_compileMetaSchema(he){let Re=this.opts;this.opts=this._metaOpts;try{y.compileSchema.call(this,he)}finally{this.opts=Re}}};B.ValidationError=g.default,B.MissingRefError=S.default,m.default=B;function ne(he,Re,Ne,W="error"){for(let me in he){let pe=me;if(pe in Re)this.logger[W](`${Ne}: option ${me}. ${he[pe]}`)}}function U(he){return he=(0,b.normalizeId)(he),this.schemas[he]||this.refs[he]}function j(){let he=this.opts.schemas;if(!he)return;if(Array.isArray(he))this.addSchema(he);else for(let Re in he)this.addSchema(he[Re],Re)}function ce(){for(let he in this.opts.formats){let Re=this.opts.formats[he];if(Re)this.addFormat(he,Re)}}function Pe(he){if(Array.isArray(he)){this.addVocabulary(he);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let Re in he){let Ne=he[Re];if(!Ne.keyword)Ne.keyword=Re;this.addKeyword(Ne)}}function Ie(){let he={...this.opts};for(let Re of x)delete he[Re];return he}let Te={log(){},warn(){},error(){}};function je(he){if(he===!1)return Te;if(he===void 0)return console;if(he.log&&he.warn&&he.error)return he;throw Error("logger must implement log, warn and error methods")}let Ae=/^[a-z_$][a-z0-9_$:-]*$/i;function Me(he,Re){let{RULES:Ne}=this;if((0,O.eachItem)(he,(W)=>{if(Ne.keywords[W])throw Error(`Keyword ${W} is already defined`);if(!Ae.test(W))throw Error(`Keyword ${W} has invalid name`)}),!Re)return;if(Re.$data&&!(("code"in Re)||("validate"in Re)))throw Error('$data keyword must have "code" or "validate" function')}function Ge(he,Re,Ne){var W;let me=Re===null||Re===void 0?void 0:Re.post;if(Ne&&me)throw Error('keyword with "post" flag cannot have "type"');let{RULES:pe}=this,Oe=me?pe.post:pe.rules.find(({type:Je})=>Je===Ne);if(!Oe)Oe={type:Ne,rules:[]},pe.rules.push(Oe);if(pe.keywords[he]=!0,!Re)return;let Le={keyword:he,definition:{...Re,type:(0,C.getJSONTypes)(Re.type),schemaType:(0,C.getJSONTypes)(Re.schemaType)}};if(Re.before)Qe.call(this,Oe,Le,Re.before);else Oe.rules.push(Le);pe.all[he]=Le,(W=Re.implements)===null||W===void 0||W.forEach((Je)=>this.addKeyword(Je))}function Qe(he,Re,Ne){let W=he.rules.findIndex((me)=>me.keyword===Ne);if(W>=0)he.rules.splice(W,0,Re);else he.rules.push(Re),this.logger.warn(`rule ${Ne} is not defined`)}function Ze(he){let{metaSchema:Re}=he;if(Re===void 0)return;if(he.$data&&this.opts.$data)Re=Ye(Re);he.validateSchema=this.compile(Re,!0)}let nt={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Ye(he){return{anyOf:[he,nt]}}});var ud=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};m.default=h}),Pi=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.callRef=m.getValidate=void 0;let h=Ha(),f=wt(),g=Fe(),S=Et(),_=yn(),y=We(),E={keyword:"$ref",schemaType:"string",code(O){let{gen:D,schema:Z,it:ae}=O,{baseId:x,schemaEnv:K,validateName:V,opts:w,self:H}=ae,{root:q}=K;if((Z==="#"||Z==="#/")&&x===q.baseId)return ne();let B=_.resolveRef.call(H,q,x,Z);if(B===void 0)throw new h.default(ae.opts.uriResolver,x,Z);if(B instanceof _.SchemaEnv)return U(B);return j(B);function ne(){if(K===q)return C(O,V,K,K.$async);let ce=D.scopeValue("root",{ref:q});return C(O,g._`${ce}.validate`,q,q.$async)}function U(ce){C(O,b(O,ce),ce,ce.$async)}function j(ce){let Pe=D.scopeValue("schema",w.code.source===!0?{ref:ce,code:(0,g.stringify)(ce)}:{ref:ce}),Ie=D.name("valid"),Te=O.subschema({schema:ce,dataTypes:[],schemaPath:g.nil,topSchemaRef:Pe,errSchemaPath:Z},Ie);O.mergeEvaluated(Te),O.ok(Ie)}}};function b(O,D){let{gen:Z}=O;return D.validate?Z.scopeValue("validate",{ref:D.validate}):g._`${Z.scopeValue("wrapper",{ref:D})}.validate`}m.getValidate=b;function C(O,D,Z,ae){let{gen:x,it:K}=O,{allErrors:V,schemaEnv:w,opts:H}=K,q=H.passContext?S.default.this:g.nil;if(ae)B();else ne();function B(){if(!w.$async)throw Error("async schema referenced by sync schema");let ce=x.let("valid");x.try(()=>{if(x.code(g._`await ${(0,f.callValidateCode)(O,D,q)}`),j(D),!V)x.assign(ce,!0)},(Pe)=>{if(x.if(g._`!(${Pe} instanceof ${K.ValidationError})`,()=>x.throw(Pe)),U(Pe),!V)x.assign(ce,!1)}),O.ok(ce)}function ne(){O.result((0,f.callValidateCode)(O,D,q),()=>j(D),()=>U(D))}function U(ce){let Pe=g._`${ce}.errors`;x.assign(S.default.vErrors,g._`${S.default.vErrors} === null ? ${Pe} : ${S.default.vErrors}.concat(${Pe})`),x.assign(S.default.errors,g._`${S.default.vErrors}.length`)}function j(ce){var Pe;if(!K.opts.unevaluated)return;let Ie=(Pe=Z===null||Z===void 0?void 0:Z.validate)===null||Pe===void 0?void 0:Pe.evaluated;if(K.props!==!0)if(Ie&&!Ie.dynamicProps){if(Ie.props!==void 0)K.props=y.mergeEvaluated.props(x,Ie.props,K.props)}else{let Te=x.var("props",g._`${ce}.evaluated.props`);K.props=y.mergeEvaluated.props(x,Te,K.props,g.Name)}if(K.items!==!0)if(Ie&&!Ie.dynamicItems){if(Ie.items!==void 0)K.items=y.mergeEvaluated.items(x,Ie.items,K.items)}else{let Te=x.var("items",g._`${ce}.evaluated.items`);K.items=y.mergeEvaluated.items(x,Te,K.items,g.Name)}}}m.callRef=C,m.default=E}),Oc=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=ud(),f=Pi(),g=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",h.default,f.default];m.default=g}),dd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=h.operators,g={maximum:{okStr:"<=",ok:f.LTE,fail:f.GT},minimum:{okStr:">=",ok:f.GTE,fail:f.LT},exclusiveMaximum:{okStr:"<",ok:f.LT,fail:f.GTE},exclusiveMinimum:{okStr:">",ok:f.GT,fail:f.LTE}},S={keyword:Object.keys(g),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:_,schemaCode:y})=>h.str`must be ${g[_].okStr} ${y}`,params:({keyword:_,schemaCode:y})=>h._`{comparison: ${g[_].okStr}, limit: ${y}}`},code(_){let{keyword:y,data:E,schemaCode:b}=_;_.fail$data(h._`${E} ${g[y].fail} ${b} || isNaN(${E})`)}};m.default=S}),md=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:g})=>h.str`must be multiple of ${g}`,params:({schemaCode:g})=>h._`{multipleOf: ${g}}`},code(g){let{gen:S,data:_,schemaCode:y,it:E}=g,b=E.opts.multipleOfPrecision,C=S.let("res"),O=b?h._`Math.abs(Math.round(${C}) - ${C}) > 1e-${b}`:h._`${C} !== parseInt(${C})`;g.fail$data(h._`(${y} === 0 || (${C} = ${_}/${y}, ${O}))`)}};m.default=f}),hd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});function h(f){let g=f.length,S=0,_=0,y;while(_<g)if(S++,y=f.charCodeAt(_++),y>=55296&&y<=56319&&_<g){if(y=f.charCodeAt(_),(y&64512)===56320)_++}return S}m.default=h,h.code='require("ajv/dist/runtime/ucs2length").default'}),pd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g=hd(),S={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:_,schemaCode:y}){let E=_==="maxLength"?"more":"fewer";return h.str`must NOT have ${E} than ${y} characters`},params:({schemaCode:_})=>h._`{limit: ${_}}`},code(_){let{keyword:y,data:E,schemaCode:b,it:C}=_,O=y==="maxLength"?h.operators.GT:h.operators.LT,D=C.opts.unicode===!1?h._`${E}.length`:h._`${(0,f.useFunc)(_.gen,g.default)}(${E})`;_.fail$data(h._`${D} ${O} ${b}`)}};m.default=S}),fd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wt(),f=We(),g=Fe(),S={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:_})=>g.str`must match pattern "${_}"`,params:({schemaCode:_})=>g._`{pattern: ${_}}`},code(_){let{gen:y,data:E,$data:b,schema:C,schemaCode:O,it:D}=_,Z=D.opts.unicodeRegExp?"u":"";if(b){let{regExp:ae}=D.opts.code,x=ae.code==="new RegExp"?g._`new RegExp`:(0,f.useFunc)(y,ae),K=y.let("valid");y.try(()=>y.assign(K,g._`${x}(${O}, ${Z}).test(${E})`),()=>y.assign(K,!1)),_.fail$data(g._`!${K}`)}else{let ae=(0,h.usePattern)(_,C);_.fail$data(g._`!${ae}.test(${E})`)}}};m.default=S}),gd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:g,schemaCode:S}){let _=g==="maxProperties"?"more":"fewer";return h.str`must NOT have ${_} than ${S} properties`},params:({schemaCode:g})=>h._`{limit: ${g}}`},code(g){let{keyword:S,data:_,schemaCode:y}=g,E=S==="maxProperties"?h.operators.GT:h.operators.LT;g.fail$data(h._`Object.keys(${_}).length ${E} ${y}`)}};m.default=f}),Sd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wt(),f=Fe(),g=We(),S={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:_}})=>f.str`must have required property '${_}'`,params:({params:{missingProperty:_}})=>f._`{missingProperty: ${_}}`},code(_){let{gen:y,schema:E,schemaCode:b,data:C,$data:O,it:D}=_,{opts:Z}=D;if(!O&&E.length===0)return;let ae=E.length>=Z.loopRequired;if(D.allErrors)x();else K();if(Z.strictRequired){let H=_.parentSchema.properties,{definedProperties:q}=_.it;for(let B of E)if((H===null||H===void 0?void 0:H[B])===void 0&&!q.has(B)){let ne=`required property "${B}" is not defined at "${D.schemaEnv.baseId+D.errSchemaPath}" (strictRequired)`;(0,g.checkStrictMode)(D,ne,D.opts.strictRequired)}}function x(){if(ae||O)_.block$data(f.nil,V);else for(let H of E)(0,h.checkReportMissingProp)(_,H)}function K(){let H=y.let("missing");if(ae||O){let q=y.let("valid",!0);_.block$data(q,()=>w(H,q)),_.ok(q)}else y.if((0,h.checkMissingProp)(_,E,H)),(0,h.reportMissingProp)(_,H),y.else()}function V(){y.forOf("prop",b,(H)=>{_.setParams({missingProperty:H}),y.if((0,h.noPropertyInData)(y,C,H,Z.ownProperties),()=>_.error())})}function w(H,q){_.setParams({missingProperty:H}),y.forOf(H,b,()=>{y.assign(q,(0,h.propertyInData)(y,C,H,Z.ownProperties)),y.if((0,f.not)(q),()=>{_.error(),y.break()})},f.nil)}}};m.default=S}),_d=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:g,schemaCode:S}){let _=g==="maxItems"?"more":"fewer";return h.str`must NOT have ${_} than ${S} items`},params:({schemaCode:g})=>h._`{limit: ${g}}`},code(g){let{keyword:S,data:_,schemaCode:y}=g,E=S==="maxItems"?h.operators.GT:h.operators.LT;g.fail$data(h._`${_}.length ${E} ${y}`)}};m.default=f}),Ei=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Nc();h.code='require("ajv/dist/runtime/equal").default',m.default=h}),yd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=gn(),f=Fe(),g=We(),S=Ei(),_={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:y,j:E}})=>f.str`must NOT have duplicate items (items ## ${E} and ${y} are identical)`,params:({params:{i:y,j:E}})=>f._`{i: ${y}, j: ${E}}`},code(y){let{gen:E,data:b,$data:C,schema:O,parentSchema:D,schemaCode:Z,it:ae}=y;if(!C&&!O)return;let x=E.let("valid"),K=D.items?(0,h.getSchemaTypes)(D.items):[];y.block$data(x,V,f._`${Z} === false`),y.ok(x);function V(){let B=E.let("i",f._`${b}.length`),ne=E.let("j");y.setParams({i:B,j:ne}),E.assign(x,!0),E.if(f._`${B} > 1`,()=>(w()?H:q)(B,ne))}function w(){return K.length>0&&!K.some((B)=>B==="object"||B==="array")}function H(B,ne){let U=E.name("item"),j=(0,h.checkDataTypes)(K,U,ae.opts.strictNumbers,h.DataType.Wrong),ce=E.const("indices",f._`{}`);E.for(f._`;${B}--;`,()=>{if(E.let(U,f._`${b}[${B}]`),E.if(j,f._`continue`),K.length>1)E.if(f._`typeof ${U} == "string"`,f._`${U} += "_"`);E.if(f._`typeof ${ce}[${U}] == "number"`,()=>{E.assign(ne,f._`${ce}[${U}]`),y.error(),E.assign(x,!1).break()}).code(f._`${ce}[${U}] = ${B}`)})}function q(B,ne){let U=(0,g.useFunc)(E,S.default),j=E.name("outer");E.label(j).for(f._`;${B}--;`,()=>E.for(f._`${ne} = ${B}; ${ne}--;`,()=>E.if(f._`${U}(${b}[${B}], ${b}[${ne}])`,()=>{y.error(),E.assign(x,!1).break(j)})))}}};m.default=_}),vd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g=Ei(),S={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:_})=>h._`{allowedValue: ${_}}`},code(_){let{gen:y,data:E,$data:b,schemaCode:C,schema:O}=_;if(b||O&&typeof O=="object")_.fail$data(h._`!${(0,f.useFunc)(y,g.default)}(${E}, ${C})`);else _.fail(h._`${O} !== ${E}`)}};m.default=S}),bd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g=Ei(),S={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:_})=>h._`{allowedValues: ${_}}`},code(_){let{gen:y,data:E,$data:b,schema:C,schemaCode:O,it:D}=_;if(!b&&C.length===0)throw Error("enum must have non-empty array");let Z=C.length>=D.opts.loopEnum,ae,x=()=>ae!==null&&ae!==void 0?ae:ae=(0,f.useFunc)(y,g.default),K;if(Z||b)K=y.let("valid"),_.block$data(K,V);else{if(!Array.isArray(C))throw Error("ajv implementation error");let H=y.const("vSchema",O);K=(0,h.or)(...C.map((q,B)=>w(H,B)))}_.pass(K);function V(){y.assign(K,!1),y.forOf("v",O,(H)=>y.if(h._`${x()}(${E}, ${H})`,()=>y.assign(K,!0).break()))}function w(H,q){let B=C[q];return typeof B==="object"&&B!==null?h._`${x()}(${E}, ${H}[${q}])`:h._`${E} === ${B}`}}};m.default=S}),kc=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=dd(),f=md(),g=pd(),S=fd(),_=gd(),y=Sd(),E=_d(),b=yd(),C=vd(),O=bd(),D=[h.default,f.default,g.default,S.default,_.default,y.default,E.default,b.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},C.default,O.default];m.default=D}),Mc=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateAdditionalItems=void 0;let h=Fe(),f=We(),g={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:_}})=>h.str`must NOT have more than ${_} items`,params:({params:{len:_}})=>h._`{limit: ${_}}`},code(_){let{parentSchema:y,it:E}=_,{items:b}=y;if(!Array.isArray(b)){(0,f.checkStrictMode)(E,'"additionalItems" is ignored when "items" is not an array of schemas');return}S(_,b)}};function S(_,y){let{gen:E,schema:b,data:C,keyword:O,it:D}=_;D.items=!0;let Z=E.const("len",h._`${C}.length`);if(b===!1)_.setParams({len:y.length}),_.pass(h._`${Z} <= ${y.length}`);else if(typeof b=="object"&&!(0,f.alwaysValidSchema)(D,b)){let x=E.var("valid",h._`${Z} <= ${y.length}`);E.if((0,h.not)(x),()=>ae(x)),_.ok(x)}function ae(x){E.forRange("i",y.length,Z,(K)=>{if(_.subschema({keyword:O,dataProp:K,dataPropType:f.Type.Num},x),!D.allErrors)E.if((0,h.not)(x),()=>E.break())})}}m.validateAdditionalItems=S,m.default=g}),Ac=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateTuple=void 0;let h=Fe(),f=We(),g=wt(),S={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(y){let{schema:E,it:b}=y;if(Array.isArray(E))return _(y,"additionalItems",E);if(b.items=!0,(0,f.alwaysValidSchema)(b,E))return;y.ok((0,g.validateArray)(y))}};function _(y,E,b=y.schema){let{gen:C,parentSchema:O,data:D,keyword:Z,it:ae}=y;if(V(O),ae.opts.unevaluated&&b.length&&ae.items!==!0)ae.items=f.mergeEvaluated.items(C,b.length,ae.items);let x=C.name("valid"),K=C.const("len",h._`${D}.length`);b.forEach((w,H)=>{if((0,f.alwaysValidSchema)(ae,w))return;C.if(h._`${K} > ${H}`,()=>y.subschema({keyword:Z,schemaProp:H,dataProp:H},x)),y.ok(x)});function V(w){let{opts:H,errSchemaPath:q}=ae,B=b.length,ne=B===w.minItems&&(B===w.maxItems||w[E]===!1);if(H.strictTuples&&!ne){let U=`"${Z}" is ${B}-tuple, but minItems or maxItems/${E} are not specified or different at path "${q}"`;(0,f.checkStrictMode)(ae,U,H.strictTuples)}}}m.validateTuple=_,m.default=S}),Rd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Ac(),f={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(g)=>(0,h.validateTuple)(g,"items")};m.default=f}),zd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g=wt(),S=Mc(),_={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:y}})=>h.str`must NOT have more than ${y} items`,params:({params:{len:y}})=>h._`{limit: ${y}}`},code(y){let{schema:E,parentSchema:b,it:C}=y,{prefixItems:O}=b;if(C.items=!0,(0,f.alwaysValidSchema)(C,E))return;if(O)(0,S.validateAdditionalItems)(y,O);else y.ok((0,g.validateArray)(y))}};m.default=_}),$d=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:S,max:_}})=>_===void 0?h.str`must contain at least ${S} valid item(s)`:h.str`must contain at least ${S} and no more than ${_} valid item(s)`,params:({params:{min:S,max:_}})=>_===void 0?h._`{minContains: ${S}}`:h._`{minContains: ${S}, maxContains: ${_}}`},code(S){let{gen:_,schema:y,parentSchema:E,data:b,it:C}=S,O,D,{minContains:Z,maxContains:ae}=E;if(C.opts.next)O=Z===void 0?1:Z,D=ae;else O=1;let x=_.const("len",h._`${b}.length`);if(S.setParams({min:O,max:D}),D===void 0&&O===0){(0,f.checkStrictMode)(C,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(D!==void 0&&O>D){(0,f.checkStrictMode)(C,'"minContains" > "maxContains" is always invalid'),S.fail();return}if((0,f.alwaysValidSchema)(C,y)){let q=h._`${x} >= ${O}`;if(D!==void 0)q=h._`${q} && ${x} <= ${D}`;S.pass(q);return}C.items=!0;let K=_.name("valid");if(D===void 0&&O===1)w(K,()=>_.if(K,()=>_.break()));else if(O===0){if(_.let(K,!0),D!==void 0)_.if(h._`${b}.length > 0`,V)}else _.let(K,!1),V();S.result(K,()=>S.reset());function V(){let q=_.name("_valid"),B=_.let("count",0);w(q,()=>_.if(q,()=>H(B)))}function w(q,B){_.forRange("i",0,x,(ne)=>{S.subschema({keyword:"contains",dataProp:ne,dataPropType:f.Type.Num,compositeRule:!0},q),B()})}function H(q){if(_.code(h._`${q}++`),D===void 0)_.if(h._`${q} >= ${O}`,()=>_.assign(K,!0).break());else if(_.if(h._`${q} > ${D}`,()=>_.assign(K,!1).break()),O===1)_.assign(K,!0);else _.if(h._`${q} >= ${O}`,()=>_.assign(K,!0))}}};m.default=g}),wi=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.validateSchemaDeps=m.validatePropertyDeps=m.error=void 0;let h=Fe(),f=We(),g=wt();m.error={message:({params:{property:b,depsCount:C,deps:O}})=>{let D=C===1?"property":"properties";return h.str`must have ${D} ${O} when property ${b} is present`},params:({params:{property:b,depsCount:C,deps:O,missingProperty:D}})=>h._`{property: ${b},
|
|
12
|
-
missingProperty: ${D},
|
|
13
|
-
depsCount: ${C},
|
|
14
|
-
deps: ${O}}`};let S={keyword:"dependencies",type:"object",schemaType:"object",error:m.error,code(b){let[C,O]=_(b);y(b,C),E(b,O)}};function _({schema:b}){let C={},O={};for(let D in b){if(D==="__proto__")continue;let Z=Array.isArray(b[D])?C:O;Z[D]=b[D]}return[C,O]}function y(b,C=b.schema){let{gen:O,data:D,it:Z}=b;if(Object.keys(C).length===0)return;let ae=O.let("missing");for(let x in C){let K=C[x];if(K.length===0)continue;let V=(0,g.propertyInData)(O,D,x,Z.opts.ownProperties);if(b.setParams({property:x,depsCount:K.length,deps:K.join(", ")}),Z.allErrors)O.if(V,()=>{for(let w of K)(0,g.checkReportMissingProp)(b,w)});else O.if(h._`${V} && (${(0,g.checkMissingProp)(b,K,ae)})`),(0,g.reportMissingProp)(b,ae),O.else()}}m.validatePropertyDeps=y;function E(b,C=b.schema){let{gen:O,data:D,keyword:Z,it:ae}=b,x=O.name("valid");for(let K in C){if((0,f.alwaysValidSchema)(ae,C[K]))continue;O.if((0,g.propertyInData)(O,D,K,ae.opts.ownProperties),()=>{let V=b.subschema({keyword:Z,schemaProp:K},x);b.mergeValidEvaluated(V,x)},()=>O.var(x,!0)),b.ok(x)}}m.validateSchemaDeps=E,m.default=S}),Pd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:S})=>h._`{propertyName: ${S.propertyName}}`},code(S){let{gen:_,schema:y,data:E,it:b}=S;if((0,f.alwaysValidSchema)(b,y))return;let C=_.name("valid");_.forIn("key",E,(O)=>{S.setParams({propertyName:O}),S.subschema({keyword:"propertyNames",data:O,dataTypes:["string"],propertyName:O,compositeRule:!0},C),_.if((0,h.not)(C),()=>{if(S.error(!0),!b.allErrors)_.break()})}),S.ok(C)}};m.default=g}),Lc=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wt(),f=Fe(),g=Et(),S=We(),_={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:y})=>f._`{additionalProperty: ${y.additionalProperty}}`},code(y){let{gen:E,schema:b,parentSchema:C,data:O,errsCount:D,it:Z}=y;if(!D)throw Error("ajv implementation error");let{allErrors:ae,opts:x}=Z;if(Z.props=!0,x.removeAdditional!=="all"&&(0,S.alwaysValidSchema)(Z,b))return;let K=(0,h.allSchemaProperties)(C.properties),V=(0,h.allSchemaProperties)(C.patternProperties);w(),y.ok(f._`${D} === ${g.default.errors}`);function w(){E.forIn("key",O,(U)=>{if(!K.length&&!V.length)B(U);else E.if(H(U),()=>B(U))})}function H(U){let j;if(K.length>8){let ce=(0,S.schemaRefOrVal)(Z,C.properties,"properties");j=(0,h.isOwnProperty)(E,ce,U)}else if(K.length)j=(0,f.or)(...K.map((ce)=>f._`${U} === ${ce}`));else j=f.nil;if(V.length)j=(0,f.or)(j,...V.map((ce)=>f._`${(0,h.usePattern)(y,ce)}.test(${U})`));return(0,f.not)(j)}function q(U){E.code(f._`delete ${O}[${U}]`)}function B(U){if(x.removeAdditional==="all"||x.removeAdditional&&b===!1){q(U);return}if(b===!1){if(y.setParams({additionalProperty:U}),y.error(),!ae)E.break();return}if(typeof b=="object"&&!(0,S.alwaysValidSchema)(Z,b)){let j=E.name("valid");if(x.removeAdditional==="failing")ne(U,j,!1),E.if((0,f.not)(j),()=>{y.reset(),q(U)});else if(ne(U,j),!ae)E.if((0,f.not)(j),()=>E.break())}}function ne(U,j,ce){let Pe={keyword:"additionalProperties",dataProp:U,dataPropType:S.Type.Str};if(ce===!1)Object.assign(Pe,{compositeRule:!0,createErrors:!1,allErrors:!1});y.subschema(Pe,j)}}};m.default=_}),Ed=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Ua(),f=wt(),g=We(),S=Lc(),_={keyword:"properties",type:"object",schemaType:"object",code(y){let{gen:E,schema:b,parentSchema:C,data:O,it:D}=y;if(D.opts.removeAdditional==="all"&&C.additionalProperties===void 0)S.default.code(new h.KeywordCxt(D,S.default,"additionalProperties"));let Z=(0,f.allSchemaProperties)(b);for(let w of Z)D.definedProperties.add(w);if(D.opts.unevaluated&&Z.length&&D.props!==!0)D.props=g.mergeEvaluated.props(E,(0,g.toHash)(Z),D.props);let ae=Z.filter((w)=>!(0,g.alwaysValidSchema)(D,b[w]));if(ae.length===0)return;let x=E.name("valid");for(let w of ae){if(K(w))V(w);else{if(E.if((0,f.propertyInData)(E,O,w,D.opts.ownProperties)),V(w),!D.allErrors)E.else().var(x,!0);E.endIf()}y.it.definedProperties.add(w),y.ok(x)}function K(w){return D.opts.useDefaults&&!D.compositeRule&&b[w].default!==void 0}function V(w){y.subschema({keyword:"properties",schemaProp:w,dataProp:w},x)}}};m.default=_}),wd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wt(),f=Fe(),g=We(),S=We(),_={keyword:"patternProperties",type:"object",schemaType:"object",code(y){let{gen:E,schema:b,data:C,parentSchema:O,it:D}=y,{opts:Z}=D,ae=(0,h.allSchemaProperties)(b),x=ae.filter((ne)=>(0,g.alwaysValidSchema)(D,b[ne]));if(ae.length===0||x.length===ae.length&&(!D.opts.unevaluated||D.props===!0))return;let K=Z.strictSchema&&!Z.allowMatchingProperties&&O.properties,V=E.name("valid");if(D.props!==!0&&!(D.props instanceof f.Name))D.props=(0,S.evaluatedPropsToName)(E,D.props);let{props:w}=D;H();function H(){for(let ne of ae){if(K)q(ne);if(D.allErrors)B(ne);else E.var(V,!0),B(ne),E.if(V)}}function q(ne){for(let U in K)if(new RegExp(ne).test(U))(0,g.checkStrictMode)(D,`property ${U} matches pattern ${ne} (use allowMatchingProperties)`)}function B(ne){E.forIn("key",C,(U)=>{E.if(f._`${(0,h.usePattern)(y,ne)}.test(${U})`,()=>{let j=x.includes(ne);if(!j)y.subschema({keyword:"patternProperties",schemaProp:ne,dataProp:U,dataPropType:S.Type.Str},V);if(D.opts.unevaluated&&w!==!0)E.assign(f._`${w}[${U}]`,!0);else if(!j&&!D.allErrors)E.if((0,f.not)(V),()=>E.break())})})}}};m.default=_}),Td=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=We(),f={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(g){let{gen:S,schema:_,it:y}=g;if((0,h.alwaysValidSchema)(y,_)){g.fail();return}let E=S.name("valid");g.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},E),g.failResult(E,()=>g.reset(),()=>g.error())},error:{message:"must NOT be valid"}};m.default=f}),Cd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:wt().validateUnion,error:{message:"must match a schema in anyOf"}};m.default=h}),qd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:S})=>h._`{passingSchemas: ${S.passing}}`},code(S){let{gen:_,schema:y,parentSchema:E,it:b}=S;if(!Array.isArray(y))throw Error("ajv implementation error");if(b.opts.discriminator&&E.discriminator)return;let C=y,O=_.let("valid",!1),D=_.let("passing",null),Z=_.name("_valid");S.setParams({passing:D}),_.block(ae),S.result(O,()=>S.reset(),()=>S.error(!0));function ae(){C.forEach((x,K)=>{let V;if((0,f.alwaysValidSchema)(b,x))_.var(Z,!0);else V=S.subschema({keyword:"oneOf",schemaProp:K,compositeRule:!0},Z);if(K>0)_.if(h._`${Z} && ${O}`).assign(O,!1).assign(D,h._`[${D}, ${K}]`).else();_.if(Z,()=>{if(_.assign(O,!0),_.assign(D,K),V)S.mergeEvaluated(V,h.Name)})})}}};m.default=g}),jd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=We(),f={keyword:"allOf",schemaType:"array",code(g){let{gen:S,schema:_,it:y}=g;if(!Array.isArray(_))throw Error("ajv implementation error");let E=S.name("valid");_.forEach((b,C)=>{if((0,h.alwaysValidSchema)(y,b))return;let O=g.subschema({keyword:"allOf",schemaProp:C},E);g.ok(E),g.mergeEvaluated(O)})}};m.default=f}),Nd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:_})=>h.str`must match "${_.ifClause}" schema`,params:({params:_})=>h._`{failingKeyword: ${_.ifClause}}`},code(_){let{gen:y,parentSchema:E,it:b}=_;if(E.then===void 0&&E.else===void 0)(0,f.checkStrictMode)(b,'"if" without "then" and "else" is ignored');let C=S(b,"then"),O=S(b,"else");if(!C&&!O)return;let D=y.let("valid",!0),Z=y.name("_valid");if(ae(),_.reset(),C&&O){let K=y.let("ifClause");_.setParams({ifClause:K}),y.if(Z,x("then",K),x("else",K))}else if(C)y.if(Z,x("then"));else y.if((0,h.not)(Z),x("else"));_.pass(D,()=>_.error(!0));function ae(){let K=_.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},Z);_.mergeEvaluated(K)}function x(K,V){return()=>{let w=_.subschema({keyword:K},Z);if(y.assign(D,Z),_.mergeValidEvaluated(w,D),V)y.assign(V,h._`${K}`);else _.setParams({ifClause:K})}}}};function S(_,y){let E=_.schema[y];return E!==void 0&&!(0,f.alwaysValidSchema)(_,E)}m.default=g}),Id=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=We(),f={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:g,parentSchema:S,it:_}){if(S.if===void 0)(0,h.checkStrictMode)(_,`"${g}" without "if" is ignored`)}};m.default=f}),Vc=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Mc(),f=Rd(),g=Ac(),S=zd(),_=$d(),y=wi(),E=Pd(),b=Lc(),C=Ed(),O=wd(),D=Td(),Z=Cd(),ae=qd(),x=jd(),K=Nd(),V=Id();function w(H=!1){let q=[D.default,Z.default,ae.default,x.default,K.default,V.default,E.default,b.default,y.default,C.default,O.default];if(H)q.push(f.default,S.default);else q.push(h.default,g.default);return q.push(_.default),q}m.default=w}),Od=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:g})=>h.str`must match format "${g}"`,params:({schemaCode:g})=>h._`{format: ${g}}`},code(g,S){let{gen:_,data:y,$data:E,schema:b,schemaCode:C,it:O}=g,{opts:D,errSchemaPath:Z,schemaEnv:ae,self:x}=O;if(!D.validateFormats)return;if(E)K();else V();function K(){let w=_.scopeValue("formats",{ref:x.formats,code:D.code.formats}),H=_.const("fDef",h._`${w}[${C}]`),q=_.let("fType"),B=_.let("format");_.if(h._`typeof ${H} == "object" && !(${H} instanceof RegExp)`,()=>_.assign(q,h._`${H}.type || "string"`).assign(B,h._`${H}.validate`),()=>_.assign(q,h._`"string"`).assign(B,H)),g.fail$data((0,h.or)(ne(),U()));function ne(){if(D.strictSchema===!1)return h.nil;return h._`${C} && !${B}`}function U(){let j=ae.$async?h._`(${H}.async ? await ${B}(${y}) : ${B}(${y}))`:h._`${B}(${y})`,ce=h._`(typeof ${B} == "function" ? ${j} : ${B}.test(${y}))`;return h._`${B} && ${B} !== true && ${q} === ${S} && !${ce}`}}function V(){let w=x.formats[b];if(!w){ne();return}if(w===!0)return;let[H,q,B]=U(w);if(H===S)g.pass(j());function ne(){if(D.strictSchema===!1){x.logger.warn(ce());return}throw Error(ce());function ce(){return`unknown format "${b}" ignored in schema at path "${Z}"`}}function U(ce){let Pe=ce instanceof RegExp?(0,h.regexpCode)(ce):D.code.formats?h._`${D.code.formats}${(0,h.getProperty)(b)}`:void 0,Ie=_.scopeValue("formats",{key:b,ref:ce,code:Pe});if(typeof ce=="object"&&!(ce instanceof RegExp))return[ce.type||"string",ce.validate,h._`${Ie}.validate`];return["string",ce,Ie]}function j(){if(typeof w=="object"&&!(w instanceof RegExp)&&w.async){if(!ae.$async)throw Error("async format in sync schema");return h._`await ${B}(${y})`}return typeof q=="function"?h._`${B}(${y})`:h._`${B}.test(${y})`}}}};m.default=f}),Dc=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=[Od().default];m.default=h}),Uc=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.contentVocabulary=m.metadataVocabulary=void 0,m.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],m.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),Hc=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Oc(),f=kc(),g=Vc(),S=Dc(),_=Uc(),y=[h.default,f.default,(0,g.default)(),S.default,_.metadataVocabulary,_.contentVocabulary];m.default=y}),kd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.DiscrError=void 0;var h;(function(f){f.Tag="tag",f.Mapping="mapping"})(h||(m.DiscrError=h={}))}),Ti=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=kd(),g=yn(),S=Ha(),_=We(),y={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:E,tagName:b}})=>E===f.DiscrError.Tag?`tag "${b}" must be string`:`value of tag "${b}" must be in oneOf`,params:({params:{discrError:E,tag:b,tagName:C}})=>h._`{error: ${E}, tag: ${C}, tagValue: ${b}}`},code(E){let{gen:b,data:C,schema:O,parentSchema:D,it:Z}=E,{oneOf:ae}=D;if(!Z.opts.discriminator)throw Error("discriminator: requires discriminator option");let x=O.propertyName;if(typeof x!="string")throw Error("discriminator: requires propertyName");if(O.mapping)throw Error("discriminator: mapping is not supported");if(!ae)throw Error("discriminator: requires oneOf keyword");let K=b.let("valid",!1),V=b.const("tag",h._`${C}${(0,h.getProperty)(x)}`);b.if(h._`typeof ${V} == "string"`,()=>w(),()=>E.error(!1,{discrError:f.DiscrError.Tag,tag:V,tagName:x})),E.ok(K);function w(){let B=q();b.if(!1);for(let ne in B)b.elseIf(h._`${V} === ${ne}`),b.assign(K,H(B[ne]));b.else(),E.error(!1,{discrError:f.DiscrError.Mapping,tag:V,tagName:x}),b.endIf()}function H(B){let ne=b.name("valid"),U=E.subschema({keyword:"oneOf",schemaProp:B},ne);return E.mergeEvaluated(U,h.Name),ne}function q(){var B;let ne={},U=ce(D),j=!0;for(let Te=0;Te<ae.length;Te++){let je=ae[Te];if((je===null||je===void 0?void 0:je.$ref)&&!(0,_.schemaHasRulesButRef)(je,Z.self.RULES)){let Me=je.$ref;if(je=g.resolveRef.call(Z.self,Z.schemaEnv.root,Z.baseId,Me),je instanceof g.SchemaEnv)je=je.schema;if(je===void 0)throw new S.default(Z.opts.uriResolver,Z.baseId,Me)}let Ae=(B=je===null||je===void 0?void 0:je.properties)===null||B===void 0?void 0:B[x];if(typeof Ae!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${x}"`);j=j&&(U||ce(je)),Pe(Ae,Te)}if(!j)throw Error(`discriminator: "${x}" must be required`);return ne;function ce({required:Te}){return Array.isArray(Te)&&Te.includes(x)}function Pe(Te,je){if(Te.const)Ie(Te.const,je);else if(Te.enum)for(let Ae of Te.enum)Ie(Ae,je);else throw Error(`discriminator: "properties/${x}" must have "const" or "enum"`)}function Ie(Te,je){if(typeof Te!="string"||Te in ne)throw Error(`discriminator: "${x}" values must be unique strings`);ne[Te]=je}}}};m.default=y}),Md=qe((m,h)=>{h.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}}),Fc=qe((m,h)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.MissingRefError=m.ValidationError=m.CodeGen=m.Name=m.nil=m.stringify=m.str=m._=m.KeywordCxt=m.Ajv=void 0;let f=$i(),g=Hc(),S=Ti(),_=Md(),y=["/properties"],E="http://json-schema.org/draft-07/schema";var b=class extends f.default{_addVocabularies(){if(super._addVocabularies(),g.default.forEach((ae)=>this.addVocabulary(ae)),this.opts.discriminator)this.addKeyword(S.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let ae=this.opts.$data?this.$dataMetaSchema(_,y):_;this.addMetaSchema(ae,E,!1),this.refs["http://json-schema.org/schema"]=E}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(E)?E:void 0)}};m.Ajv=b,h.exports=m=b,h.exports.Ajv=b,Object.defineProperty(m,"__esModule",{value:!0}),m.default=b;var C=Ua();Object.defineProperty(m,"KeywordCxt",{enumerable:!0,get:function(){return C.KeywordCxt}});var O=Fe();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return O._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return O.str}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return O.stringify}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return O.nil}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return O.Name}}),Object.defineProperty(m,"CodeGen",{enumerable:!0,get:function(){return O.CodeGen}});var D=Yr();Object.defineProperty(m,"ValidationError",{enumerable:!0,get:function(){return D.default}});var Z=Ha();Object.defineProperty(m,"MissingRefError",{enumerable:!0,get:function(){return Z.default}})}),xc=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.dynamicAnchor=void 0;let h=Fe(),f=Et(),g=yn(),S=Pi(),_={keyword:"$dynamicAnchor",schemaType:"string",code:(b)=>y(b,b.schema)};function y(b,C){let{gen:O,it:D}=b;D.schemaEnv.root.dynamicAnchors[C]=!0;let Z=h._`${f.default.dynamicAnchors}${(0,h.getProperty)(C)}`,ae=D.errSchemaPath==="#"?D.validateName:E(b);O.if(h._`!${Z}`,()=>O.assign(Z,ae))}m.dynamicAnchor=y;function E(b){let{schemaEnv:C,schema:O,self:D}=b.it,{root:Z,baseId:ae,localRefs:x,meta:K}=C.root,{schemaId:V}=D.opts,w=new g.SchemaEnv({schema:O,schemaId:V,root:Z,baseId:ae,localRefs:x,meta:K});return g.compileSchema.call(D,w),(0,S.getValidate)(b,w)}m.default=_}),Kc=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.dynamicRef=void 0;let h=Fe(),f=Et(),g=Pi(),S={keyword:"$dynamicRef",schemaType:"string",code:(y)=>_(y,y.schema)};function _(y,E){let{gen:b,keyword:C,it:O}=y;if(E[0]!=="#")throw Error(`"${C}" only supports hash fragment reference`);let D=E.slice(1);if(O.allErrors)Z();else{let x=b.let("valid",!1);Z(x),y.ok(x)}function Z(x){if(O.schemaEnv.root.dynamicAnchors[D]){let K=b.let("_v",h._`${f.default.dynamicAnchors}${(0,h.getProperty)(D)}`);b.if(K,ae(K,x),ae(O.validateName,x))}else ae(O.validateName,x)()}function ae(x,K){return K?()=>b.block(()=>{(0,g.callRef)(y,x),b.let(K,!0)}):()=>(0,g.callRef)(y,x)}}m.dynamicRef=_,m.default=S}),Ad=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=xc(),f=We(),g={keyword:"$recursiveAnchor",schemaType:"boolean",code(S){if(S.schema)(0,h.dynamicAnchor)(S,"");else(0,f.checkStrictMode)(S.it,"$recursiveAnchor: false is ignored")}};m.default=g}),Ld=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Kc(),f={keyword:"$recursiveRef",schemaType:"string",code:(g)=>(0,h.dynamicRef)(g,g.schema)};m.default=f}),Jc=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=xc(),f=Kc(),g=Ad(),S=Ld(),_=[h.default,f.default,g.default,S.default];m.default=_}),Vd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wi(),f={keyword:"dependentRequired",type:"object",schemaType:"object",error:h.error,code:(g)=>(0,h.validatePropertyDeps)(g)};m.default=f}),Dd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=wi(),f={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(g)=>(0,h.validateSchemaDeps)(g)};m.default=f}),Ud=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=We(),f={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:g,parentSchema:S,it:_}){if(S.contains===void 0)(0,h.checkStrictMode)(_,`"${g}" without "contains" is ignored`)}};m.default=f}),Gc=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Vd(),f=Dd(),g=Ud(),S=[h.default,f.default,g.default];m.default=S}),Hd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g=Et(),S={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:_})=>h._`{unevaluatedProperty: ${_.unevaluatedProperty}}`},code(_){let{gen:y,schema:E,data:b,errsCount:C,it:O}=_;if(!C)throw Error("ajv implementation error");let{allErrors:D,props:Z}=O;if(Z instanceof h.Name)y.if(h._`${Z} !== true`,()=>y.forIn("key",b,(V)=>y.if(x(Z,V),()=>ae(V))));else if(Z!==!0)y.forIn("key",b,(V)=>Z===void 0?ae(V):y.if(K(Z,V),()=>ae(V)));O.props=!0,_.ok(h._`${C} === ${g.default.errors}`);function ae(V){if(E===!1){if(_.setParams({unevaluatedProperty:V}),_.error(),!D)y.break();return}if(!(0,f.alwaysValidSchema)(O,E)){let w=y.name("valid");if(_.subschema({keyword:"unevaluatedProperties",dataProp:V,dataPropType:f.Type.Str},w),!D)y.if((0,h.not)(w),()=>y.break())}}function x(V,w){return h._`!${V} || !${V}[${w}]`}function K(V,w){let H=[];for(let q in V)if(V[q]===!0)H.push(h._`${w} !== ${q}`);return(0,h.and)(...H)}}};m.default=S}),Fd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Fe(),f=We(),g={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:S}})=>h.str`must NOT have more than ${S} items`,params:({params:{len:S}})=>h._`{limit: ${S}}`},code(S){let{gen:_,schema:y,data:E,it:b}=S,C=b.items||0;if(C===!0)return;let O=_.const("len",h._`${E}.length`);if(y===!1)S.setParams({len:C}),S.fail(h._`${O} > ${C}`);else if(typeof y=="object"&&!(0,f.alwaysValidSchema)(b,y)){let Z=_.var("valid",h._`${O} <= ${C}`);_.if((0,h.not)(Z),()=>D(Z,C)),S.ok(Z)}b.items=!0;function D(Z,ae){_.forRange("i",ae,O,(x)=>{if(S.subschema({keyword:"unevaluatedItems",dataProp:x,dataPropType:f.Type.Num},Z),!b.allErrors)_.if((0,h.not)(Z),()=>_.break())})}}};m.default=g}),Bc=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Hd(),f=Fd(),g=[h.default,f.default];m.default=g}),xd=qe((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}}),Kd=qe((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}}),Jd=qe((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}}),Gd=qe((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}}),Bd=qe((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}}),Yd=qe((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),Wd=qe((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),Zd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=xd(),f=Kd(),g=Jd(),S=Gd(),_=Bd(),y=Yd(),E=Wd(),b=["/properties"];function C(O){return[h,f,g,S,D(this,_),y,D(this,E)].forEach((Z)=>this.addMetaSchema(Z,void 0,!1)),this;function D(Z,ae){return O?Z.$dataMetaSchema(ae,b):ae}}m.default=C}),Xd=qe((m,h)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.MissingRefError=m.ValidationError=m.CodeGen=m.Name=m.nil=m.stringify=m.str=m._=m.KeywordCxt=m.Ajv2019=void 0;let f=$i(),g=Hc(),S=Jc(),_=Gc(),y=Bc(),E=Ti(),b=Zd(),C="https://json-schema.org/draft/2019-09/schema";var O=class extends f.default{constructor(K={}){super({...K,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),this.addVocabulary(S.default),g.default.forEach((K)=>this.addVocabulary(K)),this.addVocabulary(_.default),this.addVocabulary(y.default),this.opts.discriminator)this.addKeyword(E.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:K,meta:V}=this.opts;if(!V)return;b.default.call(this,K),this.refs["http://json-schema.org/schema"]=C}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(C)?C:void 0)}};m.Ajv2019=O,h.exports=m=O,h.exports.Ajv2019=O,Object.defineProperty(m,"__esModule",{value:!0}),m.default=O;var D=Ua();Object.defineProperty(m,"KeywordCxt",{enumerable:!0,get:function(){return D.KeywordCxt}});var Z=Fe();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return Z._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return Z.str}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return Z.stringify}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return Z.nil}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return Z.Name}}),Object.defineProperty(m,"CodeGen",{enumerable:!0,get:function(){return Z.CodeGen}});var ae=Yr();Object.defineProperty(m,"ValidationError",{enumerable:!0,get:function(){return ae.default}});var x=Ha();Object.defineProperty(m,"MissingRefError",{enumerable:!0,get:function(){return x.default}})}),Qd=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=Oc(),f=kc(),g=Vc(),S=Jc(),_=Gc(),y=Bc(),E=Dc(),b=Uc(),C=[S.default,h.default,f.default,(0,g.default)(!0),E.default,b.metadataVocabulary,b.contentVocabulary,_.default,y.default];m.default=C}),em=qe((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}}),tm=qe((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}}),am=qe((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}}),rm=qe((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}}),om=qe((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}}),sm=qe((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}}),nm=qe((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),im=qe((m,h)=>{h.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),cm=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0});let h=em(),f=tm(),g=am(),S=rm(),_=om(),y=sm(),E=nm(),b=im(),C=["/properties"];function O(D){return[h,f,g,S,_,Z(this,y),E,Z(this,b)].forEach((ae)=>this.addMetaSchema(ae,void 0,!1)),this;function Z(ae,x){return D?ae.$dataMetaSchema(x,C):x}}m.default=O}),lm=qe((m,h)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.MissingRefError=m.ValidationError=m.CodeGen=m.Name=m.nil=m.stringify=m.str=m._=m.KeywordCxt=m.Ajv2020=void 0;let f=$i(),g=Qd(),S=Ti(),_=cm(),y="https://json-schema.org/draft/2020-12/schema";var E=class extends f.default{constructor(Z={}){super({...Z,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),g.default.forEach((Z)=>this.addVocabulary(Z)),this.opts.discriminator)this.addKeyword(S.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:Z,meta:ae}=this.opts;if(!ae)return;_.default.call(this,Z),this.refs["http://json-schema.org/schema"]=y}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(y)?y:void 0)}};m.Ajv2020=E,h.exports=m=E,h.exports.Ajv2020=E,Object.defineProperty(m,"__esModule",{value:!0}),m.default=E;var b=Ua();Object.defineProperty(m,"KeywordCxt",{enumerable:!0,get:function(){return b.KeywordCxt}});var C=Fe();Object.defineProperty(m,"_",{enumerable:!0,get:function(){return C._}}),Object.defineProperty(m,"str",{enumerable:!0,get:function(){return C.str}}),Object.defineProperty(m,"stringify",{enumerable:!0,get:function(){return C.stringify}}),Object.defineProperty(m,"nil",{enumerable:!0,get:function(){return C.nil}}),Object.defineProperty(m,"Name",{enumerable:!0,get:function(){return C.Name}}),Object.defineProperty(m,"CodeGen",{enumerable:!0,get:function(){return C.CodeGen}});var O=Yr();Object.defineProperty(m,"ValidationError",{enumerable:!0,get:function(){return O.default}});var D=Ha();Object.defineProperty(m,"MissingRefError",{enumerable:!0,get:function(){return D.default}})}),um=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.formatNames=m.fastFormats=m.fullFormats=void 0;function h(Te,je){return{validate:Te,compare:je}}m.fullFormats={date:h(_,y),time:h(b(!0),C),"date-time":h(Z(!0),ae),"iso-time":h(b(),O),"iso-date-time":h(Z(),x),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:w,"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:Ie,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:q,int32:{type:"number",validate:U},int64:{type:"number",validate:j},float:{type:"number",validate:ce},double:{type:"number",validate:ce},password:!0,binary:!0},m.fastFormats={...m.fullFormats,date:h(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,y),time:h(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,C),"date-time":h(/^\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,ae),"iso-time":h(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,O),"iso-date-time":h(/^\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,x),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},m.formatNames=Object.keys(m.fullFormats);function f(Te){return Te%4===0&&(Te%100!==0||Te%400===0)}let g=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,S=[0,31,28,31,30,31,30,31,31,30,31,30,31];function _(Te){let je=g.exec(Te);if(!je)return!1;let Ae=+je[1],Me=+je[2],Ge=+je[3];return Me>=1&&Me<=12&&Ge>=1&&Ge<=(Me===2&&f(Ae)?29:S[Me])}function y(Te,je){if(!(Te&&je))return;if(Te>je)return 1;if(Te<je)return-1;return 0}let E=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function b(Te){return function(Ae){let Me=E.exec(Ae);if(!Me)return!1;let Ge=+Me[1],Qe=+Me[2],Ze=+Me[3],nt=Me[4],Ye=Me[5]==="-"?-1:1,he=+(Me[6]||0),Re=+(Me[7]||0);if(he>23||Re>59||Te&&!nt)return!1;if(Ge<=23&&Qe<=59&&Ze<60)return!0;let Ne=Qe-Re*Ye,W=Ge-he*Ye-(Ne<0?1:0);return(W===23||W===-1)&&(Ne===59||Ne===-1)&&Ze<61}}function C(Te,je){if(!(Te&&je))return;let Ae=new Date("2020-01-01T"+Te).valueOf(),Me=new Date("2020-01-01T"+je).valueOf();if(!(Ae&&Me))return;return Ae-Me}function O(Te,je){if(!(Te&&je))return;let Ae=E.exec(Te),Me=E.exec(je);if(!(Ae&&Me))return;if(Te=Ae[1]+Ae[2]+Ae[3],je=Me[1]+Me[2]+Me[3],Te>je)return 1;if(Te<je)return-1;return 0}let D=/t|\s/i;function Z(Te){let je=b(Te);return function(Me){let Ge=Me.split(D);return Ge.length===2&&_(Ge[0])&&je(Ge[1])}}function ae(Te,je){if(!(Te&&je))return;let Ae=new Date(Te).valueOf(),Me=new Date(je).valueOf();if(!(Ae&&Me))return;return Ae-Me}function x(Te,je){if(!(Te&&je))return;let[Ae,Me]=Te.split(D),[Ge,Qe]=je.split(D),Ze=y(Ae,Ge);if(Ze===void 0)return;return Ze||C(Me,Qe)}let K=/\/|:/,V=/^(?:[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 w(Te){return K.test(Te)&&V.test(Te)}let H=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function q(Te){return H.lastIndex=0,H.test(Te)}let B=-2147483648,ne=2147483647;function U(Te){return Number.isInteger(Te)&&Te<=ne&&Te>=B}function j(Te){return Number.isInteger(Te)}function ce(){return!0}let Pe=/[^\\]\\Z/;function Ie(Te){if(Pe.test(Te))return!1;try{return new RegExp(Te),!0}catch(je){return!1}}}),dm=qe((m)=>{Object.defineProperty(m,"__esModule",{value:!0}),m.formatLimitDefinition=void 0;let h=Fc(),f=Fe(),g=f.operators,S={formatMaximum:{okStr:"<=",ok:g.LTE,fail:g.GT},formatMinimum:{okStr:">=",ok:g.GTE,fail:g.LT},formatExclusiveMaximum:{okStr:"<",ok:g.LT,fail:g.GTE},formatExclusiveMinimum:{okStr:">",ok:g.GT,fail:g.LTE}},_={message:({keyword:E,schemaCode:b})=>f.str`should be ${S[E].okStr} ${b}`,params:({keyword:E,schemaCode:b})=>f._`{comparison: ${S[E].okStr}, limit: ${b}}`};m.formatLimitDefinition={keyword:Object.keys(S),type:"string",schemaType:"string",$data:!0,error:_,code(E){let{gen:b,data:C,schemaCode:O,keyword:D,it:Z}=E,{opts:ae,self:x}=Z;if(!ae.validateFormats)return;let K=new h.KeywordCxt(Z,x.RULES.all.format.definition,"format");if(K.$data)V();else w();function V(){let q=b.scopeValue("formats",{ref:x.formats,code:ae.code.formats}),B=b.const("fmt",f._`${q}[${K.schemaCode}]`);E.fail$data((0,f.or)(f._`typeof ${B} != "object"`,f._`${B} instanceof RegExp`,f._`typeof ${B}.compare != "function"`,H(B)))}function w(){let q=K.schema,B=x.formats[q];if(!B||B===!0)return;if(typeof B!="object"||B instanceof RegExp||typeof B.compare!="function")throw Error(`"${D}": format "${q}" does not define "compare" function`);let ne=b.scopeValue("formats",{key:q,ref:B,code:ae.code.formats?f._`${ae.code.formats}${(0,f.getProperty)(q)}`:void 0});E.fail$data(H(ne))}function H(q){return f._`${q}.compare(${C}, ${O}) ${S[D].fail} 0`}},dependencies:["format"]};let y=(E)=>(E.addKeyword(m.formatLimitDefinition),E);m.default=y}),mm=qe((m,h)=>{Object.defineProperty(m,"__esModule",{value:!0});let f=um(),g=dm(),S=Fe(),_=new S.Name("fullFormats"),y=new S.Name("fastFormats"),E=(C,O={keywords:!0})=>{if(Array.isArray(O))return b(C,O,f.fullFormats,_),C;let[D,Z]=O.mode==="fast"?[f.fastFormats,y]:[f.fullFormats,_];if(b(C,O.formats||f.formatNames,D,Z),O.keywords)(0,g.default)(C);return C};E.get=(C,O="full")=>{let D=(O==="fast"?f.fastFormats:f.fullFormats)[C];if(!D)throw Error(`Unknown format "${C}"`);return D};function b(C,O,D,Z){var ae,x;(ae=(x=C.opts.code).formats)!==null&&ae!==void 0||(x.formats=S._`require("ajv-formats/dist/formats").${Z}`);for(let K of O)C.addFormat(K,D[K])}h.exports=m=E,Object.defineProperty(m,"__esModule",{value:!0}),m.default=E}),Yc=Fc(),hm=Xd(),pm=lm(),fm=go(mm(),1),gm=fm.default;function zi(m){let h=new m({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return gm(h),h}var Ci=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(m){this._userAjv=m!==void 0,this._ajv=m}get ajv(){return this._ajv??=zi(pm.Ajv2020)}_engineFor(m){if(this._userAjv)return this.ajv;let h=ki(m,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");if(h==="2020-12")return this.ajv;if(h==="2019-09")return this._ajv2019??=zi(hm.Ajv2019);return this._ajvDraft7??=zi(Yc.Ajv)}getValidator(m){let h=this._engineFor(m),f="$id"in m&&typeof m.$id==="string"?h.getSchema(m.$id)??h.compile(m):h.compile(m);return(g)=>f(g)?{valid:!0,data:g,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:h.errorsText(f.errors)}}},bh=Yc.Ajv;import se from"node:process";var sl=Symbol.for("mcp.completable");function Wc(m){return!!m&&typeof m==="object"&&sl in m}function Sm(m){return m[sl]?.complete}function _m(m,h){switch(h.kind){case"tools_list_changed":return m.toolsListChanged===!0;case"prompts_list_changed":return m.promptsListChanged===!0;case"resources_list_changed":return m.resourcesListChanged===!0;case"resource_updated":return m.resourceSubscriptions!==void 0&&m.resourceSubscriptions.includes(h.uri)}}function ym(m,h){let f={},g=(S)=>h===void 0||S===!0;if(m.toolsListChanged===!0&&g(h?.tools?.listChanged))f.toolsListChanged=!0;if(m.promptsListChanged===!0&&g(h?.prompts?.listChanged))f.promptsListChanged=!0;if(m.resourcesListChanged===!0&&g(h?.resources?.listChanged))f.resourcesListChanged=!0;if(m.resourceSubscriptions!==void 0&&m.resourceSubscriptions.length>0&&g(h?.resources?.subscribe))f.resourceSubscriptions=[...m.resourceSubscriptions];return f}var ie=1024;function Zc(m,h){return{method:m.method,params:{...m.params,_meta:{...m.params?._meta,[$a]:h}}}}function vm(m){let h=Bt(Gr).validateRequest("subscriptions/listen",m);return h.ok?h.value.params?.notifications:void 0}var bm=new Set(["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed","notifications/resources/updated"]),ve=class{_subs=new Map;_serverCapabilities;_serverInfo;constructor(m=ie,h,f){this._maxSubscriptions=m,this._serverCapabilities=h,this._serverInfo=f}setServerCapabilities(m,h){if(this._serverCapabilities=m,h!==void 0)this._serverInfo=h}has(m){return this._subs.has(m)}serve(m){if(this._serverCapabilities===void 0)throw Error("StdioListenRouter.serve() called before setServerCapabilities(); refusing to honor a filter without capabilities");if(this._subs.size>=this._maxSubscriptions)return{jsonrpc:"2.0",id:m.id,error:{code:-32603,message:"Subscription limit reached"}};let h=vm(m);if(h===void 0)return{jsonrpc:"2.0",id:m.id,error:{code:-32602,message:"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter"}};let f=ym(h,this._serverCapabilities);return this._subs.set(m.id,f),Zc({method:"notifications/subscriptions/acknowledged",params:{notifications:f}},m.id)}cancel(m){return this._subs.delete(m)}routeOutbound(m){if(!bm.has(m.method))return"passthrough";let h=m.params?.uri,f=typeof h==="string"?h:void 0,g=Rm(m.method,f),S=[];for(let[_,y]of this._subs)if(_m(y,g))S.push(Zc({method:m.method,params:m.params??{}},_));return S}teardownAll(){let m=[];for(let h of this._subs.keys())m.push({jsonrpc:"2.0",id:h,result:{resultType:"complete",_meta:{[$a]:h,...this._serverInfo!==void 0&&{[jt]:this._serverInfo}}}});return this._subs.clear(),m}};function Rm(m,h){switch(m){case"notifications/tools/list_changed":return{kind:"tools_list_changed"};case"notifications/prompts/list_changed":return{kind:"prompts_list_changed"};case"notifications/resources/list_changed":return{kind:"resources_list_changed"};default:return{kind:"resource_updated",uri:h??""}}}var zm=8,$m=600000;function Pm(m){if(m?.maxRounds!==void 0&&(!Number.isInteger(m.maxRounds)||m.maxRounds<1))throw RangeError(`inputRequired.maxRounds must be a positive integer (got ${m.maxRounds})`);if(m?.roundTimeoutMs!==void 0&&(!Number.isFinite(m.roundTimeoutMs)||m.roundTimeoutMs<=0))throw RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${m.roundTimeoutMs})`);return{maxRounds:m?.maxRounds??zm,roundTimeoutMs:m?.roundTimeoutMs??$m,legacyShim:m?.legacyShim??!0}}function nl(m,h,f){if(f===null||typeof f!=="object"||typeof f.method!=="string")throw new Ve(i.InternalError,`Handler for ${m} returned an invalid input request '${h}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let g=f,S=Zi(g);if(S===void 0)throw new Ve(i.InternalError,`Handler for ${m} returned an input request '${h}' of kind '${g.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:g,required:S}}function Em(){let m=globalThis.crypto;if(m?.randomUUID!==void 0)return m.randomUUID();let h=new Uint8Array(16);m.getRandomValues(h),h[6]=h[6]&15|64,h[8]=h[8]&63|128;let f=[...h].map((g)=>g.toString(16).padStart(2,"0")).join("");return`${f.slice(0,8)}-${f.slice(8,12)}-${f.slice(12,16)}-${f.slice(16,20)}-${f.slice(20)}`}function qi(m,h){if(m==="tools/call")return{content:[{type:"text",text:h}],isError:!0};throw new Ve(i.InternalError,h)}var wm=class{constructor(m){this._host=m}async fulfill(m,h,f,g,S){let{maxRounds:_,roundTimeoutMs:y}=this._host,E=g.mcpReq.signal,b=S,C=0;while(!0){if(C+=1,C>_)return qi(m,vc(m,_));let O=b.inputRequests,D=O!=null&&Object.keys(O).length>0,Z=typeof b.requestState==="string"?b.requestState:void 0;if(!D&&Z===void 0)throw new Ve(i.InternalError,`Handler for ${m} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let ae;if(D){let V=this._host.resolvedClientCapabilities(g),w=[];for(let[q,B]of Object.entries(O)){let{embedded:ne,required:U}=nl(m,q,B);if(ne.method!=="roots/list"&&ne.params===void 0)throw new Ve(i.InternalError,`Handler for ${m} returned an input request '${q}' of kind '${ne.method}' without params`);if(ci(U,V)!==void 0)return qi(m,`Cannot request input '${q}' (${ne.method}): the client on this 2025-era connection did not declare the required capability${V===void 0?" (no client capabilities are available on this connection — per-request legacy serving cannot receive server-to-client requests)":""}`);w.push([q,ne])}let H=Rc(E);try{let q={relatedRequestId:g.mcpReq.id,timeout:y,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:H.signal},B=await Promise.all(w.map(async([ne,U])=>{try{return[ne,await this._dispatchLeg(U,q)]}catch(j){throw H.abort(j),j}}));ae=Object.fromEntries(B)}catch(q){if(E.aborted)throw q;return qi(m,`Fulfilling input required by '${m}' failed: ${q instanceof Error?q.message:String(q)}`)}finally{H.dispose()}}else await bc(yc,E);let x={...g,mcpReq:{...g.mcpReq,inputResponses:ae,droppedInputResponseKeys:void 0,requestState:Br(Z)}};if(Z!==void 0){let V=await this._host.verifyRequestState(Z,x,m);if(V!==void 0)x=bi(x,V)}let K=await h(f,x);if(!Yt(K))return K;b=K}}async _dispatchLeg(m,h){switch(m.method){case"elicitation/create":{let f=m.params;if(f.mode==="url"&&f.elicitationId===void 0)f={...f,elicitationId:Em()};return await this._host.sendElicitation(f,h)}case"sampling/createMessage":return await this._host.sendSampling(m.params,h);case"roots/list":return await this._host.listRoots(m.params,h)}}},Tm=new Set(["tools/call","prompts/get","resources/read"]),Cm,il,cl;function be(m,h){il(m,h)}function _e(m){return cl(m)}var qm=class extends wc{_clientCapabilities;_clientVersion;static{Cm=(m,h)=>{if(h.clientCapabilities!==void 0)m._clientCapabilities=h.clientCapabilities;if(h.clientInfo!==void 0)m._clientVersion=h.clientInfo},il=(m,h)=>{let f=h.filter((g)=>!m._supportedProtocolVersions.includes(g));if(f.length>0)m._supportedProtocolVersions=[...m._supportedProtocolVersions,...f];m.setRequestHandler("server/discover",()=>m._ondiscover())},cl=(m)=>m._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new wm({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:(m)=>this._inputRequestCapabilityView(m),verifyRequestState:(m,h,f)=>this._verifyRequestState(m,h,f),sendElicitation:(m,h)=>this._sendElicitationLeg(m,h,{validateAcceptedContent:!1}),sendSampling:(m,h)=>this.createMessage(m,h),listRoots:(m,h)=>this.listRoots(m,h)})}oninitialized;constructor(m,h){super(h);if(this._serverInfo=m,this._capabilities=h?.capabilities?{...h.capabilities}:{},this._instructions=h?.instructions,this._jsonSchemaValidator=h?.jsonSchemaValidator??new Ci,this._requestStateVerify=h?.requestState?.verify,this._inputRequiredServing=Pm(h?.inputRequired),h?.cacheHints!==void 0){for(let[f,g]of Object.entries(h.cacheHints))if(g!==void 0)fi(g,`cacheHints['${f}']`);this._cacheHints=h.cacheHints}if(this.setRequestHandler("initialize",(f)=>this._oninitialize(f)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),li(this._supportedProtocolVersions).length>0)this.setRequestHandler("server/discover",()=>this._ondiscover());if(this._capabilities.logging)this._registerLoggingHandler()}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async(m,h)=>{let f=h.sessionId||h.http?.req?.headers.get("mcp-session-id")||void 0,{level:g}=m.params,S=hn(Jt,g);if(S.success)this._loggingLevels.set(f,S.data);return{}})}buildContext(m,h){let f=m.http||h?.request||h?.closeSSEStream||h?.closeStandaloneSSEStream;return{...m,mcpReq:{...m.mcpReq,log:(g,S,_)=>{if(!this._capabilities.logging)return Promise.resolve();let y;if(this._servedModernEra()){if(y=m.mcpReq.envelope?.[ca],y===void 0)return Promise.resolve()}else y=this._loggingLevels.get(m.sessionId)??this._loggingLevels.get(void 0);if(y!==void 0&&this.LOG_LEVEL_SEVERITY.get(g)<this.LOG_LEVEL_SEVERITY.get(y))return Promise.resolve();return m.mcpReq.notify({method:"notifications/message",params:{level:g,data:S,logger:_}})},elicitInput:(g,S)=>this.elicitInput(g,S),requestSampling:(g,S)=>this.createMessage(g,S)},http:f?{...m.http,req:h?.request,closeSSE:h?.closeSSEStream,closeStandaloneSSE:h?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(Jt.options.map((m,h)=>[m,h]));isMessageIgnored=(m,h)=>{let f=this._loggingLevels.get(h);return f?this.LOG_LEVEL_SEVERITY.get(m)<this.LOG_LEVEL_SEVERITY.get(f):!1};registerCapabilities(m){if(this.transport)throw new Ke(Be.AlreadyConnected,"Cannot register capabilities after connecting to transport");let h=!!this._capabilities.logging;if(this._capabilities=Tc(this._capabilities,m),!h&&this._capabilities.logging)this._registerLoggingHandler()}_wrapHandler(m,h){if(m!=="tools/call"){let f=this._cacheHints?.[m],g=Tm.has(m);if(f===void 0&&!g)return async(S,_)=>{let y=await h(S,_);if(Yt(y))throw new Ve(i.InternalError,`Handler for ${m} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return y};return async(S,_)=>{let y=g?await this._invokeInputRequiredCapableHandler(m,h,S,_):await h(S,_);if(Yt(y)){if(!g)throw new Ve(i.InternalError,`Handler for ${m} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return y}return f===void 0?y:mn(y,f)}}return async(f,g)=>{let S=Bt(this._negotiatedProtocolVersion),_=S.validateRequest("tools/call",f);if(!_.ok)throw new Ve(_.reason==="not-in-era"?i.InternalError:i.InvalidParams,_.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${_.message}`);let y=await this._invokeInputRequiredCapableHandler("tools/call",h,f,g);if(Yt(y))return y;let E=ui(y),b=S.validateResult("tools/call",E);if(!b.ok)throw new Ve(b.reason==="not-in-era"?i.InternalError:i.InvalidParams,b.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${b.message}`);return b.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&Da(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler(m,h,f,g){let S=this._servedModernEra(),_=g.mcpReq.requestState();if(_!==void 0&&typeof _!=="string")throw new Ve(i.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let y=g;if(typeof _==="string"){let D=await this._verifyRequestState(_,g,m);if(D!==void 0)y=bi(g,D)}let E;try{E=await h(f,y)}catch(D){if(D instanceof Ve&&D.code===i.UrlElicitationRequired){if(!S)throw D;throw new Ve(i.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { …: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`)}throw D}if(!Yt(E))return E;if(!S){if(!this._inputRequiredServing.legacyShim)throw new Ve(i.InternalError,`Handler for ${m} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??za}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(m,h,f,y,E)}let b=E.inputRequests,C=b!=null&&Object.keys(b).length>0,O=typeof E.requestState==="string";if(!C&&!O)throw new Ve(i.InternalError,`Handler for ${m} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(C){let D=this._inputRequestCapabilityView(g);for(let[Z,ae]of Object.entries(b)){let{embedded:x,required:K}=nl(m,Z,ae),V=ci(K,D);if(V!==void 0)throw new Si({requiredCapabilities:V},`Cannot request input '${Z}' (${x.method}): the request's client capabilities do not declare the required capability`)}}return E}async _verifyRequestState(m,h,f){if(this._requestStateVerify===void 0)return;try{return await this._requestStateVerify(m,h)}catch(g){throw this.onerror?.(Error(`requestState verification rejected ${f}: ${g instanceof Error?g.message:String(g)}`)),new Ve(i.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView(m){return this._servedModernEra()?m.mcpReq.envelope?.[Dt]:this._clientCapabilities}_assertPushApiInServedEra(m){if(this._servedModernEra())throw new Ke(Be.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${m}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead — the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:m,era:"2026-07-28"})}assertCapabilityForMethod(m){switch(m){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Ke(Be.CapabilityNotSupported,`Client does not support sampling (required for ${m})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Ke(Be.CapabilityNotSupported,`Client does not support elicitation (required for ${m})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Ke(Be.CapabilityNotSupported,`Client does not support listing roots (required for ${m})`);break;case"ping":break}}assertNotificationCapability(m){switch(m){case"notifications/message":if(!this._capabilities.logging)throw new Ke(Be.CapabilityNotSupported,`Server does not support logging (required for ${m})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Ke(Be.CapabilityNotSupported,`Server does not support notifying about resources (required for ${m})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Ke(Be.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${m})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Ke(Be.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${m})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Ke(Be.CapabilityNotSupported,`Client does not support URL elicitation (required for ${m})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(m){switch(m){case"completion/complete":if(!this._capabilities.completions)throw new Ke(Be.CapabilityNotSupported,`Server does not support completions (required for ${m})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Ke(Be.CapabilityNotSupported,`Server does not support logging (required for ${m})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Ke(Be.CapabilityNotSupported,`Server does not support prompts (required for ${m})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Ke(Be.CapabilityNotSupported,`Server does not support resources (required for ${m})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Ke(Be.CapabilityNotSupported,`Server does not support tools (required for ${m})`);break;case"ping":case"initialize":break}}async _oninitialize(m){let h=m.params.protocolVersion;this._clientCapabilities=m.params.capabilities,this._clientVersion=m.params.clientInfo;let f=Qi(this._supportedProtocolVersions),g=f.includes(h)?h:f[0]??za;return this._negotiatedProtocolVersion=g,this.transport?.setProtocolVersion?.(g),{protocolVersion:g,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:li(this._supportedProtocolVersions),capabilities:jm(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult(m,h){return this._wireCodec().projectCallToolResult(m,h)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage(m,h){if(this._assertPushApiInServedEra("sampling/createMessage"),(m.tools||m.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Ke(Be.CapabilityNotSupported,"Client does not support sampling tools capability.");if(m.messages.length>0){let _=m.messages.at(-1),y=Array.isArray(_.content)?_.content:[_.content],E=y.some((D)=>D.type==="tool_result"),b=m.messages.length>1?m.messages.at(-2):void 0,C=b?Array.isArray(b.content)?b.content:[b.content]:[],O=C.some((D)=>D.type==="tool_use");if(E){if(y.some((D)=>D.type!=="tool_result"))throw new Ve(i.InvalidParams,"The last message must contain only tool_result content if any is present");if(!O)throw new Ve(i.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(O){let D=new Set(C.filter((ae)=>ae.type==="tool_use").map((ae)=>ae.id)),Z=new Set(y.filter((ae)=>ae.type==="tool_result").map((ae)=>ae.toolUseId));if(D.size!==Z.size||![...D].every((ae)=>Z.has(ae)))throw new Ve(i.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let f=Boolean(m.tools||m.toolChoice),g=await this.request({method:"sampling/createMessage",params:m},h),S=this._wireCodec().samplingResultVariant(f,g);if(!S.ok)throw new Ke(Be.InvalidResult,`Invalid sampling/createMessage result: ${S.reason==="invalid"?S.message:S.reason}`);return S.value}async elicitInput(m,h){switch(this._assertPushApiInServedEra("elicitation/create"),m.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw new Ke(Be.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new Ke(Be.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg(m,h)}async _sendElicitationLeg(m,h,f){let g=m.mode??"form",S=f?.validateAcceptedContent??!0;switch(g){case"url":{let _=m;return this.request({method:"elicitation/create",params:_},h)}case"form":{let _=m.mode==="form"?m:{...m,mode:"form"},y=await this.request({method:"elicitation/create",params:_},h);if(S&&y.action==="accept"&&y.content&&_.requestedSchema)try{let E=this._jsonSchemaValidator.getValidator(_.requestedSchema)(y.content);if(!E.valid)throw new Ve(i.InvalidParams,`Elicitation response content does not match requested schema: ${E.errorMessage}`)}catch(E){if(E instanceof Ve)throw E;throw new Ve(i.InternalError,`Error validating elicitation response: ${E instanceof Error?E.message:String(E)}`)}return y}}}createElicitationCompletionNotifier(m,h){if(!this._clientCapabilities?.elicitation?.url)throw new Ke(Be.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:m}},h)}async listRoots(m,h){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:m},h)}async sendLoggingMessage(m,h){if(this._capabilities.logging&&!this.isMessageIgnored(m.level,h))return this.notification({method:"notifications/message",params:m})}async sendResourceUpdated(m){return this.notification({method:"notifications/resources/updated",params:m})}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"})}};function jm(m){return{...m}}var M=class{server;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson(m){let h=this._registeredTools[m];if(h===void 0||!h.enabled)return;if(Object.hasOwn(this._toolInputSchemaJson,m))return this._toolInputSchemaJson[m];if(h.inputSchema===void 0)return Qc;try{let f=Wt(h.inputSchema,"input");return this._toolInputSchemaJson[m]=f,f}catch{return}}constructor(m,h){if(this.server=new qm(m,h),h?.capabilities?.tools)this.setToolRequestHandlers();if(h?.capabilities?.resources)this.setResourceRequestHandlers();if(h?.capabilities?.prompts)this.setPromptRequestHandlers()}async connect(m){return await this.server.connect(m)}async close(){await this.server.close()}_toolHandlersInitialized=!1;setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler("tools/list"),this.server.assertCanSetRequestHandler("tools/call"),this.server.registerCapabilities({tools:{listChanged:this.server.getCapabilities().tools?.listChanged??!0}}),this.server.setRequestHandler("tools/list",()=>({tools:Object.entries(this._registeredTools).filter(([,m])=>m.enabled).map(([m,h])=>{let f={name:m,title:h.title,description:h.description,inputSchema:h.inputSchema?Wt(h.inputSchema,"input"):Qc,annotations:h.annotations,icons:h.icons,execution:h.execution,_meta:h._meta};if(h.outputSchema)f.outputSchema=Wt(h.outputSchema,"output");return f})})),this.server.setRequestHandler("tools/call",async(m,h)=>{let f=this._registeredTools[m.params.name];if(!f)throw new Ve(i.InvalidParams,`Tool ${m.params.name} not found`);if(!f.enabled)throw new Ve(i.InvalidParams,`Tool ${m.params.name} disabled`);try{let g=await this.validateToolInput(f,m.params.arguments,m.params.name),S=await this.executeToolHandler(f,g,h);if(await this.validateToolOutput(f,S,m.params.name),Yt(S))return S;return this.server.projectCallToolResult(S,f.outputSchemaJson)}catch(g){if(g instanceof Ve&&g.code===i.UrlElicitationRequired)throw g;return this.createToolError(g instanceof Error?g.message:String(g))}}),this._toolHandlersInitialized=!0}createToolError(m){return{content:[{type:"text",text:m}],isError:!0}}async validateToolInput(m,h,f){if(!m.inputSchema)return;let g=await ua(m.inputSchema,h??{});if(!g.success)throw new Ve(i.InvalidParams,`Input validation error: Invalid arguments for tool ${f}: ${g.error}`);return g.data}async validateToolOutput(m,h,f){if(!m.outputSchema)return;if(Yt(h))return;if(h.isError)return;if(h.structuredContent===void 0)throw new Ve(i.InvalidParams,`Output validation error: Tool ${f} has an output schema but no structured content was provided`);let g=await ua(m.outputSchema,h.structuredContent);if(!g.success)throw new Ve(i.InvalidParams,`Output validation error: Invalid structured content for tool ${f}: ${g.error}`)}async executeToolHandler(m,h,f){return m.executor(h,f)}_completionHandlerInitialized=!1;setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async(m)=>{switch(m.params.ref.type){case"ref/prompt":return pc(m),this.handlePromptCompletion(m,m.params.ref);case"ref/resource":return fc(m),this.handleResourceCompletion(m,m.params.ref);default:throw new Ve(i.InvalidParams,`Invalid completion reference: ${m.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion(m,h){let f=this._registeredPrompts[h.name];if(!f)throw new Ve(i.InvalidParams,`Prompt ${h.name} not found`);if(!f.enabled)throw new Ve(i.InvalidParams,`Prompt ${h.name} disabled`);if(!f.argsSchema)return Wr;let g=ol(rl(f.argsSchema)?.[m.params.argument.name]);if(!Wc(g))return Wr;let S=Sm(g);if(!S)return Wr;return al(await S(m.params.argument.value,m.params.context))}async handleResourceCompletion(m,h){let f=Object.values(this._registeredResourceTemplates).find((S)=>S.resourceTemplate.uriTemplate.toString()===h.uri);if(!f){if(this._registeredResources[h.uri])return Wr;throw new Ve(i.InvalidParams,`Resource template ${m.params.ref.uri} not found`)}let g=f.resourceTemplate.completeCallback(m.params.argument.name);if(!g)return Wr;return al(await g(m.params.argument.value,m.params.context))}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler("resources/list"),this.server.assertCanSetRequestHandler("resources/templates/list"),this.server.assertCanSetRequestHandler("resources/read"),this.server.registerCapabilities({resources:{listChanged:this.server.getCapabilities().resources?.listChanged??!0}}),this.server.setRequestHandler("resources/list",async(m,h)=>{let f=Object.entries(this._registeredResources).filter(([S,_])=>_.enabled).map(([S,_])=>({uri:S,name:_.name,..._.metadata})),g=[];for(let S of Object.values(this._registeredResourceTemplates)){if(!S.resourceTemplate.listCallback)continue;let _=await S.resourceTemplate.listCallback(h);for(let y of _.resources)g.push({...S.metadata,...y})}return{resources:[...f,...g]}}),this.server.setRequestHandler("resources/templates/list",async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([m,h])=>({name:m,uriTemplate:h.resourceTemplate.uriTemplate.toString(),...h.metadata}))})),this.server.setRequestHandler("resources/read",async(m,h)=>{let f;try{f=new URL(m.params.uri)}catch{throw new Ve(i.InvalidParams,`Resource URI ${m.params.uri} is invalid`,{uri:m.params.uri,reason:"invalid_uri"})}let g=this._registeredResources[f.toString()];if(g){if(!g.enabled)throw new Ve(i.InvalidParams,`Resource ${f} disabled`);return mn(await g.readCallback(f,h),g.cacheHint)}for(let S of Object.values(this._registeredResourceTemplates)){let _=S.resourceTemplate.uriTemplate.match(f.toString());if(_)return mn(await S.readCallback(f,_,h),S.cacheHint)}throw new gi(m.params.uri)}),this._resourceHandlersInitialized=!0}_promptHandlersInitialized=!1;setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler("prompts/list"),this.server.assertCanSetRequestHandler("prompts/get"),this.server.registerCapabilities({prompts:{listChanged:this.server.getCapabilities().prompts?.listChanged??!0}}),this.server.setRequestHandler("prompts/list",()=>({prompts:Object.entries(this._registeredPrompts).filter(([,m])=>m.enabled).map(([m,h])=>({name:m,title:h.title,description:h.description,arguments:h.argsSchema?_c(h.argsSchema):void 0,icons:h.icons,_meta:h._meta}))})),this.server.setRequestHandler("prompts/get",async(m,h)=>{let f=this._registeredPrompts[m.params.name];if(!f)throw new Ve(i.InvalidParams,`Prompt ${m.params.name} not found`);if(!f.enabled)throw new Ve(i.InvalidParams,`Prompt ${m.params.name} disabled`);return f.handler(m.params.arguments,h)}),this._promptHandlersInitialized=!0}registerResource(m,h,f,g){let S=f.cacheHint,_=f;if(S!==void 0){fi(S,`resource ${m}`);let y={...f};delete y.cacheHint,_=y}if(typeof h==="string"){if(this._registeredResources[h])throw Error(`Resource ${h} is already registered`);let y=this._createRegisteredResource(m,f.title,h,_,g);if(S!==void 0)y.cacheHint=S;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),y}else{if(this._registeredResourceTemplates[m])throw Error(`Resource template ${m} is already registered`);let y=this._createRegisteredResourceTemplate(m,f.title,h,_,g);if(S!==void 0)y.cacheHint=S;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),y}}_createRegisteredResource(m,h,f,g,S){let _={name:m,title:h,metadata:g,readCallback:S,enabled:!0,disable:()=>_.update({enabled:!1}),enable:()=>_.update({enabled:!0}),remove:()=>_.update({uri:null}),update:(y)=>{if(y.uri!==void 0&&y.uri!==f){if(delete this._registeredResources[f],y.uri)this._registeredResources[y.uri]=_}if(y.name!==void 0)_.name=y.name;if(y.title!==void 0)_.title=y.title;if(y.metadata!==void 0)_.metadata=y.metadata;if(y.callback!==void 0)_.readCallback=y.callback;if(y.enabled!==void 0)_.enabled=y.enabled;this.sendResourceListChanged()}};return this._registeredResources[f]=_,_}_createRegisteredResourceTemplate(m,h,f,g,S){let _={resourceTemplate:f,title:h,metadata:g,readCallback:S,enabled:!0,disable:()=>_.update({enabled:!1}),enable:()=>_.update({enabled:!0}),remove:()=>_.update({name:null}),update:(E)=>{if(E.name!==void 0&&E.name!==m){if(delete this._registeredResourceTemplates[m],E.name)this._registeredResourceTemplates[E.name]=_}if(E.title!==void 0)_.title=E.title;if(E.template!==void 0)_.resourceTemplate=E.template;if(E.metadata!==void 0)_.metadata=E.metadata;if(E.callback!==void 0)_.readCallback=E.callback;if(E.enabled!==void 0)_.enabled=E.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[m]=_;let y=f.uriTemplate.variableNames;if(Array.isArray(y)&&y.some((E)=>!!f.completeCallback(E)))this.setCompletionRequestHandler();return _}_createRegisteredPrompt(m,h,f,g,S,_,y){let E=g,b=S,C={title:h,description:f,argsSchema:g,icons:_,_meta:y,handler:tl(m,g,S),enabled:!0,disable:()=>C.update({enabled:!1}),enable:()=>C.update({enabled:!0}),remove:()=>C.update({name:null}),update:(O)=>{if(O.name!==void 0&&O.name!==m){if(delete this._registeredPrompts[m],O.name)this._registeredPrompts[O.name]=C}if(O.title!==void 0)C.title=O.title;if(O.description!==void 0)C.description=O.description;if(O.icons!==void 0)C.icons=O.icons;if(O._meta!==void 0)C._meta=O._meta;let D=!1;if(O.argsSchema!==void 0)C.argsSchema=O.argsSchema,E=O.argsSchema,D=!0;if(O.callback!==void 0)b=O.callback,D=!0;if(D)C.handler=tl(m,E,b);if(O.enabled!==void 0)C.enabled=O.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[m]=C,g){let O=rl(g);if(O){if(Object.values(O).some((D)=>Wc(ol(D))))this.setCompletionRequestHandler()}}return C}_createRegisteredTool(m,h,f,g,S,_,y,E,b,C){if(Ri(m),g!==void 0)try{let Z=Wt(g,"input");this._toolInputSchemaJson[m]=Z;let ae=gc(Z);if(!ae.valid)console.warn(`[mcp-sdk] tool '${m}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${ae.reason}`)}catch{}let O=C,D={title:h,description:f,inputSchema:g,outputSchema:S,outputSchemaJson:el(S),annotations:_,icons:y,execution:E,_meta:b,handler:C,executor:Xc(g,C),enabled:!0,disable:()=>D.update({enabled:!1}),enable:()=>D.update({enabled:!0}),remove:()=>D.update({name:null}),update:(Z)=>{if(Z.name!==void 0&&Z.name!==m){if(typeof Z.name==="string")Ri(Z.name);if(delete this._registeredTools[m],delete this._toolInputSchemaJson[m],Z.name)delete this._toolInputSchemaJson[Z.name],this._registeredTools[Z.name]=D,m=Z.name}if(Z.title!==void 0)D.title=Z.title;if(Z.description!==void 0)D.description=Z.description;let ae=!1;if(Z.paramsSchema!==void 0)D.inputSchema=Z.paramsSchema,delete this._toolInputSchemaJson[m],ae=!0;if(Z.callback!==void 0)D.handler=Z.callback,O=Z.callback,ae=!0;if(ae)D.executor=Xc(D.inputSchema,O);if(Z.outputSchema!==void 0)D.outputSchema=Z.outputSchema,D.outputSchemaJson=el(Z.outputSchema);if(Z.annotations!==void 0)D.annotations=Z.annotations;if(Z.icons!==void 0)D.icons=Z.icons;if(Z._meta!==void 0)D._meta=Z._meta;if(Z.enabled!==void 0)D.enabled=Z.enabled;this.sendToolListChanged()}};return this._registeredTools[m]=D,this.setToolRequestHandlers(),this.sendToolListChanged(),D}registerTool(m,h,f){if(this._registeredTools[m])throw Error(`Tool ${m} is already registered`);let{title:g,description:S,inputSchema:_,outputSchema:y,annotations:E,icons:b,_meta:C}=h;return this._createRegisteredTool(m,g,S,pn(_),pn(y),E,b,void 0,C,f)}registerPrompt(m,h,f){if(this._registeredPrompts[m])throw Error(`Prompt ${m} is already registered`);let{title:g,description:S,argsSchema:_,icons:y,_meta:E}=h,b=this._createRegisteredPrompt(m,g,S,pn(_),f,y,E);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),b}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(m,h){return this.server.sendLoggingMessage(m,h)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}};function Xc(m,h){if(m){let g=h;return async(S,_)=>g(S,_)}let f=h;return async(g,S)=>f(S)}var Qc={type:"object",properties:{}};function el(m){if(m===void 0)return;try{return Wt(m,"output")}catch{return}}function tl(m,h,f){if(h){let g=f;return async(S,_)=>{let y=await ua(h,S);if(!y.success)throw new Ve(i.InvalidParams,`Invalid arguments for prompt ${m}: ${y.error}`);return g(y.data,_)}}else{let g=f;return async(S,_)=>g(_)}}function al(m){return{completion:{values:m.map(String).slice(0,100),total:m.length,hasMore:m.length>100}}}var Wr={completion:{values:[],hasMore:!1}};function rl(m){let h=m;if(h.shape&&typeof h.shape==="object")return h.shape}function Nm(m){return m?.type==="optional"}function ol(m){if(!Nm(m))return m;return m.def?.innerType??m}
|
|
15
|
-
export{z,i,L,A,G,J,Y,v,P,X,re,oe,fe,ge,ye,Se,se,ie,ve,be,_e,M};
|